《eda專周程序》word版

《eda專周程序》word版

ID:22909231

大小:75.00 KB

頁數(shù):12頁

時間:2018-11-01

《eda專周程序》word版_第1頁
《eda專周程序》word版_第2頁
《eda專周程序》word版_第3頁
《eda專周程序》word版_第4頁
《eda專周程序》word版_第5頁
資源描述:

《《eda專周程序》word版》由會員上傳分享,免費在線閱讀,更多相關(guān)內(nèi)容在應(yīng)用文檔-天天文庫

1、libraryieee;useieee.std_logic_1164.all;useieee.std_logic_unsigned.all;entitydianzzisport(clk,clrm,stop:instd_logic;----時鐘/清零信號secm1,secm0:outstd_logic_vector(3downto0);----秒高位/低位co:outstd_logic);-------輸出/進(jìn)位信號enddianzz;architectureSECofdianzzissignalclk1,DOUT2:std_logic;beginproc

2、ess(clk,clrm)variablecnt1,cnt0:std_logic_vector(3downto0);---計數(shù)VARIABLECOUNT2:INTEGERRANGE0TO10;beginIFCLK'EVENTANDCLK='1'THENIFCOUNT2>=0ANDCOUNT2<10THENCOUNT2:=COUNT2+1;ELSECOUNT2:=0;DOUT2<=NOTDOUT2;ENDIF;ENDIF;ifclrm='1'then----當(dāng)clr為1時,高低位均為0cnt1:="0000";cnt0:="0000";elsifclk'e

3、ventandclk='1'thenifstop='1'thencnt0:=cnt0;cnt1:=cnt1;endif;ifcnt1="1001"andcnt0="1000"then----當(dāng)記數(shù)為98(實際是經(jīng)過59個記時脈沖)co<='1';----進(jìn)位cnt0:="1001";----低位為9elsifcnt0<"1001"then----小于9時cnt0:=cnt0+1;----計數(shù)--elsifcnt0="1001"then--clk1<=notclk1;elsecnt0:="0000";ifcnt1<"1001"then----高位小于9時c

4、nt1:=cnt1+1;elsecnt1:="0000";co<='0';endif;endif;endif;secm1<=cnt1;secm0<=cnt0;endprocess;endSEC;libraryieee;useieee.std_logic_1164.all;useieee.std_logic_unsigned.all;entitySECONDisport(clk,clr:instd_logic;----時鐘/清零信號sec1,sec0:outstd_logic_vector(3downto0);----秒高位/低位co:outstd_log

5、ic);-------輸出/進(jìn)位信號endSECOND;architectureSECofSECONDisbeginprocess(clk,clr)variablecnt1,cnt0:std_logic_vector(3downto0);---計數(shù)beginifclr='1'then----當(dāng)ckr為1時,高低位均為0cnt1:="0000";cnt0:="0000";elsifclk'eventandclk='1'thenifcnt1="0101"andcnt0="1000"then----當(dāng)記數(shù)為58(實際是經(jīng)過59個記時脈沖)co<='1';---

6、-進(jìn)位cnt0:="1001";----低位為9elsifcnt0<"1001"then----小于9時cnt0:=cnt0+1;----計數(shù)elsecnt0:="0000";ifcnt1<"0101"then----高位小于5時cnt1:=cnt1+1;elsecnt1:="0000";co<='0';endif;endif;endif;sec1<=cnt1;sec0<=cnt0;endprocess;endSEC;libraryieee;useieee.std_logic_1164.all;useieee.std_logic_unsigned.all

7、;entityMINUTEisport(clk,en:instd_logic;min1,min0:outstd_logic_vector(3downto0);co:outstd_logic);endMINUTE;architectureMINofMINUTEisbeginprocess(clk)variablecnt1,cnt0:std_logic_vector(3downto0);beginifclk'eventandclk='1'thenifen='1'thenifcnt1="0101"andcnt0="1000"thenco<='1';cnt0:=

8、"1001";elsifcnt0<"1001"thencnt0:=cnt0+1;

當(dāng)前文檔最多預(yù)覽五頁,下載文檔查看全文

此文檔下載收益歸作者所有

當(dāng)前文檔最多預(yù)覽五頁,下載文檔查看全文
溫馨提示:
1. 部分包含數(shù)學(xué)公式或PPT動畫的文件,查看預(yù)覽時可能會顯示錯亂或異常,文件下載后無此問題,請放心下載。
2. 本文檔由用戶上傳,版權(quán)歸屬用戶,天天文庫負(fù)責(zé)整理代發(fā)布。如果您對本文檔版權(quán)有爭議請及時聯(lián)系客服。
3. 下載前請仔細(xì)閱讀文檔內(nèi)容,確認(rèn)文檔內(nèi)容符合您的需求后進(jìn)行下載,若出現(xiàn)內(nèi)容與標(biāo)題不符可向本站投訴處理。
4. 下載文檔時可能由于網(wǎng)絡(luò)波動等原因無法下載或下載錯誤,付費完成后未能成功下載的用戶請聯(lián)系客服處理。