EDA技術複習大綱

2023-01-04 20:54:02 字數 4900 閱讀 3135

1. 題型:填空,判斷改錯,程式設計題程式設計題、問答題,共100分。

3. 複習計數器、分頻電路的設計、7段解碼器設計、數字時鐘、搶答器,數字秒錶的設計。

4. 程式設計題實體部分已經寫好。

全加器的vhdl程式設計:全加器的邏輯表示式為:

s = a⊕b⊕ci

co =(ab)+(aci)+(bci)

quartus ii中建立乙個eda工程的流程。

計數和分頻綜合題

entity dvf is

port ( clk : in std_logic;

d : in std_logic_vector(7 downto 0);

fout : out std_logic );

end;

architecture one of dvf is

signal full : std_logic;

begin

p_reg: process(clk)

variable cnt8 : std_logic_vector(7 downto 0);

begin

if clk'event and clk = '1' then

if cnt8 = "11111111" then

cnt8 := d;

full <= '1';

else cnt8 := cnt8 + 1;

full <= '0';

end if; end if;

end process p_reg ;

p_div: process(full)

variable cnt2 : std_logic;

begin

if full'event and full = '1' then

cnt2 := not cnt2;

if cnt2 = '1' then fout <= '1'; else fout <= '0';

end if; end if;

end process p_div ;

end;

(1)上述vhdl描述所實現的功能是——數控分頻器,d埠輸入不同的資料,可以得到不同的分頻輸出。

(2)已知clk時鐘頻率是10mhz,要使輸出訊號的頻率fout為50khz,該如何實現?根據分頻原理:,所以輸入埠d埠應該輸入資料為156,標準邏輯向量形式為:

「10011100」,即d埠應該輸入資料「10011100」,即可實現fout為50khz。

數字秒錶設計-用vhdl語句設計乙個數字秒錶,該秒錶計時從0~59秒(提示:60進製計數器)。

entity fen60 is

port (clk : in std_logic; --時鐘訊號為1hz

rst : in std_logic;

qout1 : out std_logic_vector(3 downto 0); --秒低位

qout2 : out std_logic_vector(3 downto 0); --秒高位

carry : out std_logic); --進製輸出,每計滿60秒時為1

end fen60;

architecture beh**e of fen60 is

signal tem1:std_logic_vector(3 downto 0);

signal tem2:std_logic_vector(3 downto 0);

begin

process(clk,rst)

begin

if(rst='0')then

tem1<="0000";

tem2<="0000";

elsif clk'event and clk='1' then

if tem1="1001" then

tem1<="0000";

if tem2="0101" then

tem2<="0000";

carry<='1';

else

tem2<=tem2+1;

carry<='0';

end if;

else

tem1<=tem1+1;

end if;

end if;

qout1<=tem1;

qout2<=tem2;

end process;

end beh**e;

計數解碼顯示電路設計——如圖1所示是乙個計數解碼顯示電路,圖中的cnt10是乙個十進位制加法計數器,decl7s是7段顯示解碼器。用vhdl語句將該電路描述出來。

圖1 計數解碼顯示電路原理圖

10進製計數器

entity cnt10 is

port (clk,rst,en : in std_logic;

cq : out std_logic_vector(3 downto 0);

cout : out std_logic );

end cnt10;

architecture beh** of cnt10 is

7段數碼管顯示

entity decl7s is

port ( a : in std_logic_vector(3 downto 0);

led7s:out std_logic_vector(6 downto 0) ) ;

end ;

architecture one of decl7s is

begin

process(clk, rst, en)

variable cqi: std_logic_vector(3 downto 0);

begin

if rst = '1' then cqi := (others =>'0') ;

elsif clk'event and clk='1' then

if en = '1' then

if cqi < 9 then cqi := cqi + 1;

else cqi := (others =>'0');

end if;

end if;

end if;

if cqi = 9 then cout <= '1';

else cout <= '0';

end if;

cq <= cqi;

end process;

end beh**;

begin

process( a )

begin

case a is

when "0000" => led7s <= "0111111" ;

when "0001" => led7s <= "0000110" ;

when "0010" => led7s <= "1011011" ;

when "0011" => led7s <= "1001111" ;

when "0100" => led7s <= "1100110" ;

when "0101" => led7s <= "1101101" ;

when "0110" => led7s <= "1111101" ;

when "0111" => led7s <= "0000111" ;

when "1000" => led7s <= "1111111" ;

when "1001" => led7s <= "1101111" ;

when others => null ;

end case ;

end process ;

end ;

以上兩個程式有效組合實現計數並在7段數碼管上顯示,即計數解碼顯示電路

entity cntled is

port (clk0, rst0, en0: in std_logic;

led: out std_logic_vector (6 downto 0);

cout0: out std_logic);

end cntled;

architecture beh** of cntled is

component cnt10

port (clk, rst, en: in std_logic;

cq: out std_logic_vector (3 downto 0);

cout: out std_logic);

end component;

component decl7s

port (a: in std_logic_vector (3 downto 0);

led7s: out std_logic_vector (6 downto 0) ) ;

end component;

signal temp: std_logic_vector (3 downto 0);

begin

u1: cnt10 port map (clk0, rst0, en0, temp, cout0);

u2: decl7s port map (temp, led);

end beh**;

分別用結構體的3種描述法設計乙個4位計數器。

答: 用行為描述方法設計乙個4位計數器如下,其它描述方法,讀者可自行設計。

library ieee;

useuseentity counta is

port (clk,clr,en:in std_logic;

qa,qb,qc,qd:out std_logic);

end counta;

architecture example of counta is

signal count_4:std_logic_vector (3 downto 0);

begin

qa <= count_4(0);

qb <= count_4(1);

qc <= count_4(2);

qd <= count_4(3);

EDA技術實驗指導書

福建農林大學計算機與資訊學院 電子資訊工程系 eda技術 課程組 目錄 第一章 gw48 eda實驗開發系統的概要說明 1.1 gw48教學實驗系統原理與使用介紹3 1.2 實驗電路結構圖說明6 1.3實驗電路結構圖8 1.4 gw48ck pk2 pk3 pk4 系統萬能接插口與結構圖訊號 與晶元...

EDA技術課程設計

河北科技大學 課程設計報告 姓名 學號 潘小霖 17 彭酉幹 18 喬穎晟 19 時金旭 20 宋文雪 21 專業班級 電信112班 課程名稱 eda技術課程設計 學年學期 2 013 2 014 學年第 2 學期 指導教師於國慶 2 0 14 年 6 月 課程設計成績評定表 基於fpga自動量程頻...

機械識圖與EDA技術模擬試卷

博州中等職業技術學校 專業姓名班級 一 填空 每空1分,共30分 1 完整的尺寸標註由尺寸線終端和組成。2 圖樣中,機件的可見輪廓線用畫出,不可見輪廓線用畫出。3 工程常用的投影法分為兩類和其中正投影法屬於 投影法。4 根據三面投影能判斷兩點位置的上下 前後 左右關係,其中從正面投影可判斷和關係 水...