EDA試驗(yàn)-數(shù)字時(shí)鐘實(shí)驗(yàn)報(bào)告_第1頁(yè)
EDA試驗(yàn)-數(shù)字時(shí)鐘實(shí)驗(yàn)報(bào)告_第2頁(yè)
EDA試驗(yàn)-數(shù)字時(shí)鐘實(shí)驗(yàn)報(bào)告_第3頁(yè)
EDA試驗(yàn)-數(shù)字時(shí)鐘實(shí)驗(yàn)報(bào)告_第4頁(yè)
EDA試驗(yàn)-數(shù)字時(shí)鐘實(shí)驗(yàn)報(bào)告_第5頁(yè)
已閱讀5頁(yè),還剩5頁(yè)未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

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

文檔簡(jiǎn)介

EDA試驗(yàn)——數(shù)字時(shí)鐘實(shí)驗(yàn)?zāi)康氖煜ぴ贓DA平臺(tái)上進(jìn)行數(shù)字電路集成設(shè)計(jì)的整個(gè)流程。掌握MaxPlus軟件下的簡(jiǎn)單的圖形、VHDL文本等輸入的設(shè)計(jì)方法。學(xué)習(xí)使用JTAG借口下載邏輯電路到可編程芯片,并能調(diào)試到芯片正常工作。實(shí)驗(yàn)原理本實(shí)驗(yàn)是實(shí)現(xiàn)數(shù)字電子鐘,直接用數(shù)字顯示時(shí)間的計(jì)時(shí)裝置。分別設(shè)計(jì)出時(shí)間設(shè)置電路,走時(shí)電路,打鈴控制電路,顯示電路。三.實(shí)驗(yàn)設(shè)計(jì)(1)在這個(gè)設(shè)計(jì)中我使用VHDL設(shè)計(jì)時(shí)間設(shè)置電路:LIBRARYIEEE;USEIEEE.STD_LOGIC_1164.ALL;USEIEEE.STD_LOGIC_UNSIGNED.ALL;USEIEEE.STD_LOGIC_ARITH.ALL;ENTITYcontrolISPORT(reset:INSTD_LOGIC;begend:INSTD_LOGIC;keyup:INSTD_LOGIC;enter:INSTD_LOGIC;settime:OUTSTD_LOGIC;hourhset:OUThourlset:OUTminhset:OUTminlset:OUTsechset:OUTseclset:OUTENDcontrol;ARCHITECTUREarchiOFcontrolISTYPESTATEIS(sethh,sethl,setmh,setml,setsh,setsl,ini);SIGNALadjsta:STATE;SIGNALsetmark:STD_LOGIC;SIGNALseclow,minlow,hourlow:INTEGERSIGNALsechigh,minhigh:INTEGERSIGNALhourhigh:INTEGERBEGINseclset<=seclow;sechset<=sechigh;minlset<=minlow;minhset<=minhigh;hourlset<=hourlow;hourhset<=hourhigh;settime<=setmark;mark:PROCESS(begend)beginifreset='1'thensetmark<='0';elsifbegend'eventandbegend='1'thenifsetmark='1'then setmark<='0'; else setmark<='1'; endif;endif;ENDPROCESS;normal_run:PROCESS(enter,reset)BEGINIFreset='1'THENadjsta<=ini;ELSIFenter='1'ANDenter'eventTHENcaseadjstaISWHENini=>adjsta<=sethh;WHENsethh=>adjsta<=sethl;WHENsethl=>adjsta<=setmh;WHENsetmh=>adjsta<=setml;WHENsetml=>adjsta<=setsh;WHENsetsh=>adjsta<=setsl;WHENsetsl=>adjsta<=sethh;endcase;ENDIF;ENDPROCESS;time_adjust:PROCESS(keyup)BEGINifreset='1'then hourhigh<=0; hourlow<=0; minhigh<=0; minlow<=0; sechigh<=0; seclow<=0; elsifkeyup='1'ANDkeyup'eventTHEN caseadjstaIS WHENsethh=> hourhigh<=hourhigh+1; WHENsethl=> hourlow<=hourlow+1; WHENsetmh=> minhigh<=minhigh+1; WHENsetml=> minlow<=minlow+1; WHENsetsh=> sechigh<=sechigh+1; WHENsetsl=> seclow<=seclow+1; WHENini=>NULL; endcase; endif;ENDPROCESS;ENDarchi;走時(shí)電路:libraryieee;useieee.std_logic_1164.all;useieee.std_logic_unsigned.all;useieee.std_logic_arith.all;entityclockisport(clk:instd_logic; settime:instd_logic; hourhset:inintegerrange0to2; hourlset:inintegerrange0to9; minhset:inintegerrange0to5; minlset:inintegerrange0to9; sechset:inintegerrange0to5; seclset:inintegerrange0to9; hourhdis:outintegerrange0to2; hourldis:outintegerrange0to9; minhdis:outintegerrange0to5; minldis:outintegerrange0to9; sechdis:outintegerrange0to5; secldis:outintegerrange0to9);endclock;architecturearchiofclockis signalseclow,minlow,hourlow:integerrange0to9; signalsechigh,minhigh:integerrange0to5; signalhourhigh:integerrange0to2;begin secldis<=seclow; sechdis<=sechigh; minldis<=minlow; minhdis<=minhigh; hourldis<=hourlow; hourhdis<=hourhigh;normal_run: process(clk,settime) begin ifsettime='1'then seclow<=seclset; sechigh<=sechset; minlow<=minlset; minhigh<=minhset; hourlow<=hourlset; hourhigh<=hourhset; else ifclk='1'andclk'eventthen ifseclow=9thenseclow<=0; ifsechigh=5thensechigh<=0; ifminlow=9thenminlow<=0; ifminhigh=5thenminhigh<=0; ifhourlow=9then hourlow<=0; hourhigh<=hourhigh+1; elsifhourlow=3andhourhigh=2then hourhigh<=0; hourlow<=0; elsehourlow<=hourlow+1; endif; elseminhigh<=minhigh+1; endif; elseminlow<=minlow+1; endif; elsesechigh<=sechigh+1; endif; elseseclow<=seclow+1; endif; endif; endif; endprocess;endarchi;打鈴控制電路:libraryieee;useieee.std_logic_1164.all;useieee.std_logic_unsigned.all;useieee.std_logic_arith.all;entityringisport(reset:instd_logic; alarm:outstd_logic; hourhdis:inintegerrange0to2; hourldis:inintegerrange0to9; minhdis:inintegerrange0to5; minldis:inintegerrange0to9; sechdis:inintegerrange0to5; secldis:inintegerrange0to9);endring;architecturearchiofringis constantre:integer:=2; constantstop:integer:=50;signalcnt:integerrange0to60;begin process(secldis) begin cnt<=sechdis*10+secldis; ifreset='1'thenalarm<='0'; elsif(minhdis=5andminldis=9)then ifcnt>stopandcnt<re+stopthenalarm<='0'; elsifcnt>re+stopandcnt<re*2+stopthenalarm<='1'; elsifcnt>2*re+stopandcnt<4*re+stopthenalarm<='0'; elsealarm<='1'; endif; elsealarm<='0'; endif; endprocess;endarchi;顯示電路:libraryieee;useieee.std_logic_1164.all;useieee.std_logic_unsigned.all;useieee.std_logic_arith.all;entityringisport(reset:instd_logic; alarm:outstd_logic; hourhdis:inintegerrange0to2; hourldis:inintegerrange0to9; minhdis:inintegerrange0to5; minldis:inintegerrange0to9; sechdis:inintegerrange0to5; secldis:inintegerrange0to9);endring;architecturearchiofringis constantre:integer:=2; constantstop:integer:=50;signalcnt:integerrange0to60;begin process(secldis) begin cnt<=sechdis*10+secldis; ifreset='1'thenalarm<='0'; elsif(minhdis=5andminldis=9)then ifcnt>stopandcnt<re+stopthenalarm<='0'; elsifcnt>re+stopandcnt<re*2+stopthenalarm<='1'; elsifcnt>2*re+stopandcnt<4*re+stopthenalarm<='0'; elsealarm<='1'; endif; elsealarm<='0'; endif; endprocess;endarchi;

溫馨提示

  • 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ù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 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ì)自己和他人造成任何形式的傷害或損失。

最新文檔

評(píng)論

0/150

提交評(píng)論