《VHDL語(yǔ)言與EDA技術(shù)》課程試卷_第1頁(yè)
《VHDL語(yǔ)言與EDA技術(shù)》課程試卷_第2頁(yè)
《VHDL語(yǔ)言與EDA技術(shù)》課程試卷_第3頁(yè)
《VHDL語(yǔ)言與EDA技術(shù)》課程試卷_第4頁(yè)
全文預(yù)覽已結(jié)束

下載本文檔

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

文檔簡(jiǎn)介

1、VHD用言與ED世術(shù)課程試卷(1)一、分析下列代碼。 (共 30 分)1、 (9 分)1 entity counter is2 port( clk, rst: IN BIT;3 count: OUT integer range 0 to 7 );4 end counter;5 architecture counter of counter is6 begin7 process (clk, rst)8 variable temp: integer range 0 to 7;9 begin10 if (rst= 1 ) then11 temp:=0;12 elsif (clk event AND

2、clk= then 1 )13 temp:=temp+1;14 end if;15 count<=temp;16 end process;17 end counter;試分析,該代碼描述的是什么功能電路?2、 ( 6 分)1 library IEEE;2 use IEEE.STD_LOGIC_1164.ALL;3 use IEEE.STD_LOGIC_ARITH.ALL;4 use IEEE.STD_LOGIC_UNSIGNED.ALL;5 entity decoder_7seg is6 Port (seg:in std_logic_vector(3 downto 0 );7 q3:ou

3、t std_logic_vector(6 downto 0) );8 end decoder_7seg;9 architecture Behavioral of decoder_7seg is10 begin11 process(seg)12 begin13 case seg is14 when "0000" => q3<="0000001"-015 when "0001" => q3<="1001111"-116 when "0010" => q3<=&qu

4、ot;0010010"-217 when "0011" => q3<="0000110"-318 when "0100" => q3<="1001100"-419 when "0101" => q3<="0100100"-520 when "0110" => q3<="0100000"-621 when "0111" => q3<="00

5、01111"-722 when "1000" => q3<="0000000"-823 when "1001" => q3<="0000100"-924 when others => q3<="1111111"25 end case;26 end process;27 end Behavioral;試分析,該代碼描述的是什么功能電路?若不寫(xiě)第24行代碼,是否可以?說(shuō)明理由。3、(6 分)1 ENTITY exam2 IS2 PORT (a, b, c

6、, d: IN BIT;3 f: OUT BIT);4 END exam;5 ARCHITECTURE ex OF exam2 IS7 BEGIN8910f<=temp1 XOR temp2;temp1<=a AND b;temp2<=c OR d;11 END ex;6 SIGNAL temp1,temp2 : BIT;試分析,在該彳t碼中,第 8行"f<=temp1 XOR temp2;”寫(xiě)在第九行"temp1<=a AND b”和第十行“ temp2<=c OR d;”前面,這種書(shū)寫(xiě)順序?qū)δ艿膶?shí)現(xiàn)有沒(méi)有影響?該代碼中有一個(gè)錯(cuò)誤,在

7、第 行,此行語(yǔ)句應(yīng)改為 4、(9 分)1 library ieee;2 use ieee.std_logic_1164.all;3 entity decoder is4 port( ena: IN std_logic;5 sel: IN std_logic_vector(2 downto 0);6 x: OUT std_logic_vector(7 downto 0);7 end decoder;8 architecture generic_decoder of decoder is 9 begin10 process (ena, sel)11 variable temp1: std_logi

8、c_vector( x'high downto 0 );12 variable temp2: integer range 0 to x'high;13 begin14temp1:=(others=>'1');15temp2:=0;16if (ena='1') then17FOR i IN sel'range loop18if (sel(i尸'1') then19temp2:=2*temp2+1;20else21temp2:=2*temp2;22end if;23END loop;24temp1(temp2):=

9、9;0'25end if;26x<=temp1;27 end process;28 end generic_decoder;試分析,該代碼描述的是什么功能電路?第4句中的端口 ena是使能信號(hào)輸入端, 在此代碼描述的電路中,ena為0還是為1時(shí)電路能 有效完成期望功能?此代碼描述中,第11句和第12句中,x'high代表的值是多少?二、填空,補(bǔ)全下列代碼。(20分)1、下面代碼描述的是一個(gè) 三態(tài)門(mén)電路library ieee;use ieee.std_logic_1164.all;entity three_states isport( ena: IN std_logic;

10、input: IN std_logic_vector(7 downto 0);output: OUT std_logic_vector( );end three_states;architecture tri_state of three_states is beginoutput<= input when ena='0' else(OTHERS=>'');end tri_state;1、下面代碼描述的是一個(gè)三進(jìn)制計(jì)數(shù)器LIBRARY IEEE;USE IEEE.STD_LOGIC_1164.ALL;USE IEEE.STD_LOGIC_UNSIGN

11、ED.ALL;ENTITY count3 ISPORT(enable:IN STD_LOGIC;clk:IN STD_LOGIC;q:OUT (1 DOWNTO 0);END count3;ARCHITECTURE rtl OF count3 ISSIGNAL : STD_LOGIC_VECTOR(1 DOWNTO 0);BEGINprocess( )beginIF(clk'event and clk='')thenif(enable='1')thenif(q_tmp="10")thenq_tmp <= ( );elseq_tmp <= q_tmp+1;end if;end if;q <= q_tmp;e

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝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ù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 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)論