數(shù)電實(shí)驗(yàn)--多功能數(shù)字鐘_第1頁
數(shù)電實(shí)驗(yàn)--多功能數(shù)字鐘_第2頁
數(shù)電實(shí)驗(yàn)--多功能數(shù)字鐘_第3頁
數(shù)電實(shí)驗(yàn)--多功能數(shù)字鐘_第4頁
數(shù)電實(shí)驗(yàn)--多功能數(shù)字鐘_第5頁
已閱讀5頁,還剩11頁未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

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

文檔簡介

1、-. z理工大學(xué)本科實(shí)驗(yàn)報(bào)告題目:多功能數(shù)字鐘課程名稱: 數(shù)字電路課程設(shè)計(jì)學(xué)院系:電子信息與電氣工程學(xué)部專 業(yè): 自動(dòng)化 班 級(jí): 電自0801 學(xué)生:學(xué) 號(hào): 202181142 完成日期: 2021年7月20日 成 績:2021 年 7 月 20 日題目:多功能數(shù)字鐘1 設(shè)計(jì)要求一個(gè)具有時(shí),分,秒的十進(jìn)制數(shù)字顯示小時(shí)從0023計(jì)時(shí)器。具有手動(dòng)校時(shí),校分的功能。定時(shí)與鬧鐘功能,能在設(shè)定的時(shí)間發(fā)出鬧鈴聲能整點(diǎn)報(bào)時(shí)。要求從59分54秒起報(bào)時(shí),每隔2秒發(fā)出低音,連續(xù)3次,在整點(diǎn)要高音。2 設(shè)計(jì)分析及系統(tǒng)方案設(shè)計(jì)系統(tǒng)總體結(jié)果系統(tǒng)設(shè)計(jì)要求說明:該秒表用模24、模60計(jì)數(shù)器實(shí)現(xiàn)24小時(shí)計(jì)時(shí)在調(diào)節(jié)鬧鐘時(shí)不

2、影響數(shù)字鐘的正常走表;在調(diào)節(jié)鬧鐘時(shí)要通過數(shù)碼管顯示出;3系統(tǒng)以及模塊硬件電路設(shè)計(jì)根據(jù)上述給出的系統(tǒng)總體構(gòu)造框圖,給出系統(tǒng)硬件電路設(shè)計(jì),并作必要的說明和理論計(jì)算。由于數(shù)字電路課程設(shè)計(jì)課程采用實(shí)驗(yàn)箱完成,沒有學(xué)時(shí)涉及有關(guān)FPGA芯片的使用,因此有關(guān)FPGA芯片的局部可以用FPGA最小系統(tǒng)模塊框代替。其余接口局部按鍵,LED以及數(shù)碼管,各種接口等需要設(shè)計(jì)電路以及參數(shù)。下載時(shí)選擇的開發(fā)系統(tǒng)模式以及管腳定義表1 GW48-CK開發(fā)系統(tǒng)工作模式:模式0接口名稱類型(輸入/輸出)構(gòu)造圖上的信號(hào)名引腳號(hào)說明en輸入PIO716手動(dòng)校時(shí)1-調(diào)時(shí),0-走表th輸入PIO611調(diào)時(shí)按鍵en=1,或en1=1調(diào)時(shí)en

3、1輸入PIO510鬧鐘設(shè)定1-調(diào)時(shí),0-不走tm輸入PIO49調(diào)分按鍵en=1或en1=1,才可調(diào)分alarmstop輸入PIO38鬧鈴控制端clk輸入CLOCK142系統(tǒng)走表時(shí)鐘f=1Hzclk1輸入CLOCK02鬧鐘與整點(diǎn)報(bào)時(shí)時(shí)鐘f=256Hzclk2輸入CLOCK583整點(diǎn)報(bào)時(shí)時(shí)鐘時(shí)鐘f=1024Hzqhh輸出PIO47-PIO4479、78、73、72輸出小時(shí)的高位qlh輸出PIO43-PIO4071、70、67、66輸出小時(shí)的低位qhm輸出PIO39-PIO3665、64、62、61輸出分鐘的高位qlm輸出PIO35-PIO3260、59、58、54輸出分鐘的低位qhs輸出PIO31

4、-PIO2853、52、51、50輸出秒的高位qls輸出PIO27-PIO2449、48、47、39輸出秒的低位speaker輸出SPEAKER3輸出蜂鳴器的時(shí)鐘4 系統(tǒng)的VHDL設(shè)計(jì)系統(tǒng)的各個(gè)局部如何用VHDL設(shè)計(jì)出來的應(yīng)該有說明,包括論述以及真值表或者狀態(tài)圖等。要求:系統(tǒng)或頂層文件構(gòu)造描述,各個(gè)模塊或子程序的功能描述;1用原理圖實(shí)現(xiàn)的,需包含以下容:(1)系統(tǒng)原理圖(2)主要模塊或符號(hào)說明;主要模塊:模60計(jì)數(shù)器,模24計(jì)數(shù)器,2用VHDL語言實(shí)現(xiàn)的(1) 秒計(jì)數(shù)器模60計(jì)數(shù)器library ieee;use ieee.std_logic_1164.all;use ieee.std_log

5、ic_unsigned.all;entity m_601 is port(clk: in std_logic; clk_1: out std_logic; -clk_1表進(jìn)位 qh,ql:out std_logic_vector(3 downto 0)qh,ql表示十位與個(gè)位 );end;architecture a of m_601 issignal qqh,qql: std_logic_vector(3 downto 0);signal tmp: std_logic;begin process(clk)begin if clkevent and clk=1 then if qql=9 th

6、en qql=0000; if qqh=5 then qqh=0000;tmp=1; else qqh=qqh+1; end if; else qql=qql+1; tmp=0; end if; end if;end process;qh=qqh;ql=qql;clk_1=tmp;end;秒計(jì)數(shù)器仿真圖2分計(jì)數(shù)器模60計(jì)數(shù)器library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity m_60 is port(clk,en,t: in std_logic; -在en=1控制的情況下,手動(dòng)t校時(shí) c

7、lk_1: out std_logic; -clk_1表進(jìn)位 qh,ql:out std_logic_vector(3 downto 0)qh,ql表十位與個(gè)位 );end;architecture a of m_60 issignal qqh,qql: std_logic_vector(3 downto 0);signal tmp,tmp_1: std_logic;begin process(tmp_1)begin if tmp_1event and tmp_1=1 then if qql=9 then qql=0000; if qqh=5 then qqh=0000;tmp=1; else

8、 qqh=qqh+1; end if; else qql=qql+1; tmp=0; end if; end if;end process;qh=qqh;ql=qql;clk_1=tmp;process(en,clk,t)beginif en=0 thentmp_1=clk;elsetmp_1=t;end if;end process;end;分計(jì)數(shù)器仿真圖3小時(shí)計(jì)數(shù)器模24計(jì)數(shù)器library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity m_24 is port(clk,en,t: in st

9、d_logic; -在en=1控制的情況下,手動(dòng)t校時(shí) qh,ql:out std_logic_vector(3 downto 0)qh,ql表十位與個(gè)位 );end;architecture a of m_24 issignal tmp: std_logic;signal qqh,qql: std_logic_vector(3 downto 0);begin process(en,tmp,t)beginif en=0 thentmp=clk;elsetmp=t;end if;end process;process(tmp)begin if tmpevent and tmp=1 then if

10、 qql=9 or(qql=4 and qqh=2) then qql=0000; if qqh=2 then qqh=0000; else qqh=qqh+1; end if; else qql=qql+1; end if; end if;end process;qh=qqh;ql=qql;end;小時(shí)計(jì)數(shù)器模24計(jì)數(shù)器仿真圖鬧鐘分鐘計(jì)數(shù)器模60計(jì)數(shù)器library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity m_60b is port(clk,en: in std_logic; -在en=1

11、是,手動(dòng)給clk,鬧鐘加1; qh,ql:out std_logic_vector(3 downto 0) );end;architecture a of m_60b issignal qqh,qql: std_logic_vector(3 downto 0);begin process(en,clk)begin if clkevent and clk=1 then if en=1 then if qql=9 then qql=0000; if qqh=5 then qqh=0000; else qqh=qqh+1; end if; else qql=qql+1; end if; end if

12、; end if;end process;qh=qqh;ql=qql;end;鬧鐘分鐘計(jì)數(shù)器模60計(jì)數(shù)器仿真圖鬧鐘小時(shí)計(jì)數(shù)器模24計(jì)數(shù)器library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity m_24b is port(clk,en: in std_logic; qh,ql:out std_logic_vector(3 downto 0) );end;architecture a of m_24b issignal qqh,qql: std_logic_vector(3 downto 0);

13、begin process(clk,en)begin if clkevent and clk=1 then if en=1 then if qql=9 or(qql=4 and qqh=2) then qql=0000; if qqh=2 then qqh=0000; else qqh=qqh+1; end if; else qql=qql+1; end if; end if; end if;end process;qh=qqh;ql=qql;end;鬧鐘小時(shí)計(jì)數(shù)器模24計(jì)數(shù)器仿真圖整個(gè)系統(tǒng)程序library ieee;use ieee.std_logic_1164.all;use ieee.

14、std_logic_unsigned.all;-分鐘模60計(jì)數(shù)器-entity m_60 is port(clk,en,t: in std_logic; clk_1: out std_logic; qh,ql:out std_logic_vector(3 downto 0) );end;architecture a of m_60 issignal qqh,qql: std_logic_vector(3 downto 0);signal tmp,tmp_1: std_logic;begin process(tmp_1)begin if tmp_1event and tmp_1=1 then i

15、f qql=9 then qql=0000; if qqh=5 then qqh=0000;tmp=1; else qqh=qqh+1; end if; else qql=qql+1; tmp=0; end if; end if;end process;qh=qqh;ql=qql;clk_1=tmp;process(en,clk,t)beginif en=0 thentmp_1=clk;elsetmp_1=t;end if;end process;end;library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.a

16、ll;-校分模60計(jì)數(shù)器-entity m_60b is port(clk,en: in std_logic; qh,ql:out std_logic_vector(3 downto 0) );end;architecture a of m_60b issignal qqh,qql: std_logic_vector(3 downto 0);begin process(en,clk)begin if clkevent and clk=1 then if en=1 then if qql=9 then qql=0000; if qqh=5 then qqh=0000; else qqh=qqh+

17、1; end if; else qql=qql+1; end if; end if; end if;end process;qh=qqh;ql=qql;end;library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;-秒表模60計(jì)數(shù)器-entity m_601 is port(clk: in std_logic; clk_1: out std_logic; qh,ql:out std_logic_vector(3 downto 0) );end;architecture a of m_601 issign

18、al qqh,qql: std_logic_vector(3 downto 0);signal tmp: std_logic;begin process(clk)begin if clkevent and clk=1 then if qql=9 then qql=0000; if qqh=5 then qqh=0000;tmp=1; else qqh=qqh+1; end if; else qql=qql+1; tmp=0; end if; end if;end process;qh=qqh;ql=qql;clk_1=tmp;end;library ieee;use ieee.std_logi

19、c_1164.all;use ieee.std_logic_unsigned.all;-校時(shí)模24計(jì)數(shù)器-entity m_24b is port(clk,en: in std_logic; qh,ql:out std_logic_vector(3 downto 0) );end;architecture a of m_24b issignal qqh,qql: std_logic_vector(3 downto 0);begin process(clk,en)begin if clkevent and clk=1 then if en=1 then if qql=9 or(qql=4 and

20、 qqh=2) then qql=0000; if qqh=2 then qqh=0000; else qqh=qqh+1; end if; else qql=qql+1; end if; end if; end if;end process;qh=qqh;ql=qql;end;library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;-小時(shí)模24計(jì)數(shù)器-entity m_24 is port(clk,en,t: in std_logic; qh,ql:out std_logic_vector(3 down

21、to 0) );end;architecture a of m_24 issignal tmp: std_logic;signal qqh,qql: std_logic_vector(3 downto 0);begin process(en,tmp,t)beginif en=0 thentmp=clk;elsetmp=t;end if;end process;process(tmp)begin if tmpevent and tmp=1 then if qql=9 or(qql=4 and qqh=2) then qql=0000; if qqh=2 then qqh=0000; else q

22、qh=qqh+1; end if; else qql=qql+1; end if; end if;end process;qh=qqh;ql=qql;end;library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity top4 is port(clk,clk1,clk2,en,en1,th,tm,alarmstop:in std_logic;-clk:系統(tǒng)走表時(shí)鐘(f=1Hz);clk1:鬧鐘與整點(diǎn)報(bào)時(shí)時(shí)鐘f=256Hz;clk2: 整點(diǎn)報(bào)時(shí)時(shí)鐘(f=1024Hz);en.en1:分別是校時(shí)、校

23、分與調(diào)鬧鈴的使能端;th,tm:是手動(dòng)調(diào)節(jié)小時(shí)與分鐘的時(shí)鐘- qls,qhs,qlm,qhm,qlh,qhh:out std_logic_vector(3 downto 0);-分別表示秒低高位,分上下位,時(shí)上下位- speaker:out std_logic );speaker:是喇叭end;architecture a of top4 is ponent m_60 port(clk,en,t: in std_logic; clk_1: out std_logic; qh,ql:out std_logic_vector(3 downto 0) );end ponent; ponent m_6

24、01 port(clk: in std_logic; clk_1: out std_logic; qh,ql:out std_logic_vector(3 downto 0) );end ponent; ponent m_60b port(clk,en: in std_logic; qh,ql:out std_logic_vector(3 downto 0) );end ponent; ponent m_24 port(clk,en,t: in std_logic; qh,ql:out std_logic_vector(3 downto 0) );end ponent; ponent m_24

25、b port(clk,en: in std_logic; qh,ql:out std_logic_vector(3 downto 0) );end ponent; signal fulls,fullm:std_logic; -秒、分進(jìn)位- signal:qhhtmp,qlhtmp,qhmtmp,qlmtmp,qhhaltmp,qlhaltmp,qhmaltmp, qlmaltmp,qlstmp,qhstmp:std_logic_vector(3 downto 0);-秒,分,時(shí)中間信號(hào)- signal speaker1,speaker2:std_logic; -鬧鐘與整點(diǎn)報(bào)時(shí)的中間信號(hào)begi

26、n u1:m_601 port map(clk,fulls,qhstmp,qlstmp); u2:m_60 port map(fulls,en,tm,fullm,qhmtmp,qlmtmp); u3:m_24 port map(fullm,en,th,qhhtmp,qlhtmp); u4:m_24b port map(th,en1,qhhaltmp,qlhaltmp); u5:m_60b port map(tm,en1,qhmaltmp,qlmaltmp); process(en1,qhhaltmp,qlhaltmp,qhmaltmp,qlmaltmp,qhhtmp,qlhtmp, qhmtm

27、p,qlmtmp) begin if en1=1 then-在鬧鐘調(diào)節(jié)時(shí),把鬧鐘顯示的界面顯示出來并且不影響時(shí)鐘的正常走表- qhh=qhhaltmp;qlh=qlhaltmp; qhm=qhmaltmp;qlm=qlmaltmp; qhs=0000;qls=0000; else -在en=0時(shí)顯示正常走表- qhs=qhstmp;qls=qlstmp; qhh=qhhtmp;qlh=qlhtmp; qhm=qhmtmp;qlm=qlmtmp; end if; end process; -鬧鐘-process(alarmstop,qhhaltmp,qlhaltmp,qhmaltmp,qlmaltmp,qhhtmp,qlhtmpqhmtmp,qlmtmp), -當(dāng)?shù)筋A(yù)設(shè)時(shí)間時(shí)別且alarmstop=0是每隔2秒響一次- begin if qhhaltmp=qhhtmp and qlhaltmp=qlhtmp and qhmaltmp=qhmtmp and qlmaltmp=qlmtmp and (qlstmp=1 or qlstmp=3 or qlstmp=5 or qlstmp=7 or qlstmp=9) then if alarmstop=0 then speaker2=clk1; else sp

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(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)論