【正文】
校時 /分輸入信號 —— 4Hz。 library ieee。 use 。 use 。 use 。 entity sel2 is port(sel:in std_logic。 ip: in std_logic。 a,b:out std_logic)。 end sel2。 architecture beh of sel2 is begin process(sel) begin if(sel=39。039。)then a=ip。 else b=ip。 end if。 end process。 end beh。 : 整點報時及鬧時: 模塊圖如圖 在 59 分 52 秒、 54秒、 56 秒、 58 秒給揚聲器賦以低音 512Hz信號 ,在 00 分 00 秒給揚聲器賦以高音 1024Hz 信號 ,當(dāng)系統(tǒng)時間與鬧鈴時間相同時給揚聲器賦以高音 1024Hz 信號。鬧時時間為一分鐘。 8 library ieee。 use 。 use 。 entity zdbs is port(mh,ml,sh,sl:in std_logic_vector(3 downto 0)。 sig500,sig1k: out std_logic )。 end zdbs。 architecture behavior of zdbs is begin sig500=39。139。 when mh=0101and ml=1001and sh=0101 and( sl=0000or sl=0010 or sl=0100or sl=0110or sl=1000) else 39。039。 sig1k=39。139。 when mh=0000and ml=0000and sh=0000and sl=0000 else 39。039。 end behavior。 : 鬧鐘時間的設(shè)定: 模塊圖 如圖 。 由開關(guān) K1選擇鬧鐘和時間 。由 S S2脈沖鍵調(diào)節(jié)時、分。 library ieee。 use 。 9 use 。 use 。 entity alarmset is port(sel:in std_logic。 hclo,mclo,sclo,halr,malr,salr: in std_logic_vector(7 downto 0)。 h,s,m:out std_logic_vector(7 downto 0))。 end alarmset。 architecture beh of alarmset is begin process(sel) begin if(sel=39。039。)then h=hclo。 m=mclo。 s=sclo。 else h=halr。 m=malr。 s=00000000。 end if。 end process。 end beh。 : library ieee。 use 。 use 。 use 。 entity alarmcmp is port( h,m,halr,malr: in std_logic_vector(7 downto 0)。 stop:in std_logic。 sig:out std_logic)。 end alarmcmp。 architecture beh of alarmcmp is begin process(h,m,halr,malr,stop) begin if stop=39。039。then sig=39。039。 end if。 if h=halr and m=malr and stop=39。139。 then sig=39。139。 else sig=39。039。 end if。 end process。 end beh。 : 10 模塊圖如 圖 。分頻出的用 64Hz 信號對 s1校時信號、 s2校分信號、 s3秒清零信號、 s4秒清分。是由四個兩級 d觸發(fā)器構(gòu)成的,分別對輸入的 sa、 sb、 sc 信號的相鄰兩個上升沿進(jìn)行比較以確定按鍵的按下,從而達(dá)到消抖的目的。 Ⅴ .心得體會 通過此次課程設(shè)計,使我更加扎實的掌握了有關(guān)數(shù)字邏輯方面的知識,在設(shè)計過程中遇到了一些問題, 比如 在畫頂層原理圖時,最大的問題就是根本沒有把各個模塊的VHD文件以及生成的器件都全部放在頂層文件的文件夾內(nèi),還有就是程序設(shè)計的時候考慮的不夠全 面,沒有聯(lián)系著各個模式以及實驗板的情況來編寫程序,以至于多考慮編寫了譯碼電路而浪費了很多時間。 暴露除了我在這方面的知識有所欠缺和經(jīng)驗不足,實踐出真知,通過親自動手制作,使我們掌握的知識不再是紙上談兵。 課程設(shè)計誠然是一門專業(yè)課,給我很多專業(yè)知識以及專業(yè)技能上的提升,同時也給我很多新的想法,一些在課上學(xué)習(xí)不到的思路,讓我感觸頗深。通過這次課程設(shè)計,我掌握了關(guān)于數(shù)字鐘方面的有關(guān)知識,可以獨立設(shè)計一個數(shù)字鐘,并且了解了它的原理 。思路即出路,有什么不懂的地方要及時弄懂,世上無難事,只怕有心人。只要認(rèn)真專研,動手實踐 ,就沒有弄不懂的知識。