已閱讀5頁,還剩20頁未讀, 繼續(xù)免費(fèi)閱讀
版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)
文檔簡介
現(xiàn)代電子系統(tǒng)設(shè)計中北學(xué)院現(xiàn)代電子系統(tǒng)設(shè)計_數(shù)字電子鐘實驗報告姓名:葉子班級:0932班學(xué)號:專業(yè):電子信息工程任課教師:倪小琦完成時間:2012年5月19日2518093203葉子目錄第一章數(shù)字電子鐘功能簡介3第二章數(shù)字電子鐘原理介紹32.1數(shù)字電子鐘基本原理 32.2數(shù)字電子鐘電路組成 3第三章利用QuartusII設(shè)計數(shù)字電子鐘 73.1按鍵去抖動模塊 73.2分頻電路模塊 93.3選擇器模塊133.4計數(shù)模塊143.5分位電路模塊183.6數(shù)碼管動態(tài)顯示掃描模塊213.7數(shù)碼管動態(tài)顯示模塊22第四章仿真與實現(xiàn)25第一章數(shù)字電子鐘功能簡介 計時功能:這是本計時器設(shè)計的基本功能,可進(jìn)行時、分、秒計時,并顯示在6個七段數(shù)碼管上。 調(diào)時功能:當(dāng)需要校時,可通過實驗箱上的按鍵控制,按下對應(yīng)的按鍵,可調(diào)整對應(yīng)的時、分狀態(tài)。第二章數(shù)字電子鐘原理簡介2.1數(shù)字電子鐘基本原理 數(shù)字鐘電路的基本結(jié)構(gòu)由兩個60進(jìn)制計數(shù)器和一個24進(jìn)制計數(shù)器組成,分別對秒、分、小時進(jìn)行計時,當(dāng)計時到23時59分59秒時,再來一個計數(shù)脈沖,計數(shù)器清零,重新開始計時。秒計數(shù)器的計數(shù)時鐘CLK為1Hz的標(biāo)準(zhǔn)信號,可以由27MHz信號通過分頻得到。當(dāng)數(shù)字鐘處于計時狀態(tài)時,秒計數(shù)器的進(jìn)位輸出信號作為分鐘計數(shù)器的計數(shù)信號,分鐘計數(shù)器的進(jìn)位輸出信號又作為小時計數(shù)器的計數(shù)信號。時、分、秒的計時結(jié)果通過6個數(shù)碼管來動態(tài)顯示。數(shù)字鐘除了能夠正常計時外,還應(yīng)能夠?qū)r間進(jìn)行調(diào)整。可通過模式選擇信號控制數(shù)字鐘的工作狀態(tài),即控制數(shù)字鐘,使其分別工作于正常計時,調(diào)整分、時和設(shè)定分、時狀態(tài)。當(dāng)數(shù)字鐘處于計時狀態(tài)時,3個計數(shù)器允許計數(shù),且秒、分、時計數(shù)器的計數(shù)時鐘信號分別為CLK,秒的進(jìn)位, 分的進(jìn)位;當(dāng)數(shù)字鐘處于調(diào)整時間狀態(tài)時,被調(diào)的分或時會一秒一秒地增加。2.2數(shù)字電子鐘電路組成 本實驗數(shù)字電子鐘的設(shè)計電路主要由七個模塊組成,分別是:按鍵去抖動模塊、分頻電路模塊、選擇器模塊、計數(shù)模塊、分位電路模塊、數(shù)碼管動態(tài)顯示掃描模塊、數(shù)碼管動態(tài)顯示模塊。按鍵去抖動模塊如圖2-1所示 圖2-1分頻電路模塊如圖2-2所示圖2-2選擇器模塊如圖2-3所示圖2-3計數(shù)模塊如圖2-4所示圖2-4分位電路模塊如圖2-5所示圖2-5數(shù)碼管動態(tài)顯示掃描模塊如圖2-6所示圖2-6數(shù)碼管動態(tài)顯示模塊如圖2-7所示圖2-7電路圖整體設(shè)計如圖2-8所示圖2-8第三章利用QuartusII設(shè)計數(shù)字電子鐘3.1按鍵去抖動模塊按鍵去抖動模塊的元件設(shè)計如圖3-1所示圖3-1按鍵去抖動的VHDL語言設(shè)計如下:library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;use ieee.std_logic_arith.all;entity debounce isport(clk:in std_logic;qcin:in std_logic;qcout:out std_logic);end debounce;architecture behave of bounce istype state is (S0,S1,S2);signal current: state;Beginprocess(clk,qin)begin if(clkevent and clk = 1) thencase current iswhen S0 = qcout = 1;if(qcin = 0) thencurrent = S1;elsecurrent qcout = 1;if(qcin = 0) thencurrent = S2;elsecurrent qcout = 0;if(qcin = 0) thencurrent = S2;elsecurrent qcout = 1;current = S0;end case;end if;end process;end behave;/3.2分頻電路模塊分頻電路模塊元件設(shè)計如圖3-2所示:圖3-2分頻模塊VHDL語言設(shè)計如下:library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;use ieee.std_logic_arith.all;entity clk1kHz isgeneric(N: integer:=50000); port(clk: in std_logic;clk1kHz: out std_logic);end clk1kHz;architecture behave of clk1kHz issignal cnt: integer range 0 to N/2-1; signal temp: std_logic;Begin process(clk) begin if(clkevent and clk=1) then if(cnt=N/2-1) then cnt = 0; temp = NOT temp; else cnt = cnt+1; end if; end if; end process; clk1KHz = temp;end behave;/library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;use ieee.std_logic_arith.all;entity clk1Hz isgeneric(N: integer:=50000000); port(clk: in std_logic;clk1Hz: out std_logic);end clk1Hz;architecture behave of clk1Hz is signal cnt: integer range 0 to N/2-1; signal temp: std_logic;Begin process(clk) begin if(clkevent and clk=1) then if(cnt=N/2-1) then cnt = 0; temp = NOT temp; else cnt = cnt+1; end if; end if; end process; clk1Hz = temp;end behave;/library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;use ieee.std_logic_arith.all;entity clk10Hz isgeneric(N: integer:=20000000); port(clk: in std_logic;clk10Hz: out std_logic);end clk10Hz;architecture behave of clk10Hz issignal cnt: integer range 0 to N/2-1; signal temp: std_logic;Begin process(clk) begin if(clkevent and clk=1) then if(cnt=N/2-1) then cnt = 0; temp = NOT temp; else cnt = cnt+1; end if; end if; end process; clk10Hz = temp;end behave;/3.3選擇器模塊選擇器模塊元件設(shè)計如圖3-3所示:圖3-3選擇器模塊VHDL與顏色合計如下所示:library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity xzq isport(sel: in std_logic;date0,date1:in std_logic;dcout:out std_logic);end xzq;architecture behave of xzqisbeginwith sel selectdcout =date0 when 0, date1 when others;end behave;/3.4計數(shù)模塊計數(shù)模塊元件設(shè)計如圖3-4所示:圖3-4計數(shù)器模塊VHDL語言設(shè)計如下:library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity count60s isport(clk:in std_logic;clk10:in std_logic;set: in std_logic:=1;change: out std_logic;qcout: buffer integer range 0 to 59:=0);end count60s;architecture behave of count60s issignal temp:integer range 0 to 59;signal temp1:std_logic; begin process(clk,set,clk10) begin if(set=0) thentemp = 0; elsif(clkevent and clk=1) then if(qcout=59) thentemp = 0;temp1 = 1; elsetemp = temp+1;temp1 = 0; end if; end if; qcout = temp; change = temp1; end process; end behave;/library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity count60m isport(clk:in std_logic;change: out std_logic;qcout: buffer integer range 0 to 59:=0;set:in std_logic:=1);end count60m;architecture behave of count60m issignal temp:integer range 0 to 59;signal temp1:std_logic; begin process(clk) begin if(clkevent and clk=1) then if(qcout=59) thentemp = 0;temp1 = 1; elsetemp = temp+1;temp1 = 0; end if; end if; qcout = temp; if(set = 1)thenchange = car;end if; end process; end behave;/library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity count24h isport(clk:in std_logic;qcout: buffer integer range 0 to 23:=0);end count24h;architecture behave of count24h issignal temp:integer range 0 to 23; begin process(clk) begin if(clkevent and clk=1)then if(qcout=23) thentemp = 0; elsetemp = temp+1; end if; end if; qcout = temp; end process; end behave;/3.5分位電路模塊分位電路模塊元件設(shè)計如圖3-5所示圖3-5分位電路模塊VHDL語言設(shè)計如下:library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;use ieee.std_logic_arith.all;entity decircuit isport(cnt: in integer range 0 to 59;ge: out integer range 0 to 9;shi: out integer range 0 to 9);end decircuit;architecture behave of decircuit isbegin-fenwei circuitprocess(cnt)variable shi_temp:integer;beginge = cnt mod 10;shi = cnt / 10;end process;end behave;/library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;use ieee.std_logic_arith.all;entity decircuit isport(cnt: in integer range 0 to 59;ge: out integer range 0 to 9;shi: out integer range 0 to 9);end decircuit;architecture behave of decircuit isbeginprocess(cnt)variable shi_temp:integer;beginge = cnt mod 10;shi = cnt / 10;end process;end behave;/library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;use ieee.std_logic_arith.all;entity decircuit2 isport(cnt: in integer range 0 to 23;ge: out integer range 0 to 9;shi: out integer range 0 to 9);end decircuit2;architecture behave of decircuit2 isbegin-fenwei circuitprocess(cnt)variable shi_temp:integer;beginge = cnt mod 10;shi = cnt / 10;end process;end behave;/3.6數(shù)碼管動態(tài)顯示掃描模塊圖3-6元件設(shè)計如圖3-6所示:圖3-6數(shù)碼管動態(tài)顯示掃描模塊VHDL語言設(shè)計如下:library ieee;use ieee.std_logic_1164.al
溫馨提示
- 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)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 2026年內(nèi)蒙古體育職業(yè)學(xué)院單招職業(yè)傾向性測試題庫及1套完整答案詳解
- 2026年南京科技職業(yè)學(xué)院單招職業(yè)傾向性考試題庫附答案詳解(黃金題型)
- 2026年內(nèi)蒙古體育職業(yè)學(xué)院單招職業(yè)適應(yīng)性考試題庫附答案詳解(精練)
- 2026年北海康養(yǎng)職業(yè)學(xué)院單招綜合素質(zhì)考試題庫附參考答案詳解(a卷)
- 2026年華北理工大學(xué)輕工學(xué)院單招職業(yè)傾向性考試題庫附答案詳解(b卷)
- 2026年南京特殊教育師范學(xué)院單招職業(yè)技能考試題庫附答案詳解(綜合卷)
- 2026年內(nèi)蒙古伊克昭盟單招職業(yè)傾向性考試題庫附答案詳解(達(dá)標(biāo)題)
- 2026年南昌理工學(xué)院單招職業(yè)技能考試題庫及答案詳解(真題匯編)
- 2026年蘭州科技職業(yè)學(xué)院單招職業(yè)技能考試題庫附參考答案詳解(典型題)
- 2026年蘭州石化職業(yè)技術(shù)大學(xué)單招職業(yè)技能考試題庫帶答案詳解(綜合卷)
- 2026及未來5年中國抽紗刺繡工藝品行業(yè)競爭現(xiàn)狀及投資前景趨勢報告
- 2025動物防疫專員試題及答案
- 單元復(fù)習(xí):解碼中國-我國區(qū)域差異的深度整合與素養(yǎng)提升
- 心肺復(fù)蘇術(shù)護(hù)理配合要點
- 中醫(yī)特色護(hù)理在精神科的應(yīng)用
- 風(fēng)力發(fā)電運(yùn)輸合同范本
- 重難點22 立體幾何中的外接球、內(nèi)切球問題(舉一反三專項訓(xùn)練)(全國通.用)(原卷版)-2026年高考數(shù)學(xué)一輪復(fù)習(xí)舉一反三系列
- 高二生物DNA的復(fù)制一節(jié)教案(2025-2026學(xué)年)
- 法律合規(guī)風(fēng)險評估檢查表
- 福建省莆田市擢英中學(xué)2026屆九年級英語第一學(xué)期期末聯(lián)考試題含解析
- 小兒急性呼吸衰竭課件
評論
0/150
提交評論