EDA技術(shù)復(fù)習(xí)doc_第1頁
EDA技術(shù)復(fù)習(xí)doc_第2頁
EDA技術(shù)復(fù)習(xí)doc_第3頁
EDA技術(shù)復(fù)習(xí)doc_第4頁
EDA技術(shù)復(fù)習(xí)doc_第5頁
已閱讀5頁,還剩19頁未讀, 繼續(xù)免費閱讀

下載本文檔

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

文檔簡介

1、考試題型:1選擇題10分2填空題15分3 程序閱讀25分(程序改錯、分析波形、程序填空各一題)4 編寫程序50分(四道大題)(組合邏輯電路、時序電路、狀態(tài)機、結(jié)構(gòu)化設(shè)計)語法知識-選擇、填空、程序改錯、程序填空40%vhdl語言程序的基本結(jié)構(gòu) 、命名規(guī)則及數(shù)據(jù)對象、基本數(shù)據(jù)類型、vhdl的運算操作符并發(fā)描述語句、順序描述語句一、 填空:2-1、vhdl語言的客體有信號、變量、常量 。2-3、常用的端口定義模式有 in 、 out 、buffer、inout四種。2-4、vhdl設(shè)計的最基本模塊是:設(shè)計實體。2-1、vhdl的數(shù)據(jù)對象包括:信號,變量,常量,文件四類。2-9、用vhdl設(shè)計某系統(tǒng)

2、時,用到一種可枚舉類型的數(shù)據(jù),它的可能取值為:red,yellow,blue,orange,green。用color來表示這種數(shù)據(jù)類型,試寫出這種數(shù)據(jù)類型的定義:type color is ( red, yellow, blue, orange, green);2-10 eda-電子設(shè)計自動化(electronic design automation)2-11 cpld-復(fù)雜可編程邏輯器件(complex progammable logic device)2-12 fpga-現(xiàn)場可編程門陣列(field programmable gata array) 3-1、完整vhdl語言程序包含實體、構(gòu)

3、造體、 配置 、包集合、 庫 五部分。3-2、vhdl語言設(shè)計的基本單元是設(shè)計實體;其由 實體說明和構(gòu)造體說明兩部分組成。3-5、vhdl語言構(gòu)造體的子結(jié)構(gòu)描述有 block語句結(jié)構(gòu) 、process語句結(jié)構(gòu)、子程序結(jié)構(gòu)三種。3-8、vhdl允許用三種描述方式來設(shè)計,即行為描述、結(jié)構(gòu)描述和數(shù)據(jù)流描述,或者是這些方式的任意組合。其中,肯定能夠綜合的是結(jié)構(gòu)描述和數(shù)據(jù)流描述,可能能夠綜合的是行為描述。3-27、一個完整的vhdl語言程序通常包含實體、構(gòu)造體、配置、包集合和庫5個部分。它們的作用分別為:實體用于描述 所設(shè)計的系統(tǒng)的外部接口信號 ;構(gòu)造體用于描述 系統(tǒng)內(nèi)部的結(jié)構(gòu)和行為功能 ;包集合存放格

4、設(shè)計模塊都能共享的 數(shù)據(jù)類型,常數(shù)和子程序 等;配置用于 從庫中選取所需要單元來組成系統(tǒng)設(shè)計的不同版本 ;庫存放已經(jīng)編譯的 實體,構(gòu)造體,包集合和配置 ;3-12、在用vhdl語言進行設(shè)計時,一個基本設(shè)計單元,不管是簡單的數(shù)字電路還是復(fù)雜的數(shù)字電路,其基本構(gòu)成是一致的。它們都是由 實體說明 和 構(gòu)造體 兩部分構(gòu)成。3-7、在用vhdl語言進行設(shè)計時,共有五種庫,即: ieee 庫 和 std 庫 、 面向 asic 庫 、 work庫 、 用戶自定義庫 。其中 , std 庫中 standard 包是總可見的,用戶編譯好的文件是放在 work 庫中。4-1、process語句有三個敏感信號,他

5、們順序改變一次,則process語句執(zhí)行 3 次。4-1、時鐘上升沿的描述方式有 clk'event and clk=1 、clk'event and last_value=0 and clk=1 。4-2、vhdl描述語句按執(zhí)行順序可分為順序描述語句 、 并發(fā)描述語句;他們的關(guān)系是順序描述語句只能包含于并發(fā)描述語句中,反之不能 。4-3、在loop語句有兩種形式,它們是 for-loop 和 while-loop 。4-5、變量可以在 進程 、 過程 和 函數(shù) 中定義。4-7、循環(huán)控制語句有next和 exit 兩條語句;在loop語句中若想跳出本次循環(huán)應(yīng)使用 next 語句

6、;若想結(jié)束整個循環(huán)體應(yīng)使用 exit 語句。二、 判斷題:1、判斷對錯,在正確的描述前畫勾,錯誤的畫叉2-(1)一個八位總線可以用標(biāo)準(zhǔn)類型byte表示。 (×)2-(2)連接系統(tǒng)與外界的信號叫做端口。()2-(3)總線定義中位的順序明確的指定了總線寬度。()2-(5)在一個矢量中,位的順序是不重要的。 (×)2-(6)內(nèi)部信號的定義包括信號名、模式和類型。 (×)2-(7)信號可被定義為信息的載體。()2-(9)總線和矢量是同一概念的不同名稱。()2-(10)矢量中左邊的位的序號一定比右邊的小。(×)2-(11)每個端口都必須指定其模式。()2-(12)

7、元件例化語句中的端口映射方式必須按照端口定義順序。(×)2-(25) “”“”運算符只能用于整型數(shù)的運算。(×)2-(66)、判斷下面的說法是否正確: (a) vhdl語言中字母在任何情況下都不區(qū)分大小寫。(×)(b) 信號具有延遲、事件等特性,而變量沒有。()(c) 信號在進程中作為局部數(shù)據(jù)存儲單元。(×)2- (65)信號代入語句只能用于process語句。 (×)2-(33)變量、信號、常量稱之為vhdl語言的三個客體(對象)。()2-(34)信號和常數(shù)只能在構(gòu)造體的定義語句區(qū)定義。(×)2-(40)端口說明中的端口方向out、

8、buffer和inout都可以被寫。(×)2-(42)數(shù)據(jù)類型bit、bit_vector是對std_logic、std_logic_vector的補充。(×)2-(43)一個構(gòu)造體中多條并發(fā)描述語句的通信由構(gòu)造體內(nèi)定義的變量來完成。(×)2-(49)如果一條語句中包含多個優(yōu)先級相同的運算符,vhdl語言遵循從左往由的運算規(guī)則。(×)2-(50)如果在一個表達式中由多個相同的邏輯運算符組成,只有and 、or、xor運算符不用加括號,否則結(jié)果不唯一。(×)2-(54)并置運算可以用集合體的方法實現(xiàn),它適用于所有情況 (×)2-55、2

9、#1111_1110#比8#292#要小 (×)2-56、8位二進制“10011001”數(shù)位字符串可表示為16“99”。 (×)2-2、判斷下面每組表達式結(jié)果是否一致或與所給描述是否一致: (1) a<=b and c and d;a<=(b and c) and d;a<=b and (c and d);(一致) (2) a<=not b or c or d;a<=c or (not b) or d;(一致) (3) a<= b nand c nand d;a<=(c nand b) nand d;(不一致) (4)a是c與b 或

10、然后和d與的結(jié)果;a<=c or b and d;(不一致) (5) a<=b or c or d;a<=(b or c) or d;a<=b or (c or d); (一致) (6) a<=not b and c and d;a<=c and (not b) and d;(一致) (7) a<=notbandcora; a<=(notbandc)ora; a<=notband(cora) (不一致) 2-3、判斷下面的并置運算是否正確:signal a:std_logic;signal b:std_logic;signal c:std_

11、logic_vector(0 to 2);signal d:std_logic_vector(0 to 4);c<=a & b & b;()d<=a & b & c & c;(×)d<=(a, a, c);(×)4、判斷下面的并置運算是否正確:signal a:std_logic;signal b:std_logic;signal c:std_logic;signal d:std_logic_vector(0 to 4);c<=a & b & b;(×)d<=a & b

12、& c & c& c;()d<=(a,b, c,c);()5、判斷下面的并置運算是否正確:signal a:std_logic;signal b:std_logic;signal c:std_logic_vector(0 to 2);signal d:std_logic_vector(0 to 4);c<=(a,b,b);()d<=a & b & c & c;(×)d<=(a, a, c);(×)2-5、下面哪些是正確的用戶定義的標(biāo)識符?對于每個無效的標(biāo)識符,說明其錯誤的理由。(1)2nd_item錯誤

13、,不應(yīng)以數(shù)字開頭(2)case :錯誤,不應(yīng)與保留字相同(3)small_device:正確(4)_name_ :錯誤,不應(yīng)以下劃線開頭(5)my-name:錯誤,不應(yīng)包括連詞號“-”3-(8)在實體中聲明的端口信號,在這個實體的所有結(jié)構(gòu)體中都可見。()3-(12)一個系統(tǒng)的所有信號都必須在實體中聲明。(×)3-(13)結(jié)構(gòu)描述可以是層次化的。 ()3-(14)如果包集合與實體在同一目錄下,包集合中定義的對象就可以在實體中使用。 (×)3-(15)vhdl僅有的兩種設(shè)計單元是實體和結(jié)構(gòu)體。 (×)3-(16)一個實體可以有多個結(jié)構(gòu)體。 ()3-(17)為了使用標(biāo)準(zhǔn)

14、standard包集合,在實體前必須有l(wèi)ibrary和use語句。 (×)3-(18)vhdl中的每個系統(tǒng)都是實體和結(jié)構(gòu)體的集合體。 ()3-(19) vhdl的系統(tǒng)中實體最具重要性。 ()3-(20)結(jié)構(gòu)體是針對實體定義的,一個結(jié)構(gòu)體可以針對多個實體。 (×)3-(26)進程在仿真運行中總是處于下述兩種狀態(tài)之一:執(zhí)行或掛起。()3- (30)如果一個信號在被實體使用的包集合中定義,那么在實體的構(gòu)造體中使用這個信號也必須包含使用包集合的use語句。(×)3- (37)設(shè)計者描述的vhdl程序編譯后都會自動存放到work庫中。()3-(38)vhdl語言一個設(shè)計實體

15、的最基本的組成就是實體說明和構(gòu)造體說明。 ()3-(39)實體說明部分僅可以完成該設(shè)計實體的端口說明。(×)3-(41)構(gòu)造體的描述方法有三種:行為級描述、rtl級描述、結(jié)構(gòu)描述;他們都能夠?qū)崿F(xiàn)邏輯綜合。(×)3-(46) process語句是一個無限循環(huán)語句。(×)3-(51)在一個process語句中,信號賦值與變量賦值除運算符外,沒有區(qū)別。(×)3-(52)原理圖輸入設(shè)計方法一般是一種自底向上的設(shè)計方法。()3- (53)實體提供一個系統(tǒng)的名稱并僅僅指定其與外的連。 (×)3-(55)行為描述明確的指出系統(tǒng)綜合時需要的模塊。 (×

16、;)3-(56)每個實體必須至少有一個端口。 ()3- (58)綜合是純軟件的轉(zhuǎn)換過程,與硬件結(jié)構(gòu)無關(guān)。 (×)3- (63)完整的vhdl語言包含五部分:實體說明、構(gòu)造體說明、庫、包集合和配置。 ()4-(22)loop語句中的next語句執(zhí)行時,將結(jié)束循環(huán)狀態(tài),從loop語句中跳出。(×)4-(27)順序語句只能出現(xiàn)在進程或子程序中,由它定義進程或子程序所執(zhí)行的算法。()4-(44)一條并發(fā)描述語句中可以包含多條順序描述語句,反之不能。()4-(45)沒有優(yōu)先級的多條件控制可以分別用case語句、if語句、條件信號帶入語句或選擇信號代入語句,他們的使用沒有區(qū)別。(

17、15;)4-(47)forloop語句與whileloop語句可以直接互換。(×)4-(48)有兩條控制循環(huán)的語句next和exit,其中exit用于跳出本次循環(huán)控制,next用于跳出整個循環(huán)體控制。(×)程序題實驗考試試題相關(guān)內(nèi)容組合邏輯電路、時序電路、狀態(tài)機、結(jié)構(gòu)化設(shè)計1、數(shù)據(jù)選擇器、編碼器、譯碼器、表決器2、數(shù)碼管顯示3、計數(shù)器、分頻器、序列信號發(fā)生檢測器4、例化語句-結(jié)構(gòu)化設(shè)計5.狀態(tài)機圖-vhdl程序程序分析題:1、閱讀下面的vhdl程序代碼回答問題。library ieee:use ieeestd _logic_ 1164.all:use ieeestd_log

18、ic _unsigned.a11:entity seq_gen isport(cik,reset:in std_logic: y0:out std_logic):end seq_gen;architecture rtl of seq_gen is signal cnt:std_logic_vector(2 downto 0);beginprocess(clk,reset) begin if reset=1 then cnt <=”000”; elsif clk'event and clk=1 thenif cnt=”111” then cnt<=”000”;elsecnt&

19、lt;=cnt +1; end if;end if;end process;with cnt selecty0<= 1 when ”000”, 1 when ”001”, 1 when ”010”, 0 when ”011”, 1 when ”100”, 0 when ”101”, 1 when ”110”, 0 when others; end rtl;根據(jù)輸入波形畫出cnt和y0的仿真波形: 該程序完成的是“11101010”脈沖序列發(fā)生器的功能。2、閱讀下面的vhdl程序代碼回答問題。library ieee;use ieee.std_logic_1164.all;use ieee

20、.std_logic_unsigned.all;entity div isport(clk,reset:in std_logic; y0:out std_logic ); end div;architecture div_8 of div issignal cnt:std_logic_vector(2 downto 0);begin process(clk)begin if reset='1' then cnt<="000"elsif (clk'event and clk='1') thenif cnt="111&qu

21、ot;thencnt<="000"else cnt<=cnt+'1' end if;end if;end process;y0<=cnt(2);end div_8;解答:根據(jù)輸入波形畫出cnt和y0的仿真波形;(假設(shè)cnt初始值為“000”,y0初始態(tài)為0) 該程序完成的是8分頻分頻器的功能。3、設(shè)計仿真波形。設(shè)計一個8個彩燈循環(huán)點亮控制器,要求每次只點亮一個彩燈。library ieee:use ieeestd _logic_ 1164.all:use ieeestd_logic _unsigned.a11:entity seq_gen

22、isport(cik,reset:in std_logic: y0:out std_logic_vector(0 to 7):end seq_gen;architecture rtl of seq_gen is signal cnt:std_logic_vector(2 downto 0);beginprocess(clk,reset) begin if reset=1 then cnt <=”000”; elsif clk'event and clk=1 thenif cnt=”111” then cnt<=”000”;elsecnt<=cnt +1; end if

23、;end if;end process;with cnt selecty0<=”00000001” when ”000”, “00000010” when ”001”, “00000100” when ”010”, “00001000” when ”011”, “00010000” when ”100”, “00100000” when ”101”, “01000000” when ”110”, “10000000” when others; end rtl;進程一:process( c, d ) 此進程結(jié)束后: begin a = 3 a <= 2;b = 2 b <= a

24、 + c;e = 2 a <= d + 1;c = 1 e <= a * 2; d = 2 end process;進程二:process( c, d ) variable av, bv, ev: integer:=0;begin av := 2; 此進程結(jié)束后: bv := av + c; a = 3 av := d + 1; b = 3 ev := av * 2;e = 6 a<= av;c = 1 b <= bv;d = 2 e <= ev; end process;4、假設(shè)信號a,b, c, d, e的初始值為1,如果信號d的值變?yōu)?,那么下面的進程結(jié)束后

25、,信號a, b, e 的值各為多少?5、如下是一個4-2編碼器的vhdl描述,其真值表如圖所示。試用case語句代替其中的選擇信號代入語句完成該功能描述。library ieee; use ieee.std_logic_1164.all; entity encoder isprocess(a)begincase a iswhen "0001"=>y<=”00”; when "0010"=>y<=”01”; when "0100"=>y<=”10”; when "1000"=>

26、;y<=”11”;when others=>y<=”zz”;end case;end process; port(a:in std_logic_vector(3 downto 0); y: out std_logic_vector(1 downto 0); end encider; architecture aa of encoder is begin with a select y<= “00” when "0001", “01” when "0010", “10” when "0100", “11” whe

27、n "1000", “zz” when others;end aa;編程題:1、數(shù)據(jù)選擇器、編碼器、譯碼器、表決器2、數(shù)碼管顯示3、計數(shù)器、分頻器、序列信號發(fā)生檢測器1、設(shè)計一個地址譯碼器。cpu送出32位的地址信號,write及read控制信號。對cpu而言,有一個內(nèi)存映射圖如下圖。由于以上器件都要使用同一組數(shù)據(jù)總線,因此要用片選信號來控制器件是否要被訪問,試以最少的信號產(chǎn)生ce0 ce3,以分別控制四組器件。占用地址使用器件片選信號讀寫方向00000000h 01000000heepromce0雙向10000000h 11000000hsramce1雙向20000000

28、hinput portce2輸入30000000houtput portce3輸出entity address_decoder isport (address: in bit_vector(31 downto 0);read: in bit;write: in bit;ce0, ce1, ce2, ce3: out bit);end address_decoder;architecture rtl of address_decoder isbegince0 <= '0' when address(29 downto 28) = "00" else &#

29、39;1'ce1 <= '0' when address(29 downto 28) = "01" else '1'ce2 <= '0' when address(29 downto 28) = "10" and read = '0' else '1'ce3 <= '0' when address(29 downto 28) = "11" and write = '0' else '1

30、9;end rtl;2、用loop循環(huán)語句設(shè)計一個9人表決器。library ieee; use ieee.std_logic_1164.all;use ieee.std_logic_arith.all;entity sel isport(input:in std_logic_vector(8 downto 0);y:out integer range(0 to 9); end sel;architecture a of sel is begin process(input)variable num:integer;begin num:=0;for i inputrange loopif in

31、put(i)=1 then num:=num+1;end if;end loop; y<=num;end process;end a; 3、設(shè)計一個優(yōu)先編碼器,其真值表如圖所示。其中a的優(yōu)先權(quán)最高,d的優(yōu)先權(quán)最低。編碼結(jié)果由發(fā)光二極管輸出,并由一位共陰極七段數(shù)碼管顯示相應(yīng)的輸入通道號(顯示a 、b 、c 、d)。abcds1s21000x100xx10xxx100110101 4、實驗考核題:12、實驗考核題:14、實驗考核題:195、設(shè)計一個具有異步復(fù)位、同步預(yù)置功能,并帶有計數(shù)使能的十進制可逆計數(shù)器。library ieee;use ieee.std_logic_1164.all;u

32、se ieee.std_logic_unsigned.all;entity counter is port ( clk,reset,ce,load: in std_logic; -時鐘、復(fù)位、使能、裝入dir: in std_logic; -加減計數(shù)控制din: in std_logic_vector (3 downto 0); -預(yù)置數(shù)輸入count: out std_logic_vector (3 downto 0) );-輸出end counter;architecture rtl of counter issignal count_int: std_logic_vector(3 dow

33、nto 0); -內(nèi)部信號process (clk, reset) begin if reset = '1' then -異步復(fù)位count_int <= (others => '0'); elsif clk'event and clk='1' then if load = '1' then -同步裝載count_int <= din;elseif ce = '1' then -計數(shù)使能if dir = '1' then -加法計數(shù)if count_int = "

34、1001" then -十進制count_int <= "0000"elsecount_int <= count_int + 1; end if;else -減法計數(shù)if count_int = "0000" thencount_int <= "1001" -十進制elsecount_int <= count_int - 1; end if;end if; end if;end if; end if; count <= count_int; end process;end rtl;6、實驗考核題

35、:1、2、3、47、用計數(shù)器實現(xiàn)一個分頻器,脈寬可調(diào)。實驗考核題:5、6、7 4、例化語句-結(jié)構(gòu)化設(shè)計5.狀態(tài)機圖-vhdl程序8、用結(jié)構(gòu)描述的方法實現(xiàn)如下結(jié)構(gòu)的計數(shù)功能; 其中模塊u1、u2、u3為十進制計數(shù)器, u4為六進制計數(shù)器。要求設(shè)計出通用計數(shù)器作為被調(diào)用的模塊。en為使能端;clk為時鐘輸入;clr為復(fù)位輸入;q為計數(shù)輸出;co進位位輸出。通用計數(shù)器library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity counter isgeneric( count_value: intege

36、r:=9);port(clk,clr,en: instd_logic;co: outstd_logic;count: out integer range 0 to count_value);end counter;architecture a of counter issignalcnt: integer range 0 to count_value;beginprocess (clk)beginif clr = '1' thencnt <= 0;elsif (clk'event and clk = '1') thenif en = '1&

37、#39; thenif cnt = count_value thencnt <= 0;elsecnt <= cnt + 1;end if;end if;end if;end process;count <= cnt;co<= '1' when cnt = count_value else '0'end a;-數(shù)字鐘library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;use ieee.std_logic_arith.all;entity timer

38、 isport(clk,clr,en: in std_logic;sec_10:out integer range 0 to 5; sec: out integer range 0 to 9;secl_10: out integer range 0 to 9;secl_100: out integer range 0 to 9);end timer;architecture rtl of timer issignal secl_10_en, sec_en, sec_10_en: std_logic;component counter isgeneric( count_value: intege

39、r);port(clk,clr,en: instd_logic;co: outstd_logic;count: out integer range 0 to count_value);end component;beginsecl_100: countergeneric map( count_value => 9)port map(clk,clr,en, secl_10_en, secl_100);secl_10: countergeneric map( count_value =>9)port map(clk,clr,secl_10,sec_en, secl_10);sec: c

40、ountergeneric map( count_value => 9)port map(clk,clr,sec_en,sec_10_en,sec);cnt10m: countergeneric map( count_value => 5)port map(clk<=clk,clr<=clr,en<=sec_10,count=>sec_10);end rtl;9、用結(jié)構(gòu)描述的方法實現(xiàn)多功能數(shù)字鐘的計時功能;計時采用12小時制,計時分為小時、分、秒。帶有清零端,且只對秒計時清零。-數(shù)字鐘調(diào)用標(biāo)準(zhǔn)計數(shù)器library ieee;use ieee.std_logi

41、c_1164.all;use ieee.std_logic_unsigned.all;entity counter isgeneric( count_value: integer:=9);port(clk,clr,en: instd_logic;co: outstd_logic;count: out integer range 0 to count_value);end counter;architecture a of counter issignalcnt: integer range 0 to count_value;beginprocess (clk)beginif clr = 

42、9;1' thencnt <= 0;elsif (clk'event and clk = '1') thenif en = '1' thenif cnt = count_value thencnt <= 0;elsecnt <= cnt + 1;end if;end if;end if;end process;count <= cnt;co<= '1' when cnt = count_value else '0'end a;-數(shù)字鐘library ieee;use ieee.std_

43、logic_1164.all;use ieee.std_logic_unsigned.all;entity timer isport(clk1s,reset: in std_logic;c_mh, sh:out integer range 0 to 5;sl: out integer range 0 to 9;c_ml: out integer range 0 to 9;c_h: out integer range 0 to 11);end timer;architecture rtl of timer issignal c_h_en, c_mh_en, c_ml_en, c_sh_en :

44、std_logic;signal c_h_en1, c_ml_en1 : std_logic;signal c_mh_en1 : std_logic;signal enable,disable: std_logic;component counter isgeneric( count_value: integer);port(clk,clr,en: instd_logic;co: outstd_logic;count: out integer range 0 to count_value);end component;beginenable<='1'disable<

45、='0'cnt1s: countergeneric map( count_value => 9)port map(clk=>clk1s,clr=>reset,en=>enable,co=>c_sh_en,count=>sl);cnt10s: countergeneric map( count_value => 5)port map(clk=>clk1s,clr=>reset,en=>c_sh_en,co=>c_ml_en1,count=>sh);cnt1m: countergeneric map( coun

46、t_value => 9)port map(clk=>clk1s,clr=>disable,en=>c_ml_en,co=>c_mh_en1,count=>c_ml);cnt10m: countergeneric map( count_value => 5)port map(clk=>clk1s,clr=>disable,en=>c_mh_en,co=>c_h_en1,count=>c_mh);cnt_h: countergeneric map( count_value => 11)port map(clk=>

47、clk1s,clr=>disable,en=>c_h_en,count=>c_h);c_ml_en <=c_ml_en1 and c_sh_en;c_mh_en <= c_mh_en1 and c_ml_en;c_h_en <= c_h_en1 and c_mh_en;end rtl;注:元件例化語句可用兩個六十進制計數(shù)器和一個十二進制計數(shù)器enclkresetcoqenclkresetcoqenclkresetcoqenclkresetcoq&&1/100s1/10ssminenclkreset10、 設(shè)計一通用計數(shù)器,并用此通用計數(shù)器采用

48、結(jié)構(gòu)描述的方法實現(xiàn)1/100 s計時器的計時功能;最長計時為59.99秒。時鐘頻率為100 hz。系統(tǒng)組成如下圖。library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity counter isgeneric( count_value: integer:=9);port(clk,clr,en: instd_logic;co: outstd_logic;count: out integer range 0 to count_value);end counter;architecture a of

49、counter issignalcnt: integer range 0 to count_value;beginprocess (clk)beginif clr = '1' thencnt <= 0;elsif (clk'event and clk = '1') thenif en = '1' thenif cnt = count_value thencnt <= 0;co<= '1';elsecnt <= cnt + 1;co<= '1';end if;end if;end

50、 if;end process;count <= cnt;end a;-1/100s計時器library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;use ieee.std_logic_arith.all;entity timer isport(clk,reset,en: in std_logic;min:out integer range 0 to 59; sec: out integer range 0 to 59;secl_10: out integer range 0 to 9;secl_10

51、0: out integer range 0 to 9);end timer;architecture rtl of timer issignal sec_10_en, sec_10_co,sec_en,sec_co,min_en: std_logic;component counter isgeneric( count_value: integer);port(clk,clr,en: instd_logic;co: outstd_logic;count: out integer range 0 to count_value);end component;beginsec_en<=sec

52、_10_en and sec_10_co;min_en<=sec_en and sec_co;secl_100: countergeneric map( count_value => 9)port map(clk,reset,en, sec_10_en, secl_100);secl_10: countergeneric map( count_value =>9)port map(clk,reset,sec_10_en,sec_10_co, secl_10);sec: countergeneric map( count_value => 59)port map(clk,

53、reset,sec_en,sec_10_co,sec);min: countergeneric map( count_value => 59)port map(clk<=clk,clr<=reset,en<=min_en,count=>min);end rtl;11、下圖是某控制器的狀態(tài)轉(zhuǎn)移圖,寫出它的描述。00輸入:in1, in2 輸出:z10library ieee;s1/0s0/0use ieee.std_logic_1164.all;entity controler is port ( clk, reset, in1, in2: in std_logic;

溫馨提示

  • 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)容負責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論