




版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、Quartus數(shù)字時(shí)鐘設(shè)計(jì) 1. 設(shè)計(jì)功能1. 可以快速設(shè)置時(shí)鐘起始值;2. 在59分50秒時(shí)開始報(bào)時(shí),七聲低音,一聲高音,報(bào)完剛好整點(diǎn)。二.功能實(shí)現(xiàn)1.頂層設(shè)計(jì)(采用BDF文件圖形設(shè)計(jì),文件名:timer.bdf)2. 秒計(jì)時(shí)器模塊設(shè)計(jì)library ieee;use ieee.std_logic_1164.all; use ieee.std_logic_arith.all; use ieee.std_logic_unsigned.all;entity second1 isport(clk1s:in std_logic; reset:in std_logic; sec2,sec1:buffe
2、r std_logic_vector(3 downto 0);-秒的十位和個(gè)位 seco: out std_logic); -秒計(jì)時(shí)器的進(jìn)位輸出end;architecture A of second1 is begin process(clk1s,reset) begin if reset = '0' then sec2 <= "0000" sec1 <= "0000" -清零秒計(jì)時(shí)器 seco <= '0' elsif clk1s'event and clk1s ='1' th
3、en if (sec1 = "1001" and sec2 = "0101") then sec2 <= "0000"sec1 <="0000" -在59秒時(shí)回零 seco <= '1' -進(jìn)位 elsif (sec1 ="1001") then sec1 <="0000" sec2 <= sec2+1; seco <= '0' else sec1 <= sec1+1; seco <= '
4、0' end if; end if;end process;end;3.分計(jì)時(shí)器模塊設(shè)計(jì)library ieee;use ieee.std_logic_1164.all; use ieee.std_logic_arith.all; use ieee.std_logic_unsigned.all;entity minute1 isport(clkm,clk1s,setm:in std_logic; -秒進(jìn)位輸入,1HZ校分時(shí)鐘輸入信號(hào),校分控制信號(hào) min2,min1:buffer std_logic_vector(3 downto 0); -分計(jì)時(shí)器的十位和個(gè)位 minco:out s
5、td_logic);end;architecture A of minute1 is signal clkx:std_logic; begin Pclkm:process(clkm,clk1s,setm) begin -根據(jù)是否校分選擇計(jì)時(shí)時(shí)鐘 if setm ='1' then clkx <= clk1s; -利用clk1s信號(hào)對(duì)分的初值進(jìn)行快速設(shè)置 else clkx <=clkm; -利用秒的進(jìn)位信號(hào)正常計(jì)時(shí) end if;end process;Pcontm:process(clkx) begin if clkx'event and clkx =
6、39;1' then if (min1 = "1001" and min2 = "0101") then min1 <="0000"min2 <="0000"minco <='1' -59分時(shí)回零并進(jìn)位 elsif (min1 = "1001") then min1 <="0000"min2 <= min2+1; minco <= '0' else min1 <= min1+1;minco &l
7、t;='0' end if; end if;end process;end;4.時(shí)計(jì)時(shí)器模塊設(shè)計(jì)library ieee;use ieee.std_logic_1164.all; use ieee.std_logic_arith.all; use ieee.std_logic_unsigned.all;entity hour1 is port(clkh,clk1s,seth:in std_logic; hou2,hou1:buffer std_logic_vector(3 downto 0) ); -時(shí)的十位和個(gè)位end;architecture A of hour1 is s
8、ignal clky:std_logic; begin Pclkh:process(clkh,clk1s,seth) Begin -根據(jù)是否校時(shí)選擇計(jì)時(shí)時(shí)鐘 if seth ='1' then clky <=clk1s; -利用clk1s信號(hào)對(duì)時(shí)的初值進(jìn)行快速設(shè)置 else clky <= clkh; -利用分的進(jìn)位信號(hào)正常計(jì)時(shí) end if; end process;Pconth:process(clky) begin if clky'event and clky ='1' then if (hou1="0011" an
9、d hou2 ="0010" ) then hou1 <= "0000"hou2 <= "0000" -23時(shí)回零 elsif (hou1 ="1001") then hou1 <= "0000" hou2 <= hou2+1; else hou1 <= hou1+1; end if; end if;end process;end;5.報(bào)時(shí)模塊設(shè)計(jì)library ieee;use ieee.std_logic_1164.all; use ieee.std_logic
10、_arith.all; use ieee.std_logic_unsigned.all;entity alarm1 is port(clk1s,clk500,clk1k: in std_logic; sec2,sec1,min2,min1: in std_logic_vector(3 downto 0); alarm: out std_logic);end;architecture A of alarm1 is begin process(clk1s) variable flag500:std_logic;variable flag1k:std_logic; begin if clk1s
11、9;event and clk1s = '1' then if(min1 ="1001" and min2="0101" and sec2="0101" ) then -59分50秒時(shí)開始報(bào)時(shí) case sec1 is when "0000" => flag500:='1' when "0010" => flag500:='1' when "0100" => flag500:='1' when
12、"0110" => flag500:='1' when "0111" => flag500:='1' when "1000" => flag500:='1' when "1001" => flag500:='1' -50,52,54,56,58,59秒時(shí)低頻率報(bào)時(shí) when others => flag500:='0'flag1k:='0' end case; else flag500:=&
13、#39;0'flag1k:='0' end if; if (min1 ="0000" and min2="0000" and sec1="0000" and sec2="0000") then flag1k:='1' -整點(diǎn)時(shí)高頻率報(bào)時(shí) end if; end if;if flag500='1' then alarm <=clk500; elsif flag1k='1' then alarm <=clk1k; else alarm <='0'end
溫馨提示
- 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝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ì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 傳染病防控政策執(zhí)行效果評(píng)價(jià)考核試卷
- 農(nóng)藥生產(chǎn)?;钒踩僮饕?guī)程考核試卷
- 內(nèi)陸?zhàn)B殖水域資源開發(fā)與漁業(yè)生態(tài)補(bǔ)償機(jī)制設(shè)計(jì)考核試卷
- 化學(xué)礦床勘探成本控制技術(shù)考核試卷
- 世界環(huán)境日活動(dòng)總結(jié)集合14篇
- 神經(jīng)內(nèi)科業(yè)務(wù)學(xué)
- 會(huì)計(jì)人員年度的工作總結(jié)
- 沈陽(yáng)建黨節(jié)活動(dòng)方案
- 江灘大舞臺(tái)活動(dòng)方案
- 漢陽(yáng)促銷活動(dòng)方案
- 2025-2030中國(guó)功率半導(dǎo)體器件市場(chǎng)格局與投資方向報(bào)告
- 統(tǒng)編版五年級(jí)升六年級(jí)語(yǔ)文暑期銜接《課外閱讀》專項(xiàng)測(cè)試卷及答案
- 2025年 煙草陜西公司招聘考試筆試試題附答案
- 2025年老年教育課程設(shè)置:藝術(shù)修養(yǎng)與審美教學(xué)探索報(bào)告
- 2025年河北高考真題化學(xué)試題+解析(參考版)
- 2025至2030中國(guó)數(shù)字出版行業(yè)產(chǎn)業(yè)運(yùn)行態(tài)勢(shì)及投資規(guī)劃深度研究報(bào)告
- 2025至2030中國(guó)中藥材種植行業(yè)運(yùn)作模式與競(jìng)爭(zhēng)格局分析報(bào)告
- 武漢大學(xué)2020年強(qiáng)基計(jì)劃物理試題(原卷版)
- 2025年隨州國(guó)投集團(tuán)公開招聘42名工作人員筆試參考題庫(kù)附帶答案詳解
- 2025泰和安消防產(chǎn)品選型手冊(cè)
- CJ/T 316-2009城鎮(zhèn)供水服務(wù)
評(píng)論
0/150
提交評(píng)論