EDA技術試題答案_第1頁
EDA技術試題答案_第2頁
EDA技術試題答案_第3頁
EDA技術試題答案_第4頁
EDA技術試題答案_第5頁
已閱讀5頁,還剩3頁未讀, 繼續(xù)免費閱讀

下載本文檔

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

文檔簡介

1、電子科技大學二零零四至二零零五學年第一學期(A)一、 填空題:(20分,每小題2分)1) 用VHDL語言進行設計過程中一般要進行仿真以判斷設計是否正確,在綜合前進行的仿真稱為 功能仿真 ,綜合后進行的仿真稱為 時序仿真 。2) CPLD和FPGA內部結構差別很大,一般CPLD是一種以 乘積項 方式構成邏輯行為的器件,而一般FPGA則是以 查找表 方式構成邏輯行為的器件。3) Altera公司的FLEX 10K系列器件的內部結構主要包括: 邏輯陣列塊(LAB) 、 嵌入式陣列塊() 、 I/O單元 和 快速通道互連 。4) VHDL語言中端口buffer和inout的主要區(qū)別是 buffer不能

2、接收外部的輸入信號,inout可實現雙向數據傳送 。5) 數字頻率計功能是測量被測信號的頻率,測量頻率的基本原理是: 1秒時間內 代測信號的脈沖個數 。6) 在VHDL語法規(guī)則中變量只能在 進程 和 子程序 中使用。7) EDA軟件中的綜合器的基本功能是: 將描述針對給定的硬件結構進行編譯、優(yōu)化、轉換和綜合最終獲得門級電路或更底層的電路描述文件 。8) 一般常用的VHDL描述風格有三種,它們分別是: 行為描述 、 寄存器級描述(或數據流描述) 和 結構描述 。9) 元件例化語句中的端口映射方式有_位置關聯(lián)_、_名字關聯(lián)_。10) CPLD的全稱是 Complex Programmable Lo

3、gic Devices(或復雜可編程邏輯器件) 、FPGA的全稱是 Field Programmable Gate Array(或現場可編程門陣列) 。二、 單項選擇題(14分,每小題2分)1) Altera公司的FLEX 10K系列器件采用的編程元件是 D 。A、 熔絲型開關 B、 EPROM的編程元件 C、 EEPROM的編程元件 D、基于SRAM的編程元件2) 若a=1,b=2,下面程序執(zhí)行后,a和b的值分別為 B 。architecture rtl of entityName issignal a, b: integer;beginprocess (a, b) variable c:

4、integer;begina <=b ;c := a ;b <= c ;end process;end rtl ;A、1,2 B、 2,1 C、 1,1 D、 2, 2 3) 若S1為”1010”, S2為”0101”,下面程序執(zhí)行后,outValue輸出結果為: A 。library ieee;use ieee.std_logic_1164.all;entity ex2_3 is port(S1: in std_logic_vector(3 downto 0); S2: in std_logic_vector(0 to 3); outValue: out std_logic_ve

5、ctor(3 downto 0);End ex2_3;architecture rtl of ex2_3 isbegin outValue(3 downto 0) <= (S1(2 downto 0) and not S2(1 to 3) & (S1(3) xor S2(0) ;end rtl;A、 “0101” B、 “0100” C、“0001” D、“0000” 4) 下面哪個說法是錯誤的: B 。A、 進程語句與進程語句之間是并行執(zhí)行的,進程語句內部是順序執(zhí)行的B、進程語句是可以嵌套使用的C、塊語句與塊語句之間是并行執(zhí)行的,塊語句內部也是并行執(zhí)行的D、塊語句是可以嵌套使用

6、的5) 在使用MAX+PLUSII開發(fā)環(huán)境對電路進行系統(tǒng)設計時,若將程序下載到器件EP10K10LC84-4,則需要下載的文件后綴名為 C 。A、*.gdf B、*.pof C、*.sof D、*.scf6) 若A為“1010”,則下面的程序執(zhí)行后Y和Z的輸出值分別為 B 。 Library ieee; Use ieee.std_logic.1164.all; Entity p_check is Port(a: in std_logic_vector(3 downto 0); Y, Z: out std_logic); End p_check; Architecture arch of p_c

7、heck is Signal tmp1: std_logic ; begin P1: Process(a) Variable tmp2: std_logic ; begin tmp2 := 0; For N in 0 to 3 loop tmp2 := tmp2 xor a(N) ; End loop; Y<=tmp2 ; End P1; P2: process(a) begin tmp1 <= 0; For N in 0 to 3 loop tmp1 <= tmp1 xor a(N) ; End loop; Z<=tmp1 ; End P2; End arch ; A

8、、 0、0 B、 0、1 C、 1 、0 D、 1、1 7) 根據VHDL語法規(guī)則,下面哪個標識符是非法的標識符: B 。 A、 not_Ack B、 constant C、 FFT_1024_1 D、state0三、 改正下列程序中的錯誤,并簡要說明每個錯誤的原因(20分,每小題4分) library ieee; (修改正確2分,錯誤原因2分) use ieee.std_logic_1164.all ; entity ex1 isport (inp: in std_logic_vector (2 downto 0); outp: out std_logic_vector (3 downto

9、0); end ex1 ; architecture rtl of ex1 is begin process(inp) begin case (inp) is when “00” =>outp<=“0001” ;when “01” =>outp<= “0010” ; case語句是順序語句,需要放在進程或子程序中when “10” =>outp<=“0100” ;when others =>outp<=“1000” ; end case; end process;end rtl ;1) library ieee; use ieee.std_log

10、ic_1164.all ; entity ex2 isport (clk: in std_logic;Cnt: buffer std_logic_vector(3 downto 0); End ex2; Architecture arch of ex2 is Begin Process(clk) BeginWait until clkevent and clk = 1 ; 去掉process后的clk,wait語句中進程后不 Cnt <= Cnt + 1 ; 能有敏感信號 End process; End arch ;2) library ieee; use ieee.std_logic

11、_1164.all; entity ex3 isport ( A,B,C: in std_logic; sel: in std_logic_vector(1 downto 0); Z: out std_logic); End ex3; Architecture arch of ex3 is Begin Process(A,B,C) BeginZ <= A when sel = “00” else 并行條件賦值語句不能放在進程中,去掉 B when sel = “01” else 進程 C; End process; End arch;3) library ieee; use ieee.s

12、td_logic_1164.all; use ieee.std_logic_unsigned.all; entity test is port(clk: in std_logic;count: out std_logic_vector(3 downto 0);end test;architecture rtl of test is count端口類型應為buffer 或inoutbegin process(clk) begin if clkevent and clk=1 then count<=count+1; end if;end process;end rtl; 4) library

13、 ieee; use ieee.std_logic_1164.all; entity ex5 isport(Din: in std_logic_vector(7 downto 0); en: in std_logic; Dout: out std_logic_vector(7 downto 0); End ex5; Architecture arch of ex5 is Begin Process Begin If (En = 1) then 需加敏感信號列表 Dout <= Din ; process(en, Din) Else Dout <= “ZZZZZZZZ” ; End

14、if ; End process; End arch ; 四、補充語句,完成下面所要求的描述。(20分,每小題5分)1) 四選一選擇器:輸入輸出信號如右圖所示,A和B為選擇信號,inp3.0為4個信號輸入端,輸出信號為Y。library ieee;use ieee.std_logic_1164.all ;entity MUX41 isport( A, B : in std_logic ; inp: in std_logic_vector(3 downto 0); 1分Y: out std_logic);End MUX41 ;Architecture art of MUX41 isSignal

15、sel : std_logic_vector(1 downto 0);Begin Sel <= A & B ; 1分 process (inp , sel ) begin if (sel = “00” ) then Y<= inp(0) ; 1分 elsif (sel =”01”) then Y <= inp(1); 1分 elsif (sel = “10”) then Y<= inp(2); 1分 Else Y <= inp(3) ; End if ;End process ;End art ;2) 帶異步清零的8位計數器,輸入輸出如右圖所示,aclr為

16、異步清零信號, Clk為時鐘,Counter7.0為計數器輸出信號。 Library ieee; Use ieee.std_logic_1164.all; Use ieee.std_logic_unsigned.all; 1分 entity Count8 isport(aclr, reset: in std_logic; Clk: in std_logic; Counter: out std_logic_vector(7 downto 0); End Count8 ; Architecture arch of Count8 is Signal cntTmp: std_logic_vector(

17、7 downto 0); 1分 begin process(aclr, Clk) begin if (aclr = 0) cmtTmp <= “00000000”; 1分 elsif (clkevent and clk = 1) then CntTmp <= cntTmp + 1 ; 1分 End if ;End if ; End process ; Counter <= cntTmp; 1分 End arch; 3) 移位寄存器,如右圖所示,Clk為移位寄存器時鐘,Data為輸入數據,Dir為移位方向,為0左移一位,為1右移一位,Qout7.0為8位移位寄存器的數據輸出。L

18、ibrary ieee;Use ieee.std_logic_1164.all;Entity shift is Port (Clk: in std_logic; Data: in std_logic ; Dir: in std_logic ; Qout: buffer std_logic_vector(7 downto 0);End shift ;Architecture arch of shift isBeginProcessBegin Wait until Clkevent and Clk = 1 ; 1分 Case (Dir) is 1分 When 0 => Qout <=

19、Qout(6 downto 0) & Data ; 1分 When 1=> Qout <= Data & Qout(6 downto 0); 1分 When others => Qout <= “00000000” ;-只要有others即對 1分 End case ;End process;End arch ;4) 七段LED譯碼顯示電路,只須顯示09,Din3.0為輸入,Dout6.0為輸出。數碼管為共陰極,數碼管對應關系如下圖所示,a對應譯碼顯示輸出的低位,g對應高位,其它按順序對應。Library ieee;Use ieee.std_logic_

20、1164.all;Entity decoder is Port(Din: in std_logic_vector(3 downto 0); Dout: out std_logic_vector(6 downto 0);End decoder ;Architecture arch of decoder isBeginDout <= “0111111” when Din = “0000” else “0000110” when Din = “0001” else 1分 “1011011” when Din = “0010” else “1001111” when Din = “0011” e

21、lse 1分 “1100110” when Din = “0100” else “1101101” when Din = “0101” else 1分 “11111101” when Din = “0110” else “0000111” when Din = “0111” else 1分 “1111111” when Din = “1000” else “1101111” when Din = “1001” else 1分 “0000000” ; End arch ;五、用VHDL設計電路:(26分) 1. 用VHDL(必須使用元件例化方式)描述如下的方框圖,十進制計數器也要編寫。(14分)

22、 -十進制計數器library ieee;use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; 2分entity CNT10 isport(Clk: in std_logic; En: in std_logic; Carry: out std_logic ; CntOut: out std_logic_vector(3 downto 0);End CNT10; 1分Architecture arch of CNT10 isSignal CntOutTmp: std_logic_vector(3 downto 0);Begin

23、Process(clk)Begin If (Clkevent and Clk = 1 ) then If (En = 1) then If (CntOutTmp = “1001”) then CntOutTmp <= “0000” ; Carry <= 1 ; else CntOutTmp <= CntOutTmp+ 1 ; Carry <= 0 ; End if ;End if ; End if ;End process ;CntOut <= CntOutTmp ;End arch ; 3分-主程序library ieee;use ieee.std_logic_

24、1164.all; 1分entity top is port (Clk, en: in std_logic; carry : out std_logic; Dout: out std_logic_vector(7 downto 0);End top; 1分Architecture arch of top isComponent CNT10 Port(clk: in std_logic; En : in std_logic; Carry : out std_logic; CntOut : out sdd_logic_vector(3 downto 0);End Component ; 2分Signal carryTmp: std_logic;BeginU1: CNT10 port map(Clk, En, carryTmp, Dout(3 downto 0); 2分U2:CNT10 port map(carryTmp, En, carry, Dout(7 downto 4); 2分End arch ; 2. 用VHDL設計一個模為90,具有異步復位、同步置數功能的8421BCD碼計數器。輸入輸 出接口如圖所示,nReset為異步復位信號,Load為用于同步置數的控制信號,Clk為時鐘信號,LoadData7.0為計數器初始計數數據,Carr

溫馨提示

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

評論

0/150

提交評論