數(shù)字邏輯EDA電子鐘課程設計報告_第1頁
數(shù)字邏輯EDA電子鐘課程設計報告_第2頁
數(shù)字邏輯EDA電子鐘課程設計報告_第3頁
數(shù)字邏輯EDA電子鐘課程設計報告_第4頁
數(shù)字邏輯EDA電子鐘課程設計報告_第5頁
已閱讀5頁,還剩3頁未讀, 繼續(xù)免費閱讀

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權,請進行舉報或認領

文檔簡介

1、-. z 多功能數(shù)字鐘設計說明:1系統(tǒng)頂層框圖:各模塊電路功能如下:1.秒計數(shù)器、分計數(shù)器、時計數(shù)器組成最根本的數(shù)字鐘,其計數(shù)輸出送7段譯碼電路由數(shù)碼管顯示。2.基準頻率分頻器可分頻出標準的1HZ頻率信號,用于秒計數(shù)的時鐘信號;分頻出4HZ頻率信號,用于校時、校分的快速遞增信號;分頻出64HZ頻率信號,用于對按動校時,校分按鍵的消除抖動。2.多功能數(shù)字鐘構造框圖:一、系統(tǒng)功能概述已完成功能完成時分秒的依次顯示并正確計數(shù),利用六位數(shù)碼管顯示;時分秒各段個位滿10正確進位,秒分能做到滿60向前進位,有系統(tǒng)時間清零功能;定時器:實現(xiàn)整點報時,通過揚聲器發(fā)出上下報時聲音;時間設置,也就是手動調(diào)時功能:

2、當認為時鐘不準確時,可以分別對分時鐘進展調(diào)整;鬧鐘:實現(xiàn)分/時鬧鐘設置,在時鐘到達設定時間時通過揚聲器響鈴。有靜音模式。 待改良功能:1. 系統(tǒng)沒有萬年歷功能,正在思考設計方法。2. 應添加秒表功能。二、系統(tǒng)組成以及系統(tǒng)各局部的設計1.時計數(shù)模塊時計數(shù)模塊就是一個2位10進制計數(shù)器,記數(shù)到23清零。VHDL的RTL描述如下:-t_h.vhdlibrary ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entityt_h is port(en,clk,clr:in std_logic; dout:out std_

3、logic_vector(7 downto 0); c:out std_logic);endt_h;architecture rtl oft_h issignal t:std_logic_vector(7 downto 0);begin process(en,clk,clr) variable t:std_logic_vector(7 downto 0); begin if en=1 then -異步使能 if clk event and clk=1 then t:=t+1; if t(3 downto 0)=*A then -個位等于10則十位加1 t(7 downto 4):=t(7 do

4、wnto 4)+1; t(3 downto 0):=*0; -個位清零 end if; if t*23 then -大于23清零 t:=*00; end if; end if; if clr=1 then -異步清零 t:=*00; end if; end if; dout=t; end process;end rtl;時計數(shù)器模塊仿真波形如下從仿真波形可知,當計數(shù)到23時,下一個時鐘上升沿到來時就清零了,符合設計要求。時計數(shù)模塊框圖如下分及秒計數(shù)模塊分及秒計數(shù)模塊也是一個2位10進制計數(shù)器,記數(shù)到59清零。VHDL的RTL描述如下:library ieee;use ieee.std_logi

5、c_1164.all;use ieee.std_logic_unsigned.all;entityt_s is port(en,clk,clr:in std_logic; dout:buffer std_logic_vector(7 downto 0); c:out std_logic);endt_s;architecture rtl oft_s isbegin process(en,clk,clr) begin if en=1 then if clr=1 then -異步清零 dout=*00; elsif clk event and clk=1 then if dout(3 downto

6、0)9 then dout(3 downto 0)=dout(3 downto 0)+1; c=0; elsif dout(7 downto 4)5 then dout(3 downto 0)=*0; dout(7 downto 4)=dout(7 downto 4)+1; else dout=*00; c=1; end if; end if; else dout10 then dout=1;t:=t-1; else dout=0; end if; end if; else dout=0;t:=0; end if; end process;end rtl;library ieee;use ie

7、ee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity ring is port( clk: in std_logic; clk500: in std_logic; clk1k:in std_logic; beep:out std_logic);end ring;architecture rtl of ring isbegin process(clk) variable t: std_logic; variable n: integer range 0 to 15:=0; begin if clk event and clk=1

8、 then t:=not t;n:=n+1; end if; if t=1 and n11 then beep=clk500; elsif n=11 then beep=clk1k; else beepsys_en,clk=clk_h,clr=sys_rst,dout=reg_h); m:t_s port map(en=sys_en,clk=clk_m,clr=sys_rst,dout=reg_m,c=c_m); s:t_s port map(en=sys_en,clk=sys_clk1,clr=SCc,dout=reg_s,c=c_s); -sled:segmain port map(clk

9、=clk1,reset_n=SCc,seg_data=seg_data,seg_=seg_,datain=dout(15 downto 0); -ring0:ring port map(en=en_r,clk=clk_ring,clk500=sys_clk500,clk1k=sys_clk1k,beep=beep); haoin1:haoin port map( SA,sys_clk64,SAc); haoin2:haoin port map( SB,sys_clk64,SBc); haoin3:haoin port map( SC,sys_clk64,SCc); haoin4:haoin p

10、ort map( SD,sys_clk64,SDc); NL:naoling port map(beep=NL_ring,h=reg_h,m=reg_m,clk4hzh=sys_clk4_NL_h,clk4hzm=sys_clk4_NL_m,sys_en=sys_en,sys_rst=sys_rst,h_o=NL_reg_h,m_o=NL_reg_m); beep=clk_ring and mh; -led=reg_s(3 downto 0); p_sys_clk:process(clk1) variable t1,t4,t64,t500,t1k:integer range 0 to 5000

11、0000; begin if clk1 event and clk1=1 then t1:=t1+1; t4:=t4+1; t64:=t64+1; t500:=t500+1; t1k:=t1k+1; if t1=clki/2 then t1:=0; sys_clk1=not sys_clk1; end if; if t4=clki/8 then t4:=0; sys_clk4=not sys_clk4; end if; if t64=clki/128 then t64:=0; sys_clk64=not sys_clk64; end if; if t500=clki/1000 then t50

12、0:=0; sys_clk500=not sys_clk500; end if; if t1k=clki/2000 then t1k:=0; sys_clk1k=not sys_clk1k; end if; end if; end process p_sys_clk; p_c:process(SAc,SBc,SCc,SDc) begin if SAc=1 and SDc=0 then clk_h=sys_clk4; else clk_h=c_m; end if; if SAc=1 and SDc=1 then sys_clk4_NL_h=sys_clk4; else sys_clk4_NL_h=0; end if; if SBc=1 and SDc=0then clk_m=sys_clk4; else clk_m=c_s; end if; if SBc=1 and SDc=1then sys_clk4_NL_m=sys_clk4; else sys_clk4_NL_m=0; end if; if SDc=0 then dout(7 downto 0)=reg_s

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 4. 未經(jīng)權益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
  • 6. 下載文件中如有侵權或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論