全加器,四位串行加法器_第1頁
全加器,四位串行加法器_第2頁
全加器,四位串行加法器_第3頁
全加器,四位串行加法器_第4頁
全加器,四位串行加法器_第5頁
已閱讀5頁,還剩7頁未讀 繼續(xù)免費閱讀

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領

文檔簡介

1、VHDL硬件描述語言全加器四位串行加法器電路的三種設計方法 結構化電路設計方法:通過對電路結構的描述來建模,即通過對器件的調用(HDL概念稱為例化), 運用組件(component)語句實現(xiàn)。 數(shù)據(jù)流式電路設計方法:通過對數(shù)據(jù)流在設計中的具體行為的描述來建模。 行為式電路設計方法:是指采用對信號行為級的描述來建模。抽象程度比數(shù)據(jù)流描述形式和結構描述形式高得多,常采用算術運算、關系運算等語句實現(xiàn)。該方法常用于系統(tǒng)數(shù)學模型的仿真或是系統(tǒng)工作原理的仿真。一般VHDL程序的結構庫、程序包實體(ENTITY)結構體 (ARCHITECTURE)配置(CONFIGURATION)設計實體 庫聲明:實現(xiàn)庫的

2、調用,具體調用的是程序包中的內容庫聲明:實現(xiàn)庫的調用,具體調用的是程序包中的內容 實體:描述電路的外部特性,即電路的實體:描述電路的外部特性,即電路的輸入輸入與與輸出輸出; 結構:描述電路內部實現(xiàn)的結構:描述電路內部實現(xiàn)的功能功能; VHDLVHDL允許一個實體對應多種結構。允許一個實體對應多種結構。全加器(邏輯圖)全加器(數(shù)據(jù)流式) -quanjia library ieee; use ieee.std_logic_1164.all; entity f_adder is port(x,y,cin:in std_logic; s,cout:out std_logic); end entity

3、f_adder; architecture bhv of f_adder is begin g0:s=x xor y xor cin; g1:cout=(x and y)or(x and cin)or(y and cin); end architecture bhv;四位串行加法器(邏輯圖)四位串行加法器(結構體式) -adder4 library ieee; use ieee.std_logic_1164.all; entity adder4 is port(x,y:in std_logic_vector(3 downto 0); c0:in std_logic; s:out std_log

4、ic_vector(3 downto 0); c4:out std_logic); end entity adder4; architecture structural of adder4 is component f_adder port(x,y,cin:in std_logic; s,cout:out std_logic); end component f_adder; signal c: std_logic_vector(0 to 4); begin g0:f_adder port map(x(0),y(0),c(0),s(0),c(1); g1:f_adder port map(x(1

5、),y(1),c(1),s(1),c(2); g2:f_adder port map(x(2),y(2),c(2),s(2),c(3); g3:f_adder port map(x(3),y(3),c(3),s(3),c(4); c(0)=c0; c4=c(4); end structural;四位全加器(行為描述式)library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity bit_f_adder is port(cin: in std_logic;a,b : in std_logic_vec

6、tor(3 downto 0);s: out std_logic_vector(3 downto 0);cout: out std_logic);end bit_f_adder;architecture bhv of bit_f_adder issignal x,y,z:std_logic_vector(4 downto 0);beginx=0&a(3 downto 0);y=0&b(3 downto 0);z=x+y+cin;s(3 downto 0)=z(3 downto 0);cout=z(4);end bhv;謝謝觀賞并行加法器(邏輯圖)library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity bit_f_adder is port(cin: in std_logic;a,b : in std_logic_vector(3 downto 0);s: out std_logic_vector(3 downto 0);cout: out std_logic);end bit_f_adder;architecture bhv of bit_f_adder issignal x,y,z:std_logic_vector(4 downto 0);beginx

溫馨提示

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

評論

0/150

提交評論