VHDL合肥工業(yè)大學(xué)期末試題(含答案)2007-2008A_第1頁(yè)
VHDL合肥工業(yè)大學(xué)期末試題(含答案)2007-2008A_第2頁(yè)
VHDL合肥工業(yè)大學(xué)期末試題(含答案)2007-2008A_第3頁(yè)
VHDL合肥工業(yè)大學(xué)期末試題(含答案)2007-2008A_第4頁(yè)
VHDL合肥工業(yè)大學(xué)期末試題(含答案)2007-2008A_第5頁(yè)
已閱讀5頁(yè),還剩4頁(yè)未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

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

文檔簡(jiǎn)介

1、2007/2008 學(xué)年第 一 學(xué)期末考試試題答案及評(píng)分標(biāo)準(zhǔn)(a卷)得分一、 填空題(20分,每空格1分)1、vhdl是否區(qū)分大小寫? 不區(qū)分 。2、digital_ _8標(biāo)識(shí)符合法嗎? 不合法 。12_bit標(biāo)識(shí)符合法嗎? 不合法 。signal標(biāo)識(shí)符合法嗎? 不合法 。 3、結(jié)構(gòu)體有三種描述方式,分別是 數(shù)據(jù)流 、 行為 、和 結(jié)構(gòu)化 。4、請(qǐng)分別列舉一個(gè)常用的庫(kù)和程序包 library ieee 、 use ieee.std_logic_1164.all 。5、一個(gè)信號(hào)處于高阻(三態(tài))時(shí)的值在vhdl中描述為 z 。6、將一個(gè)信號(hào)width定義為一個(gè)4位標(biāo)準(zhǔn)邏輯向量為 signal wi

2、dth : std_logic_vector(3 downto 0) 。7、/=是 不相等 操作符,功能是 在條件判斷是判斷操作符兩端不相等 。8、設(shè)d0為'0', d1為'1', d2為'1', d3為'0', d3 & d2 & d1 & d0的運(yùn)算結(jié)果是 “0110” ,(d3 or d2)and(d1 and not d0)的運(yùn)算結(jié)果是: 1 。9、賦值語(yǔ)句是(并行/串行) 并行 執(zhí)行的,if語(yǔ)句是(并行/串行) 串行 執(zhí)行的。10、請(qǐng)列舉三種可編程邏輯器件: eeprom 、 gal 、 fpga

3、 。得分二、 簡(jiǎn)答(20分,每小題5分)1、簡(jiǎn)述vhdl程序的基本結(jié)構(gòu)。庫(kù)(1)程序包(2)實(shí)體(3)結(jié)構(gòu)體(5) 若答出配置也可加1分2、簡(jiǎn)述信號(hào)與變量的區(qū)別。信號(hào)延時(shí)賦值,變量立即賦值(2)信號(hào)的代入使用<=,變量的代入使用:=;(4)信號(hào)在實(shí)際的硬件當(dāng)中有對(duì)應(yīng)的連線,變量沒有(5)3、簡(jiǎn)述可編程邏輯器件的優(yōu)點(diǎn)。l 集成度高,可以替代多至幾千塊通用ic芯片 極大減小電路的面積,降低功耗,提高可靠性 (1)l 具有完善先進(jìn)的開發(fā)工具 提供語(yǔ)言、圖形等設(shè)計(jì)方法,十分靈活 通過仿真工具來驗(yàn)證設(shè)計(jì)的正確性(2)l 可以反復(fù)地擦除、編程,方便設(shè)計(jì)的修改和升級(jí)(3)l 靈活地定義管腳功能,減輕設(shè)

4、計(jì)工作量,縮短系統(tǒng)開發(fā)時(shí)間(4)l 保密性好(5)4、試比較moore狀態(tài)機(jī)與mealy狀態(tài)機(jī)的異同。moore輸出只是狀態(tài)機(jī)當(dāng)前狀態(tài)的函數(shù)(3)mealy輸出為有限狀態(tài)機(jī)當(dāng)前值和輸入值的函數(shù)(5)得分三、判斷題(10分)library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_arith.all;use ieee.std_logic_unsigned.all;以上庫(kù)和程序包語(yǔ)句有無錯(cuò)誤? 有 ,有的話請(qǐng)?jiān)谠绦蛳鄳?yīng)位置改正。(2)entity rom is port(addr: in std_logic_vector(0 to 3

5、);ce:in std_logic;data:out std_logic_vector(7 downto 0);)end rom;以上port語(yǔ)句有無錯(cuò)誤? 有 ,有的話請(qǐng)?jiān)谠绦蛳鄳?yīng)位置改正。(4)architecture behave of rom isbeginprocess(ce,addr)(6)begin if ce='0' then2case addr iswhen "0000"=>data<="10001001"when "0001"=>data<="10001010&q

6、uot;when "0010"=>data<="10001011"when "0011"=>data<="10001100"when "0100"=>data<="10001101"when "0101"=>data<="10001110"when "0110"=>data<="10001111"when "0111"

7、=>data<="10010000"when "1000"=>data<="10010001"when "1001"=>data<="10010010"when "1010"=>data<="10010011"when "1011"=>data<="10010100"when "1100"=>data<="10010

8、101"when "1101"=>data<="10010110"when "1110"=>data<="10010111"when others=>data<="10011000"end case; elsedata:="00000000" -data <= “00000000”;(8)end if;(10)end process;end behave;以上architecture中有哪些錯(cuò)誤?請(qǐng)?jiān)谠绦蛳鄳?yīng)位置改正。得分

9、四、 編程(共50分,除特殊聲明,實(shí)體可只寫出port語(yǔ)句,結(jié)構(gòu)體要寫完整)1、用if語(yǔ)句編寫一個(gè)二選一電路,要求輸入a、b, sel為選擇端,輸出q。(本題10分)entity sel2 isport (a,b : in std_logic;sel : in std_logic;q : out std_logic);end sel2;(3)architecture a of sel2 isbeginif sel = 0 thenq <= a;(6)elseq <= b;(9)end if;end a;(10)2、編寫一個(gè)4位加法計(jì)數(shù)器vhdl程序的進(jìn)程(不必寫整個(gè)結(jié)構(gòu)框架),要求

10、復(fù)位信號(hào)reset低電平時(shí)計(jì)數(shù)器清零,變高后,在上升沿開始工作;輸入時(shí)鐘信號(hào)為clk,輸出為q。(本題10分)process(reset,clk)(2)beginif reset = 0 thenq <= “0000”;(4)elsif clkevent and clk = 1 then(6)q <= q + 1;(9)end if;end process;(10)3、填寫完成一個(gè)8-3線編碼器的真值表(5分),并寫出其vhdl程序(10分)。8 -3線編碼器真值表enby0y1y210000000000010000001000110000010001010000100001110

11、00100001001001000001011010000001101100000001110xxxxxxxx高阻態(tài)entity eight_tri is port(b:in std_logic_vector(7 downto 0);en:in std_logic;y:outstd_logic_vector(2 downto 0);end eight_tri;(3)architecture a of eight_tri is signal sel: std_logic_vector(8 downto 0);(4)beginsel<=en & b;y<= “000” when

12、 (sel=”100000001”)else“001” when (sel=”100000010”)else“010” when (sel=”100000100”)else“011” when (sel=”100001000”)else“100” when (sel=”100010000”)else“101” when (sel=”100100000”)else“110” when (sel=”101000000”)else“111” when (sel=”110000000”)else(9)“zzz”;(10)end a;4、根據(jù)已給出的全加器的vhdl程序,試寫出一個(gè)4位逐位進(jìn)位全加器的v

13、hdl程序。(本題15分)library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_arith.all;use ieee.std_logic_unsigned.all;entity adder isport (a,b,c:in std_logic;carr: inout std_logic;sum: out std_logic);end adder;architecture adder_arch of adder isbeginsum <= a xor b xor c;carr <= (a and b) or (b an

14、d c) or (a and c);end adder_arch;entity full_add isport (a,b: instd_logic_vector (3 downto 0);carr: inout std_logic_vector (4 downto 0);sum: outstd_logic_vector (3 downto 0);end full_add;(5)architecture full_add_arch of full_add iscomponent adderport (a,b,c:instd_logic;carr: inoutstd_logic;sum: out

15、std_logic);end component;(10)begincarr(0)<='0'u0:adder port map(a(0),b(0),carr(0),carr(1),sum(0);u1:adder port map(a(1),b(1),carr(1),carr(2),sum(1);u2:adder port map(a(2),b(2),carr(2),carr(3),sum(2);u3:adder port map(a(3),b(3),carr(3),carr(4),sum(3);end full_add_arch;(15)得分五、附加題(10分,本題可產(chǎn)生

16、附加分,全卷不能超過100分) 完成下面moore狀態(tài)機(jī)程序,該設(shè)計(jì)為一個(gè)存儲(chǔ)控制器狀態(tài)機(jī)。能夠根據(jù)微處理器的讀寫周期,分別對(duì)存儲(chǔ)器輸出寫使能we和讀使能oe信號(hào)。工作過程:存儲(chǔ)控制器的輸入信號(hào)為微處理器的就緒ready及讀寫read_write信號(hào)。當(dāng)上電復(fù)位后,或read有效時(shí),存儲(chǔ)控制器開始工作,并在下一個(gè)時(shí)鐘周期判斷本次作業(yè)任務(wù)是讀存儲(chǔ)器還是寫存儲(chǔ)器。判斷的依據(jù)是,當(dāng)read_write有效時(shí)為讀操作,否則為寫操作。也就是說非讀即寫。讀操作時(shí),oe信號(hào)有效,寫操作時(shí),we信號(hào)有效。當(dāng)ready信號(hào)有效時(shí),表示讀本次作業(yè)處理完成,并使控制器恢復(fù)到初始狀態(tài)??刂破髡嬷当砗蜖顟B(tài)圖如下。存儲(chǔ)控

17、制器真值表狀態(tài)輸出oewe空閑(idle)00判斷(decision)00寫(write)01讀(read)10存儲(chǔ)器控制器狀態(tài)圖library ieee;use ieee.std_logic_1164.all;entity moore isport(clk,ready,read_write : in std_logic; oe,we : out std_logic);end moore;architecture state_machine of moore istype state_type is ( idle , decision , write , read );signal prese

18、nt_state,next_state: state_type;begin state_comb: process(present_state,ready,read_write) begin case present_state is when idle => oe<= 0 ; we<= 0 ; if(ready='1') then next_state<=decision; else next_state<=idle; end if; when decision => oe<= 0 ; we<= 0 ; if(read_write='1') then next_state<=read; else next_state<= write ; end if; when read => oe<= 1 ; we<= 0 ; if(ready='1') then next_state<=idle; else next_state<=read; end if; when write

溫馨提示

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

最新文檔

評(píng)論

0/150

提交評(píng)論