2006031459黃德榮5位逐級進位和超前進位加法器設計剖析_第1頁
2006031459黃德榮5位逐級進位和超前進位加法器設計剖析_第2頁
2006031459黃德榮5位逐級進位和超前進位加法器設計剖析_第3頁
2006031459黃德榮5位逐級進位和超前進位加法器設計剖析_第4頁
2006031459黃德榮5位逐級進位和超前進位加法器設計剖析_第5頁
已閱讀5頁,還剩4頁未讀, 繼續(xù)免費閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)

文檔簡介

1、深圳大學實驗報告課程名稱: VHDL 數(shù)字電路設計教程 實驗項目名稱: 5 位逐級進位和超前進位加法器設計 學院:信息工程學院專業(yè): 電子信息工程指導教師:梁松海報告人:黃德榮 學號: 20006031459 班級: 1 班實驗時間: 2008.10.22實驗報告提交時間: 2008.11.5教務處制實驗目的與要求 :用 XILINX ISE 7.1i 實現(xiàn)逐級進位和超前進位加法器方法、步驟:1,逐級進位加法器對每一位都使用了全加器 FAU,圖中a和b是輸入位, cin是進位輸入位。 S是求和 的結(jié)果, cout 是進位輸出位。 C 是進位矢量。圖中每個全加器的輸出結(jié)果都依賴于前一 級產(chǎn)生的進

2、位。由全加器的特性,可以寫出如下的邏輯表達式:S=a XOR b XOR cincout=(a AND )( AND cin ) OR( b AND cin ) 2,超前進位加法器電路實現(xiàn)是需要兩個非常重要的中間信號:generate 和 propagate,分別由 g 和 p 表示。加法器兩個輸入位是 a 和 b,則 generate和 propagate 信號定義如下:g=a AND bp=a XOR b 這兩個信號與進位無關(guān),只根據(jù)當前的輸入計算。現(xiàn)在兩個輸入矢量是: a=a(4)a(3)a(2)a(1)a(0) 和 b=b(4)b(3)b(2)b(1)b(0), 那么相應的 gener

3、ate矢量為 g=g(4)g(3)g(2)g(1)g(0) ,相應的 propagate 矢量為 p=p(4)p(3)p(2)p(1)p(0) 。 其中:g(j)=a (j) AND b(j)p(j)=a (j)XOR b(j)同時,進位矢量用 c=c(4)c(3)c(2)c(1)c(0) 。進位可由 g 和 p 按照下面的方法計算得 到:c(0) = cin;c(1) = c(0)p(0)+g(0);c(2) = c(0)p(0)p(1)+g(0)p(1)+g(1);c(3) = c(0)p(0)p(1) p(2)+g(0)p(1)p(2)+(g(1) p(2)+g(2);c(4) = c(

4、0)p(0) p(1) p(2) p(3)+g(0) p(1) p(2) p(3)+g(1) p(2) p(3)+g(2) p(3)+g(3);c(5) =c(0)p(0) p(1) p(2) p(3) p(4)+g(0) p(1) p(2)p(3) p(4)+g(1) p(2) p(3) p(4)+g(2) p(3) p(4)+g(4);可見超前進位加法器的每個全加器不依賴與前一級進位輸出的計算結(jié)果,有利于 提高電路執(zhí)行速度。實驗過程及內(nèi)容:1, 逐級進位加法器VHDL 代碼- Company:- Engineer:- Create Date: 02:59:18 10/22/08- Desi

5、gn Name:- Module Name: adder - Behavioral- Project Name:- Target Device:- Tool versions:- Description:- Dependencies:- Revision:- Revision 0.01 - File Created- Additional Comments:library IEEE;use IEEE.STD_LOGIC_1164.ALL;use IEEE.STD_LOGIC_ARITH.ALL;use IEEE.STD_LOGIC_UNSIGNED.ALL; Uncomment the fol

6、lowing library declaration if instantiating any Xilinx primitives in this code.-library UNISIM;-use UNISIM.VComponents.all;entity adder is port(a,b:in std_logic_vector(4 downto 0); cin:in std logic;s: out std_logic_vector(4 downto 0); cout:out std_logic);end adder;architecture Behavioral of adder is

7、 signal c:std_logic_vector(4 downto 0);begin c(0)=cin; s(0)=a(0) xor b(0) xor c(0);c(1)=(a(0)and b(0)or (a(0)and c(0)or (b(0)and c(0);s(1)=a(1) xor b(1) xor c(1); c(2)=(a(1)and b(1)or (a(1)and c(1)or (b(1)and c(1);s(2)=a(2) xor b(2) xor c(2); c(3)=(a(2)and b(2)or (a(2)and c(2)or (b(2)and c(2);s(3)=a

8、(3) xor b(3) xor c(3); c(4)=(a(3)and b(3)or (a(3)and c(3)or (b(3)and c(3);s(4)=a(4) xor b(4) xor c(4); cout=(a(4)and b(4)or (a(4)and c(4)or (b(4)and c(4);end Behavioral;仿真波形2,超前進位加法器VHDL 代碼- Company:- Engineer:- Create Date: 14:51:14 11/05/08- Design Name:- Module Name: sd - Behavioral- Project Name

9、:- Target Device:- Tool versions:- Description:- Dependencies:- Revision:- Revision 0.01 - File Created- Additional Comments: library IEEE;use IEEE.STD_LOGIC_1164.ALL;use IEEE.STD_LOGIC_ARITH.ALL;use IEEE.STD_LOGIC_UNSIGNED.ALL; Uncomment the following library declaration if instantiating any Xilinx

10、 primitives in this code.-library UNISIM;-use UNISIM.VComponents.all;entity sd isport (a,b: in std_logic_vector (4 downto 0); cin: in std_logic;s: out std_logic_vector(4 downto 0); cout: out std_logic);end sd;architecture Behavioral of sd issignal c:std_logic_vector(5 downto 0);signal p:std_logic_ve

11、ctor(4 downto 0);signal g:std_logic_vector(4 downto 0);beginp(0)=a(0) xor b(0);g(0)=a(0) and b(0);c(0)=cin;s(0)=p(0) xor c(0);p(1)=a(1) xor b(1);g(1)=a(1) and b(1);c(1)=(cin and p(0)or g(0);s(1)=p(1) xor c(1);p(2)=a(2) xor b(2);g(2)=a(2) and b(2); c(2)=(cin and p(0) and p(1) or (g(0)and p(1) or g(1)

12、;s(2)=p(2) xor c(2);p(3)=a(3) xor b(3);g(3)=a(3) and b(3);c(3)=(cin and p(0) and p(1)and p(2) or (g(0)and p(1) and p(2) or (g(1)and p(2) or g(2);s(3)=p(3) xor c(3);p(4)=a(4) xor b(4);g(4)=a(4) and b(4);c(4)=(cin and p(0) and p(1)and p(2)and p(3) or (g(0)and p(1) and p(2) and p(3) or (g(1)and p(2) and p(3) or (g(2)and p(3) or g(3);s(4)=p(4) xor c(4);c(5)=(cin and p(0) and p(1) and p(2)and p(3) and p(4) or (g(0)and p(1) and p(2) and p(3)and p(4) or (g(1)and p(2) and p(3) and p(4) or (g(2)and g(3) and p(4) o

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
  • 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論