【正文】
整點報時模塊該模塊能夠完成整點時的報時功能。該模塊在十二點三十分的時候,蜂鳴器發(fā)出音樂聲,持續(xù)一分鐘。use 。use 。iclk,clk:in std_logic。speaker:out std_logic)。architecture behave of baoshi issignal clk05s:std_logic。signal a,b,s:std_logic。 signal tone_count : std_logic_vector(10 downto 0)。 signal clk10_count : std_logic_vector(17 downto 0)。 signal clkm : std_logic。beginprocess(iclk)variable count1:integer range 1 to 20000:=1。if count1=13333 thenclk1k=39。elsif count1=20000 thenclk1k=39。count1:=1。end if。process(clk)variable count:integer range 1 to 250:=1。if count=166 thenclk05s=39。elsif count=250 thenclk05s=39。count:=1。end if。 PROCESS(iclk) generate 2Mhz clock signal variable t1 : INTEGER RANGE 0 TO 9。139。event THEN IF t1=9 THEN t1:=0。139。039。 t1:=t1+1。 END IF。 process(clkm) generate 10hz clock signal begin if(clkm39。139。 if(clk10_count=163fff) then clk10=not clk10。 end if。 process(clk10) begin if(clk1039。139。 else time=time+1。 end if。 process(clk10) begin if(clk1039。139。 when 1=tone_index=3。 when 3=tone_index=3。 when 5=tone_index=5。 when 7=tone_index=6。 when 9=tone_index=8。 when 11=tone_index=9。 when 13=tone_index=8。 when 15=tone_index=5。 when 17=tone_index=12。 when 19=tone_index=15。 when 21=tone_index=12。 when 23=tone_index=12。 when 25=tone_index=9。 when 27=tone_index=9。 when 29=tone_index=9。 when 31=tone_index=0。 when 33=tone_index=9。 when 35=tone_index=10。 when 37=tone_index=7。 when 39=tone_index=6。 when 41=tone_index=5。 when 43=tone_index=6。 when 45=tone_index=8。 when 47=tone_index=9。 when 49=tone_index=3。 when 51=tone_index=8。 when 53=tone_index=5。 when 55=tone_index=8。 when 57=tone_index=5。 when 59=tone_index=5。 when 61=tone_index=5。 when 63=tone_index=0。 when 65=tone_index=10。 when 67=tone_index=12。 when 69=tone_index=7。 when 71=tone_index=9。 when 73=tone_index=8。 when 75=tone_index=5。 when 77=tone_index=5。 when 79=tone_index=5。 when 81=tone_index=0。 when 83=tone_index=3。 when 85=tone_index=3。 when 87=tone_index=5。 when 89=tone_index=7。 when 91=tone_index=6。 when 93=tone_index=6。 when 95=tone_index=6。 when 97=tone_index=5。 when 99=tone_index=8。 when 101=tone_index=8。 when 103=tone_index=12。 when 105=tone_index=12。 when 107=tone_index=9。 when 109=tone_index=10。 when 111=tone_index=8。 when 113=tone_index=6。 when 115=tone_index=3。 when 117=tone_index=3。 when 119=tone_index=8。 when 121=tone_index=8。 when 123=tone_index=6。 when 125=tone_index=6。 when 127=tone_index=3。 when 129=tone_index=6。 when 131=tone_index=5。 when 133=tone_index=5。 when 135=tone_index=5。 when 137=tone_index=5。 when 139=tone_index=0。 end case。 end process。 no output when 1=tone=01100000101。 912 when 3=tone=10000001100。 1197 when 6=tone=10100001010。 1372 when 8=tone=10110000010。 1480 when 10=tone=11000000110。 1622 when 13=tone=11010000100。 1728 when others=tone=11111111111。end process。beginsig1k=d。if rising_edge(clk05s) then if t=119 then t:=0。 end if。039。139。if mh=0000 and ml=0000 and (t=119 or t=0 or t=1)then d=39。 else d=39。end if。end process。event and clkm=39。) then if(tone_count=167ff) then tone_count=tone。 end if。 end if。 else s=39。 end if。a=clk1k and not(d)。speaker=a or b or s。5 實驗結(jié)論與研究展望 實驗結(jié)論將設(shè)計程序下載到硬件電路上運行調(diào)試后,最終結(jié)果與預(yù)期效果基本一致,時、分能夠正常計數(shù)并能由控制鍵分別顯示,整點報時功能正常。學(xué)會了利用QuarterII軟件進行原理圖的繪制,硬件描述語言VHDL的編寫,程序的仿真等工作。在設(shè)計電路中,往往是先仿真后連接實物圖,但有時候仿真和電路連接并不是完全一致的,例如在對具體模塊的仿真的過程中,往往沒有考慮到整體設(shè)計的層面以及與上下模塊接口的設(shè)計。此次的數(shù)字鐘設(shè)計重在于按鍵的控制和各個模塊代碼的編寫,雖然能把鍵盤接口和各個模塊的代碼編寫出來,并能正常顯示,但對于各個模塊的優(yōu)化設(shè)計還有一定的缺陷和不足。在本設(shè)計調(diào)試過程中遇到了一些問題如下:1.23.4. 研究展望本設(shè)計中雖然有控制鍵對時鐘進行控制,但是用到的按鍵太多,在實際應(yīng)用上存在不足。這樣可以節(jié)省按鍵資源,以供更多的功能的使用。設(shè)計的過程變的相對簡單,容易修改等優(yōu)點,相信隨著電子技術(shù)的發(fā)展,數(shù)字鐘的功能會更加多樣化,滿足人們的各種需要。吳小所老師認真負責(zé)的工作態(tài)度,嚴謹?shù)闹螌W(xué)精神和深厚的理論水平都使我受益匪淺。在理論上,老師耐心講解電路原理圖的繪制,以及元器件的性能;在實際操作中,從系統(tǒng)的設(shè)計到最終系統(tǒng)的調(diào)試,老師都給予了諸多幫助,使我得到不少的提高,這是在這次設(shè)計中我所得到的最寶貴的財富。在這次畢業(yè)設(shè)計中,我的專業(yè)知識水平也取得一定的進步。在此我向曾經(jīng)幫助和關(guān)心我的老師和同學(xué)致以誠摯的感