【正文】
when 79=tone_index=5。 when 80=tone_index=5。 when 81=tone_index=0。 when 82=tone_index=0。 when 83=tone_index=3。 when 84=tone_index=5。 when 85=tone_index=3。 when 86=tone_index=5。 when 87=tone_index=5。 when 88=tone_index=6。 when 89=tone_index=7。 when 90=tone_index=9。 when 91=tone_index=6。 when 92=tone_index=6。 when 93=tone_index=6。 when 94=tone_index=6。 when 95=tone_index=6。 when 96=tone_index=6。 when 97=tone_index=5。 when 98=tone_index=6。 when 99=tone_index=8。 when 100=tone_index=8。 when 101=tone_index=8。 when 102=tone_index=9。 when 103=tone_index=12。 when 104=tone_index=12。 when 105=tone_index=12。 when 106=tone_index=10。 when 107=tone_index=9。 when 108=tone_index=9。 when 109=tone_index=10。 when 110=tone_index=9。 when 111=tone_index=8。 when 112=tone_index=8。 when 113=tone_index=6。 when 114=tone_index=5。 when 115=tone_index=3。 when 116=tone_index=3。 when 117=tone_index=3。 when 118=tone_index=3。 when 119=tone_index=8。 when 120=tone_index=8。 when 121=tone_index=8。 when 122=tone_index=8。 when 123=tone_index=6。 when 124=tone_index=8。 when 125=tone_index=6。 when 126=tone_index=5。 when 127=tone_index=3。 when 128=tone_index=5。 when 129=tone_index=6。 when 130=tone_index=8。 when 131=tone_index=5。 when 132=tone_index=5。 when 133=tone_index=5。 when 134=tone_index=5。 when 135=tone_index=5。 when 136=tone_index=5。 when 137=tone_index=5。 when 138=tone_index=0。 when 139=tone_index=0。 when others=tone_index=0。 end case。 end if。 end process。 process(tone_index) begin case tone_index is when 0=tone=11111111111。 no output when 1=tone=01100000101。 773 when 2=tone=01110010000。 912 when 3=tone=10000001100。 1036 when 5=tone=10010101101。 1197 when 6=tone=10100001010。 1290 when 7=tone=10101011100。 1372 when 8=tone=10110000010。 1410 when 9=tone=10111001000。 1480 when 10=tone=11000000110。 1542 when 12=tone=11001010110。 1622 when 13=tone=11010000100。 1668 when 15=tone=11011000000。 1728 when others=tone=11111111111。 others:no output end case。end process。process(clk05s)variable t:integer range 0 to 120:=0。beginsig1k=d。sig500=c。if rising_edge(clk05s) then if t=119 then t:=0。 else t:=t+1。 end if。if mh=0101 and ml=1001 and(t=117 or t=115 or t=113 or t=111) then c=39。039。 else c=39。139。end if。if mh=0000 and ml=0000 and (t=119 or t=0 or t=1)then d=39。039。 else d=39。139。end if。end if。end process。 process(clkm) control the frequence of the speaker begin if hh=0001 and hl=0010 and mh=0011 and ml=0000 then if(clkm39。event and clkm=39。139。) then if(tone_count=167ff) then tone_count=tone。 if(tone2047) then s=not s。 end if。 else tone_count=tone_count+1。 end if。 end if。 else s=39。039。 end if。 end process。a=clk1k and not(d)。b=clk05s and not(c)。speaker=a or b or s。end behave。5 實驗結(jié)論與研究展望 實驗結(jié)論將設(shè)計程序下載到硬件電路上運行調(diào)試后,最終結(jié)果與預(yù)期效果基本一致,時、分能夠正常計數(shù)并能由控制鍵分別顯示,整點報時功能正常。在此次的數(shù)字鐘設(shè)計過程中,更進一步地熟悉有關(guān)數(shù)字電路的知識和具體應(yīng)用。學(xué)會了利用QuarterII軟件進行原理圖的繪制,硬件描述語言VHDL的編寫,程序的仿真等工作。并能根據(jù)仿真結(jié)果分析設(shè)計的存在的問題和缺陷,從而進行程序的調(diào)試和完善。在設(shè)計電路中,往往是先仿真后連接實物圖,但有時候仿真和電路連接并不是完全一致的,例如在對具體模塊的仿真的過程中,往往沒有考慮到整體設(shè)計的層面以及與上下模塊接口的設(shè)計。再加上器件對信號的延時等問題,實際下載硬件電路上后會出現(xiàn)一系列的問題,因此仿真圖和電路連接圖還是有一定區(qū)別的。此次的數(shù)字鐘設(shè)計重在于按鍵的控制和各個模塊代碼的編寫,雖然能把鍵盤接口和各個模塊的代碼編寫出來,并能正常顯示,但對于各個模塊的優(yōu)化設(shè)計還有一定的缺陷和不足。總的來說,通過這次的設(shè)計實驗更進一步地增強了實驗的動手能力,對數(shù)字鐘的工作原理也有了更加透徹的理解。在本設(shè)計調(diào)試過程中遇到了一些問題如下:1.23.4. 研究展望本設(shè)計中雖然有控制鍵對時鐘進行控制,但是用到的按鍵太多,在實際應(yīng)用上存在不足。故提出改進方案為用一個按鍵控制數(shù)碼管的片選,再用兩個按鍵控制計數(shù)的加減。這樣可以節(jié)省按鍵資源,以供更多的功能的使用。本設(shè)計是采用硬件描述語言和FPGA芯片相結(jié)合進行的數(shù)字鐘的研究,從中可以看出EDA技術(shù)的發(fā)展在一定程度上實現(xiàn)了硬件設(shè)計的軟件化。設(shè)計的過程變的相對簡單,容易修改等優(yōu)點,相信隨著電子技術(shù)的發(fā)展,數(shù)字鐘的功能會更加多樣化,滿足人們的各種需要。 致謝在論文完成之際,我首先要向指導(dǎo)老師吳小所老師表示最真摯的謝意。吳小所老師認真負責(zé)的工作態(tài)度,嚴謹?shù)闹螌W(xué)精神和深厚的理論水平都使我受益匪淺。無論在理論上還是在實踐中,都給與我很大的幫助。在理論上,老師耐心講解電路原理圖的繪制,以及元器件的性能;在實際操作中,從系統(tǒng)的設(shè)計到最終系統(tǒng)的調(diào)試,老師都給予了諸多幫助,使我得到不少的提高,這是在這次設(shè)計中我所得到的最寶貴的財富。對于我以后的工作和學(xué)習(xí)都是一種巨大的幫助,感謝他耐心的輔導(dǎo)。在這次畢業(yè)設(shè)計中,我的專業(yè)知識水平也取得一定的進步。而這些進步都離不開老師和同學(xué)的幫助。在此我向曾經(jīng)幫助和關(guān)心我的老師和同學(xué)致以誠摯的感謝。由于本人學(xué)識有限,加之時間倉促,文中不免有錯誤和待改進之處,真誠歡迎各位師長、同學(xué)提出寶貴意見。