VHDL設(shè)計初步_第1頁
VHDL設(shè)計初步_第2頁
VHDL設(shè)計初步_第3頁
VHDL設(shè)計初步_第4頁
VHDL設(shè)計初步_第5頁
已閱讀5頁,還剩94頁未讀, 繼續(xù)免費閱讀

下載本文檔

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

文檔簡介

1、eda & cpldeda & cpldz原理圖輸入與 vhdl文本輸入設(shè)計的區(qū)別ygraphic is what you draw is what you getx“ tell me what hardware you want and i will give it to you”yvhdl is what you write is what functional you getx“ tell me how your circuit should behave and the vhdl compiler will give you the hardware that does

2、 the job”x but the designer can not control how the circuit implement什么是vhdl? very high speed integrated hardware description language (vhdl)y是ieee、工業(yè)標(biāo)準(zhǔn)硬件描述語言y用語言的方式而非圖形等方式描述硬件電路x容易修改x容易保存y特別適合于設(shè)計的電路有:x復(fù)雜組合邏輯電路,如: 譯碼器、編碼器、加減法器、多路選擇器、地址譯碼器.x狀態(tài)機x等等.vhdlvhdl的功能和標(biāo)準(zhǔn)的功能和標(biāo)準(zhǔn)z vhdl 描述y輸入端口y輸出端口y電路的行為和功能zvhdl

3、有過兩個標(biāo)準(zhǔn):yieee std 1076-1987 (called vhdl 1987)yieee std 1076-1993 (called vhdl 1993)5vhdl語言語言 支持行為描述與結(jié)構(gòu)描述的混合使用支持行為描述與結(jié)構(gòu)描述的混合使用 描述對象:實體描述對象:實體 entity 頂級實體頂級實體 系統(tǒng)模塊系統(tǒng)模塊 低級實體低級實體 低層次的設(shè)計模塊低層次的設(shè)計模塊 高級實體可將低級實體作為元件調(diào)用高級實體可將低級實體作為元件調(diào)用實體描述:實體描述: 實體說明實體說明 entity引導(dǎo),引導(dǎo),edn entity 實體名結(jié)束實體名結(jié)束 結(jié)構(gòu)體結(jié)構(gòu)體 architechture引導(dǎo)

4、,引導(dǎo),end architechture 結(jié)構(gòu)體名結(jié)束結(jié)構(gòu)體名結(jié)束 順序語句:同普通軟件,按排列順序執(zhí)行順序語句:同普通軟件,按排列順序執(zhí)行 并行語句:無論多少行,同時執(zhí)行并行語句:無論多少行,同時執(zhí)行 結(jié)構(gòu)式:電路元件安裝結(jié)構(gòu)式:電路元件安裝 結(jié)構(gòu)結(jié)構(gòu) 例程序例程序5.1 行為式:功能和行為行為式:功能和行為 相應(yīng)結(jié)構(gòu)相應(yīng)結(jié)構(gòu) 例程序例程序5.2 算法式:電路和邏輯功能都不知(適用于高層模塊,電路實現(xiàn)時可以有多算法式:電路和邏輯功能都不知(適用于高層模塊,電路實現(xiàn)時可以有多 種不同的實現(xiàn)方案)例程序種不同的實現(xiàn)方案)例程序5.3 例例 1 1 結(jié)構(gòu)式結(jié)構(gòu)式 begingbegingu1:n

5、and2 port map (a=set,b=qb,c=q);u1:nand2 port map (a=set,b=qb,c=q);u2:nand2 port map (a=reset, b=q, c=qb);u2:nand2 port map (a=reset, b=q, c=qb);例例 2 2 行為式行為式archtecture rs_behav of rsff isarchtecture rs_behav of rsff isbeginbegin q=not (qb and set); q=not (qb and set); qb=not(q and reset); qb=not(q

6、and reset);end rs_behav;end rs_behav;例例 3 3 算法式算法式archtecture rs_alg of rsff isarchtecture rs_alg of rsff isbeginbegin assert not (reset=“0” and set=“0”); - assert not (reset=“0” and set=“0”); -輸入為輸入為0000,輸出不定,報告錯誤,輸出不定,報告錯誤 report “input is 00” report “input is 00” severity error; severity error; i

7、f set=1 and reset=1then if set=1 and reset=1then 輸入為輸入為1111,輸出不變,輸出不變 . vhdl程序基本結(jié)構(gòu)vhdl synthesis vs. other hdls synthesiszvhdl: “tell me how your circuit should behave and i will give you hardware that does the job”zabel, palasm, ahdl:“tell me what hardware you want and i will give it to you”why usi

8、ng vhdl instead of graphiczeasy to modifyzit is more powerful than graphiczvhdl is a portable language becauseyis device independentythe same code can be applied to device manufactured by company a or company b 【例5-1】entity mux21a is port( a, b : in bit ; s : in bit; y : out bit ) ;end entity mux21a

9、 ;architecture one of mux21a is begin y = a when s = 0 else b ;end architecture one ;實體實體結(jié)構(gòu)體結(jié)構(gòu)體5.1 多路選擇器多路選擇器vhdl描述描述圖圖5-1 mux21a實體實體圖圖5-2 mux21a結(jié)構(gòu)體結(jié)構(gòu)體5.1.1 2選選1多路選擇器的多路選擇器的vhdl描述描述5.1.1 2選選1多路選擇器的多路選擇器的vhdl描述描述【例【例5-2】 entity mux21a is port ( a, b : in bit; s : in bit; y : out bit ); end entity mux

10、21a;architecture one of mux21a is signal d,e : bit; begind = a and (not s) ;e = b and s ;y = d or e ; end architecture one ;【例【例5-3】 . . . architecture one of mux21a is begin y = (a and (not s) or (b and s) ; end architecture one;并行語句用boolean方程表達5.1.1 2選選1多路選擇器的多路選擇器的vhdl描述描述【例【例5-4】entity mux21a is

11、 port ( a, b, s: in bit; y : out bit );end entity mux21a;architecture one of mux21a is begin process (a,b,s) begin if s = 0 then y = a ; else y = b ; end if; end process;end architecture one ;順序語句5.1.1 2選選1多路選擇器的多路選擇器的vhdl描述描述四種描述方法四種描述方法 電路結(jié)構(gòu)相同電路結(jié)構(gòu)相同 綜合綜合5.1.1 2選選1多路選擇器的多路選擇器的vhdl描述描述圖圖5-3 mux21a功能

12、時序波形功能時序波形5.1.2 vhdl相關(guān)語句說明相關(guān)語句說明1. 1. 實體表達實體表達【例【例5-5】entity e_name is port ( p_name : port_m data_type; . p_name : port_m data_type );end entity e_name;或:或:【例【例5-6】entity e_name is port ( p_name : port_m data_type; . p_namei : port_mi data_type );end e_name;93版版87版版5.1.2 vhdl相關(guān)語句說明相關(guān)語句說明2. 2. 實體名實體

13、名 不可用數(shù)字開頭、中文、已有實體名不可用數(shù)字開頭、中文、已有實體名3. 3. portport語句和端口信號名語句和端口信號名 信號名唯一信號名唯一4. 4. 端口模式端口模式( (定義端口上數(shù)據(jù)的流動方向和方式)定義端口上數(shù)據(jù)的流動方向和方式)inoutinoutbuffer5. 5. 數(shù)據(jù)類型數(shù)據(jù)類型bit bit 00和和11加引號加引號, ,否則為整數(shù)否則為整數(shù)integerinteger注注:bit:bit數(shù)據(jù)類型的定義在標(biāo)準(zhǔn)程序包數(shù)據(jù)類型的定義在標(biāo)準(zhǔn)程序包standardstandard中中,standard,standard在標(biāo)準(zhǔn)庫在標(biāo)準(zhǔn)庫stdstd中中5.1.2 vhdl相

14、關(guān)語句說明相關(guān)語句說明6. 6. 結(jié)構(gòu)體表達結(jié)構(gòu)體表達【例【例5-7】architecture arch_name of e_name is (說明語句說明語句)begin (功能描述語句功能描述語句)end architecture arch_name ;或:或:【例【例5-8】architecture arch_name of e_name is (說明語句說明語句)begin (功能描述語句功能描述語句)end arch_name ;7. 7. 信號傳輸信號傳輸( (賦值賦值) )符號和數(shù)據(jù)比較符號符號和數(shù)據(jù)比較符號a a、y=a y=a 賦值賦值 ; 以后發(fā)生,理解為延時以后發(fā)生,理解

15、為延時 ; 兩邊數(shù)據(jù)類型相同兩邊數(shù)據(jù)類型相同b b、s=0s=0比較;輸出結(jié)果的數(shù)據(jù)類型比較;輸出結(jié)果的數(shù)據(jù)類型booleanboolean,取值,取值true or false(1or 0)true or false(1or 0)5.1.2 vhdl相關(guān)語句說明相關(guān)語句說明8. 8. 邏輯操作符邏輯操作符7 7種:種:andand、oror、nandnand、nornor、xorxor、xnorxnor、notnot 要求的操作數(shù)(操作對象)的數(shù)據(jù)類型:要求的操作數(shù)(操作對象)的數(shù)據(jù)類型:bitbit、booleanboolean、std_logicstd_logic9. 9. if_the

16、nif_then條件語句條件語句 順序語句順序語句10. 10. when_elsewhen_else條件信號賦值語句條件信號賦值語句 并行賦值并行賦值賦值目標(biāo)賦值目標(biāo) = 表達式表達式 when 賦值條件賦值條件 else 表達式表達式 when 賦值條件賦值條件 else . 表達式表達式 ;11. 11. processprocess進程語句和順序語句進程語句和順序語句 合法的順序語句必須在進程語句中合法的順序語句必須在進程語句中 一個結(jié)構(gòu)體中可以有任意個進程語句,所有的進程語句都是并行語句,而由任一一個結(jié)構(gòu)體中可以有任意個進程語句,所有的進程語句都是并行語句,而由任一 進程進程proc

17、ess引導(dǎo)的語句結(jié)構(gòu)屬于順序語句。引導(dǎo)的語句結(jié)構(gòu)屬于順序語句。12. 12. 文件取名和存盤文件取名和存盤 文件名同實體名,在元件例化語句中元件名同文件名文件名同實體名,在元件例化語句中元件名同文件名5.1.3 vhdl設(shè)計的基本概念和語句小節(jié)設(shè)計的基本概念和語句小節(jié)數(shù)據(jù)類型信號賦值符條件比較符 延時實體結(jié)構(gòu)體端口定義端口模式邏輯操作符if條件語句并行條件語句進程語句順序語句并行語句文件取名文件存盤5.2 寄存器描述及其寄存器描述及其vhdl語言現(xiàn)象語言現(xiàn)象5.2.1 d觸發(fā)器的觸發(fā)器的vhdl描述描述【例5-9】library ieee ;use ieee.std_logic_1164.al

18、l ; entity dff1 is port (clk : in std_logic ; d : in std_logic ; q : out std_logic ); end ; architecture bhv of dff1 is signal q1 : std_logic ; -類似于在芯片內(nèi)部定義一個數(shù)據(jù)的暫存節(jié)點類似于在芯片內(nèi)部定義一個數(shù)據(jù)的暫存節(jié)點 begin process (clk) begin if clkevent and clk = 1 -邊沿測試語句邊沿測試語句,有上升沿結(jié)果為有上升沿結(jié)果為true then q1 = d ; -if不完整條件語句不完整條件語句 e

19、nd if; q = q1 ; -將內(nèi)部的暫存數(shù)據(jù)向端口輸出將內(nèi)部的暫存數(shù)據(jù)向端口輸出 end process ; end bhv;d觸發(fā)器觸發(fā)器5.2.2 d觸發(fā)器觸發(fā)器vhdl描述的語言現(xiàn)象說明描述的語言現(xiàn)象說明1. 1. 標(biāo)準(zhǔn)邏輯位數(shù)據(jù)類型標(biāo)準(zhǔn)邏輯位數(shù)據(jù)類型std_logicstd_logicbit數(shù)據(jù)類型定義: type bit is(0,1);type bit is(0,1);std_logic數(shù)據(jù)類型定義:type std_logic is (u,x,0,1,z,w,l,h,-);type std_logic is (u,x,0,1,z,w,l,h,-);std_logic所定義的

20、9種數(shù)據(jù)的含義是:uu表示未初始化的;表示未初始化的; xx表示強未知的;表示強未知的; 0 0表示強表示強邏輯邏輯0 0; 1 1表示強邏輯表示強邏輯1 1; zz表示高阻態(tài);表示高阻態(tài); w w 表示弱未知的;表示弱未知的; ll表示弱邏輯表示弱邏輯0 0; hh表示弱表示弱邏輯邏輯1 1; - -表示忽略。表示忽略。注注:在數(shù)字器件中實現(xiàn)的有其中在數(shù)字器件中實現(xiàn)的有其中4種種,x(-)、)、0、1、z5.2.2 d觸發(fā)器觸發(fā)器vhdl描述的語言現(xiàn)象說明描述的語言現(xiàn)象說明2. 2. 設(shè)計庫和標(biāo)準(zhǔn)程序包設(shè)計庫和標(biāo)準(zhǔn)程序包3. 3. signalsignal信號定義和數(shù)據(jù)對象信號定義和數(shù)據(jù)對象

21、【例5-10】architecture bhv of dff1 is begin process (clk) begin if clkevent and clk = 1 then q = d ; end if; end process ;end ;使用庫和程序包的一般定義表式是: library library ; use use .all ; all ; library ieee ;use ieee.std_logic_1164.all ;在在iee庫中的庫中的std_logic_1164程序包程序包中定義中定義std_logic數(shù)據(jù)類型數(shù)據(jù)類型signal q1 : std_logic ;

22、signal:定義某標(biāo)識符為信號q1 數(shù)據(jù)對象:信號 數(shù)據(jù)類型: std_logic 信號:signal 數(shù)據(jù)對象 變量:variable 常量:constant數(shù)據(jù)對象信號signal 和變量 variablezsignal assignmentyreceive the assign value after a period of timezvariable assignmentyhappens immediately when the statement is executed, no delaysignals vs. variablesrepresent circuitrepresent

23、 local storageinterconnectglobal scope (anywhere)local scope(inside process)updated at end of processupdated immediately(new value not available)(new value available) signalsvariables utility: scope:behavior:5.2.2 d觸發(fā)器觸發(fā)器vhdl描述的語言現(xiàn)象說明描述的語言現(xiàn)象說明4. 4. 上升沿檢測表式和信號屬性函數(shù)上升沿檢測表式和信號屬性函數(shù)eventevent 關(guān)鍵詞event是信號屬

24、性,vhdl通過以下表式來測定某信號的跳變邊沿: eventeventclkevent 對對clk標(biāo)識符的信號在標(biāo)識符的信號在時間內(nèi)發(fā)生事件的情況進行檢測時間內(nèi)發(fā)生事件的情況進行檢測若:若:clkclk的數(shù)據(jù)類型為的數(shù)據(jù)類型為std_logicstd_logic, 時間內(nèi)時間內(nèi)clkclk由由9 9種值中任意一值向另種值中任意一值向另 一值跳變,則表達式輸出一值跳變,則表達式輸出truetrue,否則輸出,否則輸出falsefalse。clkevent and clk = 1 邊沿測試語句邊沿測試語句5. 5. 不完整條件語句與時序電路不完整條件語句與時序電路【例【例5-11】比較器(組合電路

25、)】比較器(組合電路)entity comp_bad is port( a1 : in bit; b1 : in bit; q1 : out bit ); end ; architecture one of comp_bad is begin process (a1,b1) begin if a1 b1 then q1 = 1 ; elsif a1 b1 then q1 b1 then q1 = 1 ; else q1 = 0 ; -a1b1的情況,完整條件語句的情況,完整條件語句 end if; end process ; end 圖圖5-6 例例5-12的電路圖的電路圖5.2.3 實現(xiàn)時序

26、電路的實現(xiàn)時序電路的vhdl不同表達方式不同表達方式【例【例5-13】.process (clk) beginif clkevent and (clk=1) and (clklast_value=0) then q = d ; -確保確保clk的變化是一次上升沿的跳變的變化是一次上升沿的跳變 end if; end process ;【例【例5-14】.process (clk) beginif clk=1 and clklast_value=0 -同例同例5-13 then q = d ; end if; end process ;預(yù)定義信號屬性:預(yù)定義信號屬性:clk在在時刻前為時刻前為0

27、5.2.3 實現(xiàn)時序電路的實現(xiàn)時序電路的vhdl不同表達方式不同表達方式【例【例5-15】library ieee ;use ieee.std_logic_1164.all ;entity dff3 is port (clk : in std_logic ; d : in std_logic ; q : out std_logic ); end ; architecture bhv of dff3 is signal q1 : std_logic; begin process (clk) begin if rising_edge(clk) - clk的數(shù)據(jù)類型必須是的數(shù)據(jù)類型必須是std_lo

28、gic then q1 = d ; end if; q = q1 ; end process ; end ;上升沿測試函數(shù)上升沿測試函數(shù)5.2.3 實現(xiàn)時序電路的實現(xiàn)時序電路的vhdl不同表達方式不同表達方式【例5-16】 . process begin wait until clk = 1 ; -利用利用wait語句語句 q = d ; end process;【例5-17】. process (clk) begin if clk = 1 then q = d ; -利用進程的啟動特性產(chǎn)生對利用進程的啟動特性產(chǎn)生對clk的邊沿檢測的邊沿檢測 end if; end process ;【例5-

29、18】. process (clk,d) begin if clk = 1 -電平觸發(fā)型寄存器電平觸發(fā)型寄存器 then q = d ; end if; end process ;5.2.3 實現(xiàn)時序電路的實現(xiàn)時序電路的vhdl不同表達方式不同表達方式圖圖5-7 邊沿型觸發(fā)器時序波形邊沿型觸發(fā)器時序波形圖圖5-8 電平觸發(fā)型寄存器的時序波形電平觸發(fā)型寄存器的時序波形5.2.4 異步時序電路設(shè)計異步時序電路設(shè)計 【例例5-19】. architecture bhv of multi_dff is signal q1,q2 : std_logic; beginpro1: process (clk)

30、 begin if clkevent and clk=1 then q1 = not (q2 or a); end if; end process ;pro2:process (q1) begin if q1event and q1=1 then q2 = d; end if; qq = q2 ; end process ; 圖圖5-9 例例5-19綜合的電路綜合的電路pro1、pro2是標(biāo)注不參加綜合是標(biāo)注不參加綜合進程進程1的賦值信號為進程的賦值信號為進程2的敏感信號的敏感信號5.2.5 vhdl設(shè)計基本概念和語言現(xiàn)象小節(jié)設(shè)計基本概念和語言現(xiàn)象小節(jié)數(shù)據(jù)類型數(shù)據(jù)對象信號屬性時鐘檢測vhdl庫

31、程序包時序電路異步時序5.3 1位二進制全加器的位二進制全加器的vhdl設(shè)計設(shè)計圖圖5-10半加器半加器h_adder電路圖電路圖圖圖5-11 全加器全加器f_adder電路圖電路圖5.3.1 半加器描述和半加器描述和case語句語句absoco0000011010101101表表5-1 半加器半加器h_adder邏輯功能真值表邏輯功能真值表1. 1. casecase語句語句case語句的一般表式是:語句的一般表式是:case iswhen = ; . ; ;when = ; . ; ;.end case ;a、分支條件是互斥的b、完全覆蓋case 的取值,否則最后一行others不是操作符

32、,含義“于是”2. 2. 標(biāo)準(zhǔn)邏輯矢量數(shù)據(jù)類型標(biāo)準(zhǔn)邏輯矢量數(shù)據(jù)類型std_logic_vectorstd_logic_vector3. 3. 并置操作符并置操作符 以下是一些并置操作示例:以下是一些并置操作示例:signal a : std_logic_vector (3 downto 0) ;signal d : std_logic_vector (1 downto 0) ; .a = 1 0 d(1) 1 ; - 元素與元素并置,并置后的數(shù)組長度為元素與元素并置,并置后的數(shù)組長度為4 .if a d = 101011 then . - 在在if條件句中可以使用并置符條件句中可以使用并置符

33、5.3.1 半加器描述和半加器描述和case語句語句在使用std_logic_vector中,必須注明其數(shù)組寬度,即位寬,如: b : out std_logic_vector(7 downto 0) ; 或或 signal a :std_logic_vector(1 to 4)5.3.1 半加器描述和半加器描述和case語句語句【例5-20】 library ieee ;-或門邏輯描述 use ieee.std_logic_1164.all; entity or2a is port (a, b : in std_logic; c : out std_logic ); end entity o

34、r2a; architecture one of or2a is begin c = a or b ; end architecture one;【例5-21】library ieee; -半加器描述(1)use ieee.std_logic_1164.all; entity adder is port (a, b : in std_logic; co, so : out std_logic); end entity adder; architecture fh1 of adder is begin so = a xor b ; co = a and b ; end architecture

35、fh1; 【例5-22】library ieee; -半加器描述(2)use ieee.std_logic_1164.all; entity h_adder is port (a, b : in std_logic; co, so : out std_logic); end entity h_adder; architecture fh1 of h_adder is signal abc : std_logic_vector(1 downto 0) ;begin abc so=0; co so=1; co so=1; co so=0; co null ; end case; end proce

36、ss;end architecture fh1 ;【例5-23】 . -半加器描述(3) signal abc,cso : std_logic_vector(1 downto 0 ); begin abc = a & b ; co = cso(1) ; so cso cso cso csoain,b=bin,co=d,so=e); u2 : h_adder port map(a=e, b=cin, co=f,so=sum); u3 : or2a port map(a=d, b=f, c=cout); end architecture fd1;5.3.2 全加器描述和例化語句全加器描述和

37、例化語句 元件例化語句由兩部分組成,第一部分是對一個現(xiàn)成的設(shè)計實體定元件例化語句由兩部分組成,第一部分是對一個現(xiàn)成的設(shè)計實體定義為一個元件,語句的功能是對待調(diào)用的元件作出調(diào)用聲明,它的最義為一個元件,語句的功能是對待調(diào)用的元件作出調(diào)用聲明,它的最簡表達式如下所示:簡表達式如下所示: component 元件名元件名 is port (端口名表端口名表) ; end component 文件名文件名 ; 元件例化語句的第二部分則是此元件與當(dāng)前設(shè)計實體元件例化語句的第二部分則是此元件與當(dāng)前設(shè)計實體(頂層文件頂層文件)中中元件間及端口的連接說明。語句的表達式如下:元件間及端口的連接說明。語句的表達式

38、如下: 例化名例化名 : 元件名元件名 port map( 端口名端口名 = 連接端口名連接端口名,.);例:用例:用vhdl設(shè)計設(shè)計4位計數(shù)器位計數(shù)器取整數(shù)數(shù)據(jù)類型,為什么?算術(shù)操作符對應(yīng)的操作數(shù)無特殊說明為整數(shù)整數(shù)取值范圍端口信號模式取buffer,為什么?=兩邊都有q,表明q為i/obuffer:輸入功能是將自己的輸出返回注意整數(shù)和位的不同表達方式!修改后的程序運算符加載(重載函數(shù))注意,信號注意,信號端口模式和端口模式和數(shù)據(jù)類型的數(shù)據(jù)類型的改變!改變!注意,引注意,引進內(nèi)部信進內(nèi)部信號矢量!號矢量!4位鎖存器位鎖存器組合電路加組合電路加1器器鎖存信號鎖存信號輸出反饋輸出反饋用用vhdl

39、設(shè)計設(shè)計7段段16進制譯碼器進制譯碼器用用case語句完成真值表的功能語句完成真值表的功能向向7段數(shù)碼段數(shù)碼管輸出信號,管輸出信號,最高位控制最高位控制小數(shù)點小數(shù)點注意,此語句必須加入注意,此語句必須加入4位加法位加法計數(shù)器計數(shù)器7段譯碼器段譯碼器8位總線輸出位總線輸出信信號號輸輸出出例1library ieee;use ieee.std_logic_1164.all;entity mux4 isport (i0, i1, i2, i3, a, b : in std_logic; q : out std_logic);end mux4;architecture body_mux4 of mux

40、4 issignal muxval : integer;beginprocess(i0,i1,i2,i3,a,b)beginmuxval = 0;if (a = 1) then muxval = muxval + 1;end if;if (b = 1) then muxval q q q q null;end case;end process; end body_mux4;why ?library ieee;use ieee.std_logic_1164.all;entity mux4 isport (i0, i1, i2, i3, a, b : in std_logic; q : out s

41、td_logic);end mux4;architecture body_mux4 of mux4 isbeginprocess(i0,i1,i2,i3,a,b)variable muxval : integer range 0 to 3;beginmuxval := 0;if (a = 1) then muxval := muxval + 1;end if;if (b = 1) then muxval := muxval + 2;end if;case muxval is when 0 = q q q q null;end case;end process; end body_mux4;li

42、brary ieee; use ieee.std_logic_1164.all; entity h_adder is port (a,b : in std_logic; co, so : out std_logic); end entity h_adder; architecture fh1 of h_adder ibegin so = (a or b)and(a nand b); co a2,b=a3,s=s0,y=tmp); u2 : mux21a port map(a=a1,b=tmp,s=s1,y=outy); end architecture bhv ;實實 驗驗 實驗實驗5-1 簡單組合電路的設(shè)計簡單組合電路的設(shè)計 按照按照5.4節(jié)的步驟對上例分別進行編譯、綜合、仿真。并對其仿真波形節(jié)的步驟對上例分別進行編譯、綜合、仿真。并對其仿真波形(圖圖5-23)作出分析說明。作出分析說明。圖圖5-23 仿真波形仿真波形實實 驗驗 實驗實驗5-1 簡單組合電路的設(shè)計簡單組合電路的設(shè)計 (4) 實驗內(nèi)容實驗內(nèi)容3:引腳鎖定以及硬件下載測試。若目標(biāo)器件引腳鎖定以及硬件下載測試。若目標(biāo)器件是是epf10k10,建議選實驗電路模式建議選實驗電路模式5(附圖附圖1-7),用鍵,用鍵

溫馨提示

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

評論

0/150

提交評論