【正文】
End disp_arc。 End case。 When”1001”=q=”1101111”。 When”0111”=q=”0100111”。 When”0101”=q=”1101101”。 When”0011”=q=”1001111”。 When”0001”=q=”0000110”。 End disp。 Entity disp is Port(d:in std_logic_vector(3 downto 0)。 7.模塊 DISP Library ieee。 end process。 h=hh。 end if。 hh:=1001。 else sound=39。 else ll:=ll1。 elsif ll=0 then ll:=1001。 then if ll=0 and hh=0 then sound=39。 then if en=39。event and clk=39。 architecture count_arc of count is begin process(clk,en) variable hh,ll:std_logic_vector(3 downto 0)。 sound:out std_logic)。 entity count is port(clk,en:in std_logic。 use 。 End ch31_arc。 End case。 When “111”=q=d3。 Architecture ch31_arc of ch31a is Begin Process(sel,d1,d2,d3) Begin Case sel is When “000”=q=d1。 Q:out std_logic_vector(3 downto 0))。 Entity ch31a is Port(sel:in std_logic_vector(2 downto 0)。 5.模塊 CH31A Library ieee。 end process。 when others =q=1111。 when 1101=q=0011。 case tmp is when 0111=q=0001。d3amp。 begin tmp:=d1amp。 end ch41a。 entity ch41a is Port(d1,d2,d3,d4:in std_logic。 3. 模塊 CH41A Library ieee。 end process。 alm=’1’。 q3=d3。 elsif clk’event and clk=’1’ then q1=d1。 q4=’0’。 q2=’0’。 end lockb。 Clk,clr:in std_logic。 Use 。 end sel_arc。 a=aa。 begin if clk’event and clk=’1’then aa:=aa+1。 end sel。 Entity sel is Port(clk:in std_logic。 2.模塊 SEL Library ieee。 end process。 elsif cp’event and cp=’0’ then q=’1’。 end lxl。 Entity lxl is Port(cp,clr:in std_logic。 參考文獻 [l] 王振紅 《 VHDL 數(shù)字電路設計與應用實踐教程 》 第二版 機械工業(yè)出版社 [2] 邢建平 曾繁泰 《 VHDL 程序 設計教程 》 清華大學 出版社 [3] 黃任 《 VHDL 入門》 北京航空航天大學出版社 附錄: ……… 四路搶答計時器源程序 1.模塊 LXL Library ieee。 VHDL 程序設計語言是硬件的標準描述語言。到此為止程序上已經基本成型了,接著就是將程序分模塊進行逐步調試,這 7各模塊都存在著或多或少的錯誤,有些是自己做的時候打錯了字母,有些是很難理解的結構錯誤,在認真照參考書核對以及在老師的幫助下,這些錯誤都別改正過來,每個模塊所生成的波形圖也都被保存下來,在本次報告的第二部分體現(xiàn)了出來。隨后,根據這次課程設計的原理,由于此程序是需要數(shù)碼管驅動的,所以 必須在程序的最后加上模塊 DIS