數(shù)字電子時(shí)鐘設(shè)計(jì)_第1頁(yè)
數(shù)字電子時(shí)鐘設(shè)計(jì)_第2頁(yè)
數(shù)字電子時(shí)鐘設(shè)計(jì)_第3頁(yè)
數(shù)字電子時(shí)鐘設(shè)計(jì)_第4頁(yè)
數(shù)字電子時(shí)鐘設(shè)計(jì)_第5頁(yè)
已閱讀5頁(yè),還剩18頁(yè)未讀 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

1、黑龍江科技學(xué)院課程設(shè)計(jì)任務(wù)書一、設(shè)計(jì)題目: 二、設(shè)計(jì)的主要內(nèi)容: 指導(dǎo)教師: 日 期: 教師評(píng)語(yǔ): 評(píng)閱成績(jī): 評(píng) 閱 人: 日 期: 黑龍江科技學(xué)院課程設(shè)計(jì)任務(wù)書一、設(shè)計(jì)題目: 數(shù)字電子時(shí)鐘設(shè)計(jì) 二、設(shè)計(jì)的主要內(nèi)容:本課程設(shè)計(jì)完成了數(shù)字電子鐘的設(shè)計(jì),數(shù)字電子鐘是一種用數(shù)字顯示秒、分、時(shí)的計(jì)時(shí)裝置,數(shù)字電子鐘走時(shí)精度高,穩(wěn)定性好,使用方便,不需要經(jīng)常調(diào)校,數(shù)字式電子鐘用秒脈沖發(fā)生器的精度穩(wěn)定保證了數(shù)字鐘的質(zhì)量。同時(shí)還兼容了鬧鐘功能、整點(diǎn)報(bào)時(shí)功能、和現(xiàn)實(shí)功能 指導(dǎo)教師: 日 期: 教師評(píng)語(yǔ): 評(píng)閱成績(jī): 評(píng) 閱 人: 日 期: 摘 要本課程設(shè)計(jì)完成了數(shù)字電子鐘的設(shè)計(jì),數(shù)字電子鐘是一種用數(shù)字顯示秒

2、、分、時(shí)的計(jì)時(shí)裝置,數(shù)字電子鐘走時(shí)精度高,穩(wěn)定性好,使用方便,不需要經(jīng)常調(diào)校,數(shù)字式電子鐘用秒脈沖發(fā)生器的精度穩(wěn)定保證了數(shù)字鐘的質(zhì)量。同時(shí)還兼容了鬧鐘功能、整點(diǎn)報(bào)時(shí)功能、和現(xiàn)實(shí)功能 關(guān)鍵詞:數(shù)字電子時(shí)鐘,鬧鐘,整點(diǎn)報(bào)時(shí),顯示第1章 數(shù)字電子時(shí)鐘概述本次設(shè)計(jì)以數(shù)字電子為主,實(shí)現(xiàn)對(duì)時(shí)、分、秒、星期數(shù)字顯示的計(jì)時(shí)裝置,周期為24小時(shí),顯示滿刻度為23時(shí)59分59秒,并具有校時(shí)功能,報(bào)時(shí)功能,鬧鐘功能,整點(diǎn)報(bào)時(shí)功能的數(shù)字電子鐘。電路主要采用中規(guī)模CMOS集成電路。本系統(tǒng)的設(shè)計(jì)電路分計(jì)時(shí)調(diào)時(shí)模塊模塊、鬧鐘模塊模塊、正點(diǎn)報(bào)時(shí)模塊、顯示電路模塊等幾個(gè)部分。1.1 計(jì)時(shí)調(diào)時(shí)模塊計(jì)時(shí)功能:它是由兩個(gè)60進(jìn)制計(jì)數(shù)

3、器和一個(gè)24進(jìn)制計(jì)數(shù)器連接成的。構(gòu)成了時(shí)鐘正常的計(jì)時(shí)功能。當(dāng)?shù)竭_(dá)59秒鐘的時(shí)候,當(dāng)再來一個(gè)CP脈沖的時(shí)候,將自動(dòng)進(jìn)位,使分針上加一。分針也是一樣。當(dāng)時(shí)針到達(dá)23點(diǎn)59分59秒的時(shí)候,當(dāng)再次來一個(gè)CP脈沖時(shí)候,又轉(zhuǎn)化為0點(diǎn)0分0秒。調(diào)時(shí)功能:控制鍵mode=0;當(dāng)調(diào)分sb為0的時(shí)候,調(diào)分有效,分針加一;當(dāng)調(diào)時(shí)sa為0的時(shí)候,調(diào)時(shí)有效,時(shí)針加一;數(shù)碼管上顯示計(jì)時(shí)的時(shí)間。(說明:此處調(diào)分功能的實(shí)現(xiàn)是在second即秒鐘內(nèi)實(shí)現(xiàn)的,當(dāng)調(diào)分=0時(shí),向second模塊內(nèi)輸入一個(gè)脈沖信號(hào),分針加一。調(diào)時(shí)功能實(shí)現(xiàn)也是如此。)注意:此次實(shí)驗(yàn)要求只用一個(gè)時(shí)鐘脈沖,所以我選擇了1024HZ的頻率。用1個(gè)分頻器實(shí)現(xiàn)了頻

4、率的分頻。圖形連接如下1.2 鬧鐘模塊正常定時(shí)功能:此時(shí),應(yīng)該是mode=1(定時(shí)開關(guān)),即定時(shí)有效。此時(shí)與門才會(huì)輸入有效脈沖信號(hào),定時(shí)開始,通過調(diào)分sb實(shí)現(xiàn)調(diào)分功能,通過調(diào)時(shí)sa實(shí)現(xiàn)調(diào)時(shí)功能。此處的定時(shí)功能和上面所說的調(diào)時(shí)功能實(shí)現(xiàn)的步驟基本類似。但是只有在控制鍵mode=1時(shí),才能輸出定時(shí)時(shí)間,并且在數(shù)碼管上顯示我們所定的時(shí)間(秒針不算)。鬧鐘鳴叫:tsalarm(比較開關(guān))不斷把所定時(shí)間與當(dāng)前時(shí)間進(jìn)行比較,當(dāng)?shù)竭_(dá)所定時(shí)間的時(shí)候,發(fā)出鳴叫,時(shí)間持續(xù)十秒鐘。1.3 整點(diǎn)報(bào)時(shí)模塊當(dāng)它到達(dá)59分51、53、55、57秒時(shí),他發(fā)出四聲低音,當(dāng)?shù)竭_(dá)59分59秒時(shí),發(fā)出一聲高音,起定點(diǎn)報(bào)時(shí)的功能,此處發(fā)

5、出高低不同的聲音是因?yàn)檩斎氲念l率不同。輸入1024HZ頻率的時(shí)候,發(fā)出高音。輸入512HZ頻率的時(shí)候,發(fā)出低音。1.4 顯示模塊它包括1個(gè)七段譯碼器、一個(gè)八進(jìn)制計(jì)數(shù)器和一個(gè)六選一的數(shù)據(jù)選擇器。當(dāng)mode=0時(shí)數(shù)碼管上顯示計(jì)時(shí)狀態(tài),mode=1 時(shí)數(shù)碼管上顯示鬧鐘狀態(tài)。第2章 數(shù)字電子時(shí)鐘設(shè)計(jì)思想2.1 計(jì)時(shí)模塊內(nèi)部小模塊 second模塊(秒60進(jìn)制)library ieee;entity second isport(clk,clr:in std_logic;sec1,sec0:out std_logic_vector(3 downto 0);co:out std_logic);end sec

6、ond;architecture art of second isbeginprocess(clk,clr)variable cnt1,cnt0:std_logic_vector(3 downto 0);beginif clr='1' thencnt1:="0000"cnt0:="0000"elsif clk'event and clk='1' thenif cnt1="0101" and cnt0="1001"thenco<='1'cnt1:=&quo

7、t;0000"cnt0:="0000"elsif cnt0<"1001"thencnt0:=cnt0+1; co<='0'elsecnt0:="0000"if cnt1<"0101" then cnt1:=cnt1+1; co<='0'elsecnt1:="0000"co<='0'end if;end if;end if;sec1<=cnt1;sec0<=cnt0;end process;end

8、art;2.1.2 minute0模塊(分60進(jìn)制)LIBRARY ieee;ENTITY minute0 IS PORT(en : INSTD_LOGIC; min1,min0 :out std_logic_vector(3 downto 0);co: OUTSTD_LOGIC);END minute0;ARCHITECTURE art OF minute0 ISBEGIN Process (en)variable cnt1,cnt0:std_logic_vector(3 downto 0);begin if en'event and en='1' then if c

9、nt1="0101"and cnt0="1001"then co<='1' cnt1:="0000" cnt0:="0000" elsif cnt0<"1001"then cnt0:=cnt0+1; co<='0' else cnt0:="0000" if cnt1<"0101"then cnt1:=cnt1+1;co<='0' else cnt1:="0000&quo

10、t; co<='0' end if; end if; min1<=cnt1; min0<=cnt0; end if; end process;end art; hour模塊(小時(shí)60進(jìn)制)library ieee;entity hour isport(en :in std_logic; h1,h0 :out std_logic_vector(3 downto 0);end hour;architecture hour_arc of hour isbeginprocess(en)variable cnt1,cnt0:std_logic_vector(3 down

11、to 0);beginif en'event and en='1'thenif cnt1="0010"and cnt0="0011"thencnt0:="0000"cnt1:="0000"elsif cnt0<"1001"thencnt0:=cnt0+1;elsecnt0:="0000"cnt1:=cnt1+1;end if;end if;h1<=cnt1;h0<=cnt0;end process;end hour_arc;2.2 n

12、aozhong內(nèi)部小模塊 tsalarm模塊(鬧鐘比較響鈴)LIBRARY ieee;ENTITY tsalarm IS PORT(amin1,amin0,ah1,ah0,sec1,sec0,min1,min0,h1,h0:in std_logic_vector(3 downto 0); clk :in std_logic; sound :OUT std_logic);END tsalarm;ARCHITECTURE art OF tsalarm ISBEGINprocess(clk,amin1,amin0,ah1,ah0,sec0,min1,min0,h1,h0)beginif clk

13、9;event and clk='1'then if min1=amin1 and min0=amin0 and h1=ah1 and h0=ah0 then if sec1="0000" and sec0<"1001" then sound<='1' else sound<='0' end if; end if;end if; end process; end art; alarm模塊(選擇輸出給顯示模塊的端口)LIBRARY ieee;ENTITY alarm IS PORT(amin

14、1,amin0,ah1,ah0,min1,min0,h1,h0 :in std_logic_vector(3 downto 0); mode :IN STD_LOGIC;a1,a0,b1,b0 :OUT std_logic_vector(3 downto 0);END alarm;ARCHITECTURE art OF alarm ISBEGIN Process (mode,min1,min0,h1,h0,amin1,amin0,ah1,ah0)begin if mode='0'then a1<=min1; a0<=min0; b1<=h1; b0<=h

15、0; else a1<=amin1; a0<=amin0; b1<=ah1; b0<=ah0; end if; end process;end art;aminte0模塊LIBRARY ieee;ENTITY aminute0 IS PORT(en,mode : INSTD_LOGIC; min1,min0 :out std_logic_vector(3 downto 0);END aminute0;ARCHITECTURE art OF aminute0 ISBEGIN Process (en,mode)variable cnt1,cnt0:std_logic_vec

16、tor(3 downto 0);begin if en'event and en='1' thenif mode='1'then if cnt1="0101"and cnt0="1001"then cnt1:="0000" cnt0:="0000" elsif cnt0<"1001"then cnt0:=cnt0+1; else cnt0:="0000" if cnt1<"0101"then cnt1:=

17、cnt1+1; else cnt1:="0000" end if; end if; min1<=cnt1; min0<=cnt0; end if; end if; end process;end art; ahour模塊library ieee;entity ahour isport(en,mode :in std_logic; h1,h0 :out std_logic_vector(3 downto 0);end ahour;architecture hour_arc of ahour isbeginprocess(en,mode)variable cnt1,

18、cnt0:std_logic_vector(3 downto 0);beginif en'event and en='1'thenif mode='1'thenif cnt1="0010"and cnt0="0011"thencnt0:="0000"cnt1:="0000"elsif cnt0<"1001"thencnt0:=cnt0+1;elsecnt0:="0000"cnt1:=cnt1+1;end if;end if;end

19、 if;h1<=cnt1;h0<=cnt0;end process;end hour_arc;2.3 xianshi 內(nèi)部小模塊 sel模塊(8進(jìn)制計(jì)數(shù)器)library ieee;entity sel is port(clk:in std_logic; q:out std_logic_vector(2 downto 0);end sel;architecture sel_arc of sel isbegin process(clk) variable cnt:std_logic_vector(2 downto 0); begin if clk'event and clk=

20、'1' then cnt:=cnt+1; end if; q<=cnt; end process;end sel_arc; disp 模塊(七段顯示譯碼器)LIBRARY ieee;ENTITY disp ISPORT( d: INSTD_LOGIC_VECTOR(3 downto 0); q : OUTSTD_LOGIC_vector(6 downto 0);END disp;ARCHITECTURE disp_arc OF disp ISBEGIN Process (d) begin case d is when"0000"=>q<=&

21、quot;0111111" when"0001"=>q<="0000110" when"0010"=>q<="1011011" when"0011"=>q<="1001111" when"0100"=>q<="1100110" when"0101"=>q<="1101101" when"0110"=>q

22、<="1111101" when"0111"=>q<="0100111" when"1000"=>q<="1111111" when"1001"=>q<="1101111" when others=>q<="0000000" end case; end process;END disp_arc; xzxs 模塊library ieee;entity xsxz isport(sec1,

23、sec0,min1,min0,h1,h0:in std_logic_vector(3 downto 0);sel:in std_logic_vector(2 downto 0);q:out std_logic_vector(3 downto 0);end xsxz;architecture art of xsxz isbeginprocess(sel)begincase sel iswhen "000"=>q<=h1;when "001"=>q<=h0;when "011"=>q<=min1;whe

24、n "100"=>q<=min0;when "110"=>q<=sec1;when "111"=>q<=sec0;when others=>q<="1111"end case;end process;end art; fen 模塊(分頻器)library ieee;entity fen isport(clk :in std_logic; q512,q1 :out std_logic);end fen;architecture fen_arc of fen isbegi

25、nprocess(clk)variable cnt:integer range 0 to 1023;begin if clk'event and clk='1' then if cnt<1023 then cnt:=cnt+1; q1<='0' else cnt:=0; q1<='1' end if; end if;end process;process(clk)variable cnt:integer range 0 to 1;beginif clk'event and clk='1' thenif cnt<1 thencnt:=cnt+1;q512<='0'else cnt:=0;q512<='1

溫馨提示

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

評(píng)論

0/150

提交評(píng)論