




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)
文檔簡介
1、Quartus數(shù)字時鐘設(shè)計 1. 設(shè)計功能1. 可以快速設(shè)置時鐘起始值;2. 在59分50秒時開始報時,七聲低音,一聲高音,報完剛好整點。二.功能實現(xiàn)1.頂層設(shè)計(采用BDF文件圖形設(shè)計,文件名:timer.bdf)2. 秒計時器模塊設(shè)計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);-秒的十位和個位 seco: out std_logic); -秒計時器的進位輸出end;architecture A of second1 is begin process(clk1s,reset) begin if reset = '0' then sec2 <= "0000" sec1 <= "0000" -清零秒計時器 seco <= '0' elsif clk1s'event and clk1s ='1' th
3、en if (sec1 = "1001" and sec2 = "0101") then sec2 <= "0000"sec1 <="0000" -在59秒時回零 seco <= '1' -進位 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.分計時器模塊設(shè)計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; -秒進位輸入,1HZ校分時鐘輸入信號,校分控制信號 min2,min1:buffer std_logic_vector(3 downto 0); -分計時器的十位和個位 minco:out s
5、td_logic);end;architecture A of minute1 is signal clkx:std_logic; begin Pclkm:process(clkm,clk1s,setm) begin -根據(jù)是否校分選擇計時時鐘 if setm ='1' then clkx <= clk1s; -利用clk1s信號對分的初值進行快速設(shè)置 else clkx <=clkm; -利用秒的進位信號正常計時 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分時回零并進位 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è)計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) ); -時的十位和個位end;architecture A of hour1 is s
8、ignal clky:std_logic; begin Pclkh:process(clkh,clk1s,seth) Begin -根據(jù)是否校時選擇計時時鐘 if seth ='1' then clky <=clk1s; -利用clk1s信號對時的初值進行快速設(shè)置 else clky <= clkh; -利用分的進位信號正常計時 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時回零 elsif (hou1 ="1001") then hou1 <= "0000" hou2 <= hou2+1; else hou1 <= hou1+1; end if; end if;end process;end;5.報時模塊設(shè)計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秒時開始報時 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秒時低頻率報時 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' -整點時高頻率報時 end if; end if;if flag500='1' then alarm <=clk500; elsif flag1k='1' then alarm <=clk1k; else alarm <='0'end
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 藥物靶點鑒定-洞察闡釋
- 神經(jīng)性嘔吐的社會管理態(tài)度與文化因素-洞察闡釋
- 情感計算在AR交互中的應(yīng)用探索-洞察闡釋
- 2025至2030中國登記柜臺行業(yè)產(chǎn)業(yè)運行態(tài)勢及投資規(guī)劃深度研究報告
- 2025至2030中國電子門鎖行業(yè)深度研究及發(fā)展前景投資評估分析
- 2025至2030中國瑜珈褲行業(yè)產(chǎn)業(yè)運行態(tài)勢及投資規(guī)劃深度研究報告
- 非遺研學(xué)旅游的可持續(xù)發(fā)展與生態(tài)保護路徑研究
- 教育機器人引領(lǐng)未來學(xué)習(xí)新體驗
- 游戲化學(xué)習(xí)在教育科技領(lǐng)域的應(yīng)用與前景
- 商業(yè)環(huán)境中教育心理學(xué)的價值體現(xiàn)
- 廣州市藝術(shù)中學(xué)招聘教師考試真題2024
- 工業(yè)自動化設(shè)備保修及維修管理措施
- 期末作文預(yù)測外研版七年級英語下冊
- 2025-2030中國兒童魚油行業(yè)銷售動態(tài)及競爭策略分析報告
- GB/T 4153-2008混合稀土金屬
- 《一粒種子》課件
- 弘揚錢學(xué)森精神PPT忠誠擔(dān)當(dāng)踐行科學(xué)報國之志PPT課件(帶內(nèi)容)
- 上半年我國經(jīng)濟形勢分析與公司應(yīng)對策略
- 小學(xué)語文人教五年級下冊(統(tǒng)編)第六單元-15、自相矛盾學(xué)歷案
- 中國教育學(xué)會會員申請表
- 黃大年式教師團隊申報
評論
0/150
提交評論