




全文預(yù)覽已結(jié)束
下載本文檔
版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
EDA課程設(shè)計(jì)(電子鐘的設(shè)計(jì))姓名:劉峰語學(xué)號(hào):200820303110指導(dǎo)老師:謝斌同組人員:熊成、楊彬彬系別:自動(dòng)化工程系專業(yè):08級(jí)測(cè)控技術(shù)與儀器一設(shè)計(jì)要求:1.能實(shí)現(xiàn)時(shí),分,秒計(jì)時(shí)。2.能實(shí)現(xiàn)整電報(bào)時(shí)。3.能進(jìn)行對(duì)時(shí)和分的校準(zhǔn)。二實(shí)驗(yàn)?zāi)康模?.掌握多位計(jì)數(shù)器相連的方法。2.掌握十六進(jìn)制,二十四進(jìn)制,六十進(jìn)制計(jì)數(shù)器的設(shè)計(jì)方法。3.握CPLD技術(shù)的層次化設(shè)計(jì)法。4.了解軟件的元件管理含義以及模塊元件之間的連接概念。5.掌握電子電路一般的設(shè)計(jì)方法,并了解電子產(chǎn)品的研制開發(fā)過程,基本掌握電子電路安裝和調(diào)試方法。6.培養(yǎng)獨(dú)立分析問題,團(tuán)結(jié)解決問題的能力。三硬件要求:1. 8位8段掃描共陰極數(shù)碼顯示管。2. 三個(gè)按鍵開關(guān)(清零,校時(shí),校分)。四設(shè)計(jì)原理1.數(shù)字鐘的計(jì)時(shí)周期為24小時(shí),顯示滿刻度為23時(shí)59分59秒,另外具備校時(shí)功能和報(bào)時(shí)功能。因此,一個(gè)基本的數(shù)字鐘主要由“時(shí)”“分”“秒”計(jì)數(shù)器校時(shí)電路組成。將標(biāo)準(zhǔn)信號(hào)送入“秒計(jì)數(shù)器”,“秒計(jì)數(shù)器”采用60進(jìn)制計(jì)數(shù)器,每累加60 秒發(fā)送一個(gè)“分脈沖”信號(hào),該信號(hào)將被送到“時(shí)計(jì)數(shù)器”,“時(shí)計(jì)數(shù)器”采用24進(jìn)制計(jì)數(shù)器,可實(shí)現(xiàn)對(duì)一天24 小時(shí)的累計(jì)。譯碼顯示電路將“時(shí)”“分”“秒”計(jì)數(shù)器的輸出狀態(tài)六段顯示譯碼器譯碼。通過六位LED七段顯示器顯示出來2.校時(shí)電路是用來對(duì)“時(shí)”“分”顯示數(shù)字進(jìn)行校時(shí)調(diào)整的。3.頂層原理圖如下:圖1 頂層文件原理圖時(shí)序仿真:程序仿真主要由計(jì)數(shù)器完成,在時(shí)鐘脈沖作用下,完成始終功能,由時(shí)序圖可以看出每個(gè)時(shí)鐘上升沿到來時(shí)加一,當(dāng)接受到REST信號(hào),即REST為高電平,所有計(jì)數(shù)為零,并重新計(jì)數(shù),SETMIN 和SETHOUR可以完成調(diào)節(jié)時(shí)鐘功能,都是高電平調(diào)節(jié),每來一個(gè)脈沖,相應(yīng)的時(shí)或分加1。圖2 時(shí)序仿真五電子時(shí)鐘模塊設(shè)計(jì)1. 分頻模塊FENPIN設(shè)計(jì)模塊FENPIN原理圖如下:圖3 FENPIN原理圖FENPIN源程序library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity FENP isport(clk1:in std_logic;clk:out std_logic);end;architecture one of FENP issignal a:std_logic_vector(8 downto 0);signal b,c:std_logic;beginprocess(clk1)beginif clk1event and clk1=1 thenif a=100000000 thenb=1;a=000000000;elsea=a+1;b=0;end if;end if;end process;clk=b;end;仿真波形如下:圖4 FENPIN 波形圖2. 模塊MIAO1設(shè)計(jì)模塊MIAO1原理圖如下,CLK和RESET控制DAOUT,SETIME和CLK控制ENMIN圖5 SECOND的原理圖MIAO1 的源程序如下library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity miao1 isport (clk,reset,setmin: in std_logic;daout: out std_logic_vector(6 downto 0);enmin:buffer std_logic);end;architecture two of miao1 issignal d:std_logic_vector(6 downto 0);signal enmin1,enmin2:std_logic;beginprocess(clk,reset,setmin)beginif reset=1then d=0000000;elsif (clkevent and clk=1) thenif d16#60# thenif d=1011001 thend=0000000;enmin1=1;else d=d+1;enmin1=0;if d(3 downto 0)=1001 then d=d+7;end if;end if;end if; end if; end process;daout=d;enmin=(enmin1 or enmin2);enmin2=(setmin and clk);end;波形仿真圖如下圖1-4 MIAO1 的波形仿真3. 模塊FENZ設(shè)計(jì)模塊FENZ原理圖如下,CLK和RESET控制DAOUT,SEHOUR控制ENHOUR圖6 MIN的原理圖FENZ的源程序如下library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity fenz isport (reset,clk,sethour,clk1: in std_logic;daout: out std_logic_vector(6 downto 0);enhour:buffer std_logic);end;architecture two of fenz issignal d:std_logic_vector(6 downto 0);signal enhour1,enhour2:std_logic;beginprocess(clk,clk1,reset,sethour)beginif reset=1then d=0000000;elsif (clkevent and clk=1) thenif d16#60# thenif d=1011001 thend=0000000;enhour1=1;else d=d+1;enhour1=0;if d(3 downto 0)=1001 then d=d+7;end if;end if;end if; end if; end process;daout=d;enhour=(enhour1 or enhour2);enhour2=(sethour and clk1);end;波形仿真圖如下圖7 FENZ 的波形仿真4. 模塊HOUR設(shè)計(jì)模塊HOUR原理圖如下,CLK和RESET控制DAOUT。圖8 HOUR的原理圖HOUR的源程序如下library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity hour isport (reset,clk: in std_logic;daout: out std_logic_vector (5 downto 0);end;architecture two of hour issignal d:std_logic_vector(5 downto 0);beginprocess(clk,reset)beginif reset=1then d=000000;elsif (clkevent and clk=1) thenif d16#60# thenif d=100011 thend=000000;else d=d+1; if d(3 downto 0)=1001 then d=d+7;end if;end if;end if; end if; end process;daout=d;end;波形仿真圖如下 圖9 HOUR 的波形仿真5. 模塊XIANS設(shè)計(jì)模塊XIANS原理圖如下,當(dāng)SEL取不同值時(shí)DAOUT分別選擇輸出SEC .MIN .HOUR圖10 SELTIME的原理圖XIANS的源程序如下library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity xians isport(clk2,reset:in std_logic;miao1,fenz:in std_logic_vector(6 downto 0);hour :in std_logic_vector(5 downto 0);daout:out std_logic_vector(3 downto 0);sel:out std_logic_vector(2 downto 0);end;architecture one of xians issignal q: std_logic_vector(2 downto 0);beginprocess(clk2,reset,miao1,fenz,hour)beginif reset=1thenq=000;elsif (clk2event and clk2=1) then q=q+1;end if;end process;process(q,reset)beginif reset=1thendaoutdaoutdaout(2 downto 0)=miao1(6 downto 4);daout(3)daoutdaout(2 downto 0)=fenz(6 downto 4);daout(3)daoutdaout(1 downto 0)=hour(5 downto 4);daout(3 downto 2)null;end case; end if; end process;selddddddnull;end case; end process;process(d)begincase d iswhen 0000=yyyyyyyyyynull;end case;end process;end;仿真波形如下:圖13 QIDUAN的波形圖7模塊BAOS設(shè)計(jì)BAOS原理圖如下,當(dāng)DAIN為0的時(shí)候SPEAK發(fā)聲,在這段發(fā)聲時(shí)間內(nèi)LAMP的三個(gè)燈相繼點(diǎn)亮。圖14 BAOS原理圖BAOS源程序如下:library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity baos isport (clk: in std_logic;dain: in std_logic_vector(6 downto 0);speak:out std_logic;camp:out std_logic_vector(2 downto 0);end;architecture two of baos issignal a:std_logic_vector( 2 downto 0);beginprocess(clk)beginif (clkevent and clk=1) thenif dain=0000000 thena camp camp camp camp=000;end case;end if;end if;end process;process(clk)beginif (clkevent and clk=1) thenif dain=0000000 thenspeak=1;else speak=0;end if; end if; end process; end;仿真波形如下:圖15 BAOS波形圖實(shí)驗(yàn)總結(jié):一 自己對(duì)原理圖的修正1 如果將FENZ中的始終脈沖輸入端CLK1接到second的輸入端enmin上,則導(dǎo)致在時(shí)間校正上出現(xiàn)了問題,即:要等到六十秒才能加一,這樣就導(dǎo)致校正時(shí)間的延長(zhǎng)。2 如果將FENZ中的時(shí)鐘脈沖輸入端CLK接到CLK1上二 交通燈設(shè)計(jì)設(shè)計(jì)說明:現(xiàn)代,在城市的交通繁忙的交叉路口,行人比較多的路口,或?qū)W校附近都設(shè)有許多的紅綠交通燈。它指示著行人、車輛有序的通行。其中,紅燈停,綠燈行,黃燈表警示。在燈的旁邊還有數(shù)字晶體顯示器,用于提示行人、司機(jī)三種顏色的燈即將跳轉(zhuǎn)所剩的時(shí)間,讓其做好應(yīng)有的準(zhǔn)備。一 計(jì)要求:1 在十字路口的方向上各設(shè)一組紅綠黃燈,顯示順序?yàn)椋浩渲幸粋€(gè)方向是綠燈、黃燈、紅燈,另外一個(gè)方向是紅燈、綠燈、黃燈。2 設(shè)置4個(gè)數(shù)碼管,以倒計(jì)時(shí)的方式顯示允許通過或禁止的時(shí)間,其中綠燈、黃燈、紅燈的持續(xù)時(shí)間分別是30秒、5秒、35秒。二 設(shè)計(jì)原理圖圖1-1狀態(tài)轉(zhuǎn)換圖三、頂層原理圖圖1-2 頂層原理圖波形仿真圖如下:圖1-3交通燈仿真波形四、通燈控制器的各模塊設(shè)計(jì)1、模塊CNT8設(shè)計(jì)模塊FENPIN如下圖,該模塊的功能是將時(shí)間256分頻,得到占空比為1:256的方波。圖1-4 CNT8頂層圖分頻器CNT8的源程序:library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity CNT8 isport ( clk : in std_logic;d: out std_logic;sel: buffer std_logic_vector(2 downto 0);end;architecture one of CNT8 issignal a : std_logic_vector(7 downto 0);beginprocess(clk)beginif clk event and clk =1 then a=a+1;sel=sel+1;end if; end process;d=a(7);end;波形仿真如下:圖1-5 CNT8波形仿真圖2、模塊JTD設(shè)計(jì)如圖1-2,該模塊為整個(gè)程序的核心,它實(shí)現(xiàn)東西和南北方向的三種交通燈顏色的交替點(diǎn)亮、時(shí)間的倒計(jì)時(shí)。圖1-6 JTD頂層圖JTD源程序:library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity JTD isport(clk,clr:in std_logic;ge,shi:buffer std_logic_vector(3 downto 0);dx,nb:buffer std_logic_vector(2 downto 0);end;architecture q of JTD istype w is(a,b,c,d);signal zhuangtai:w;beginprocess(clk,clr,zhuangtai)beginif clr=1 thendx=010;nb=100;ge=0101;shidx=100;nb=001;if ge=0000 thenif shi=0000 thenzhuangtai=c
溫馨提示
- 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ì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 微電網(wǎng)發(fā)電機(jī)組與儲(chǔ)能系統(tǒng)的多目標(biāo)優(yōu)化設(shè)計(jì)考核試卷
- 投標(biāo)文件編制中的成本控制要點(diǎn)考核試卷
- 廢料處理技術(shù)創(chuàng)新與應(yīng)用考核試卷
- 農(nóng)村土地租賃合同中的租賃物保險(xiǎn)制度解析考核試卷
- 2025年中國PP聚丙烯塑料漆數(shù)據(jù)監(jiān)測(cè)報(bào)告
- 2025年中國PB地板采暖管數(shù)據(jù)監(jiān)測(cè)報(bào)告
- 2025年中國COD消解加熱器數(shù)據(jù)監(jiān)測(cè)研究報(bào)告
- 2025年中國3-辛酮數(shù)據(jù)監(jiān)測(cè)報(bào)告
- 高支模板工程培訓(xùn)
- 2025至2030年中國食堂自動(dòng)售飯結(jié)算系統(tǒng)市場(chǎng)分析及競(jìng)爭(zhēng)策略研究報(bào)告
- NIH-FDA-IND-IDE-II期III期臨床試驗(yàn)方案模板
- 2025春季學(xué)期國開電大??啤缎姓M織學(xué)》一平臺(tái)在線形考(形考任務(wù)1至5)試題及答案
- 腫瘤患者全程健康管理
- T-CNAS 18-2020 成人住院患者跌倒風(fēng)險(xiǎn)評(píng)估及預(yù)防
- 腹股溝疝嵌頓病人的護(hù)理
- 《特種設(shè)備重大隱患判定標(biāo)準(zhǔn)(陜西省)》解讀與培訓(xùn)
- 《收益法在無形資產(chǎn)價(jià)值評(píng)估中的應(yīng)用案例分析:以M生物公司為例》8900字(論文)
- 重慶市森林資源二類調(diào)查操作細(xì)則2012年
- IEC31010-2019風(fēng)險(xiǎn)管理 風(fēng)險(xiǎn)評(píng)估技術(shù)(雷澤佳譯-2024)
- 新生兒黃疸的護(hù)理常規(guī)
- ISOIEC38507-2022信息技術(shù)-IT治理-組織使用人工智能的治理影響(中文版-雷澤佳譯2024)
評(píng)論
0/150
提交評(píng)論