VHDL源代碼-計(jì)數(shù)器_第1頁(yè)
VHDL源代碼-計(jì)數(shù)器_第2頁(yè)
VHDL源代碼-計(jì)數(shù)器_第3頁(yè)
VHDL源代碼-計(jì)數(shù)器_第4頁(yè)
VHDL源代碼-計(jì)數(shù)器_第5頁(yè)
已閱讀5頁(yè),還剩13頁(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)介

1、十五計(jì)數(shù)器library iccc;use iccc.std_logic_l 164.aU;use iccc.std_logic_unsigiicd.all;ENTITY fivctccncout ISP()RT(clk,rcsctenable : IN sid_k)gic; count: OUT std_logic_vcct(>r(3 downt。0); END fivctccncout;ARCHITECTURE counter OF fivciccncoui ISSIGNAL c()unt_int:std_l()gic_vcct<)r(O to 3);BEGINPRQCESS(

2、clkjusut)BEGINWAIT UNTIL rising_cdgt(clk);IF reset = *r THENcountjnt <= (OTHERS =>,0);ELSIF cihiblc = T THENIF(countJnt=H1110H) THEN c()untJnt<=MOOOOt,;ELSEcount int <= count ini 1;-ELSE一NULL;-IF (c()untJnt=H100r,) THEN-coiintJnt<=H00()0n;END IF;END IF;END PROCESS;count <= coiint_i

3、nt;IF (rcsct=*O,) then-q<=H0000H;-ELSlFCclVcvcnt and clk='l) THEN-M<=q 1;-IF(q<=H100r,) then-q<=H0000H;END IF;-IF (rcsct<=rr)THEN-qV="OO”;-ELSIF-wail until (clkvcnt and clk=*lt);-WAIT UNTIL (dk'EVENT AND elk = T);-WAIT UNTIL ©ock'EVENT AND dock = '1);-qV=qT;e

4、nd if;- count<=q;- -WAIT UNTIL clock = ,V;- if (clock'cvunt and clock-T) then- WAIT UNTIL rising_cdge(clock);- clock-ciii and clock=,r;- count <= 0;- WAIT UNTIL (dockEVENT AND clock = '1);- WAIT riscedge clock = T;if (clock'cvuni and clock=,r)then- WAIT UNTIL rising_cdgr(clock);- c

5、ount <= 1;- WAIT UNTIL (clockEVENT AND clock = '1);- WAIT UNTIL clock = T;- if (clockevent and clock=,r)thcn- WAIT UNTIL rising_cdge(clock);- count <= 2;- end if;- end if;- end if;- -END PROCESS;END counter;十四計(jì)數(shù)器library icee;use iccc.std_logic_l 164.all;use iccc.std_logic_unsigiicd.all;ENT

6、lTr fourtcencout ISPORT(elk,rcsc tenable : IN std_logic; count: OUT s td_k)gic_vcc u)r (3 down to 0); END f()urtccnc()ut;ARCHITECTURE counter OF fourtcencout ISSIGNAL c()unt_int:stdJ()gic_vect()r(0 to 3);BEGINPRQCESS(clkjusut)BEGINWAIT UNTIL rising_cdgt(clk);IF reset = fr THENcountjnt <= (OTHERS

7、=> U);ELSIF unable = T THENIF(countJnt=H110r,) THENcouniJnt<=,0000M;ELSEcount int <= count int 1;-ELSE- -NULL;- IF (countJni=,t1001H) THEN-c()untJni<=H0000H;END IF;END IF;ENP PROCESS; count <= c()iint_int;-IF (rcsct=V) then-q<=H0000H;ELSIF(clk*cvcnt and clk='l) THEN-qV=q 1;-IF(

8、q<=H100r,) then-qv 廿 o(x)(r;-END IF;-IF (rcsct<=tr)THEN-q<=W;-ELS1Fwait until (clk*cvcnt and clk=,lt);-WAIT UNTIL (clktEVENT AND elk =);- WAIT UNTIL (clock'EVENT AND clock = U1);-qV=qT;- end if;- c()iint<=q;- -WAIT UNTIL clock = T;- if (clcck'cvuni; and clock=,r)thcn- WAIT UNTIL

9、rising_cdgt(clock);-clock'evuni: and clock=*r;- count <= 0;- WAIT UNTIL (clockVENT AND clock = '1);- WAIT riscedge clock = T;- if (clockrevcnt and clock=,r)then- WAIT UNTIL rising_cdge(clock);- count <= 1;- WAIT UNTIL (clockVENT AND clock = '1);- WAIT UNTIL clock = T;- if (clcck

10、9;rvuiii and clock-11)then- WAIT UNTIL rising_cdge(clock);- count <= 2;- end if;- end if;- end if;- -END PROCESS;END counter;十三計(jì)數(shù)器library iccc;use iccc.std_logical 164.all;use iccc.std_logic_unsigiicd.all;ENTITr thirctcciicout ISP()RT(clk,rcsct,cnablc : IN sldogic; count: OUT s td_l()gic_vcc t<

11、; >r(3 down to 0);END thirctccncout;ARCHITECTURE counter OF thirctccncout ISSIGNAL c<>unt_int:std_l(>gic_vcct()r(0 to 3);BEGINPROCESSCclk.rcsct)BEGINWAIT UNTIL rising_cdgc(clk);IF reset = T THEN counijnt <= (OTHERS => U); ELSIF mablu = T THENIF(couiiiJnt=HI100H) THEN c()unijnt<=

12、"0000”;ELSEcount int <= count int 1;-ELSE一NULL;-IF (countJmlOOr1) THEN-coiintJnK="0000”;END IF;END IF;END PROCESS;count <= c()iint_int;- IF (rcsct=,0,) then -q<=H0000H;ELSIFCclkvcnt and clk=L) THEN- -qV=q 1;-IF(q<=H100r,) then-qV="000(T;- END IF;-IF (rcset<=,r)THEN_qV 廿

13、 00”;-ELSIF- wail until (clkvcnt and clk=,lt);- WAIT UNTIL (clktEVENT AND elk = T);- WAIT UNTIL (clockVENT AND clock = '1);- q<=q*r;- end if;- count<=q;-WAIT UNTIL clock = ,V;if (clock'cvunt and cl)ck=T)thun-WAIT UNTIL rising_cdge(clock);-clock-ciit and clock=,r;- count <= 0;- WAIT

14、UNTIL (clockVENT AND clock = '1);- WAIT risccdge clock = T;-if (clcck'cvuni; and clock=,r)then- WAIT UNTIL rising_cdgt(clock);- count <= 1;- WAIT UNTIL (clockEVENT AND clock = '1);- WAIT UNTIL clock = T;- if (clock'rvunt and clock-T)then- WAIT UNTIL rising_cdge(clock);- count <

15、= 2;- end if;- end if;- end if;- -END PROCESS;END counter;十二計(jì)數(shù)器library icee;use iccc.std_logic_l 164.all;use iccc.std_logic_unsigiicd.all;ENTITY7 iwclvccout ISPORT(elk,rcsd;cnablc : IN std_k>gic; count: OUT sld_l()gic_vcct(>r(3 downto 0);END clvccout;ARCHITECTURE counter OF clvccout ISSIGNAL c

16、()unt_int:std_k)gic_vcct<)r(O to 3);BEGINPRQCESS(clkjusut)BEGINWAIT UNTIL rising_cdgt(clk);IF reset = T THENcountjnt <= (OTHERS => '0');ELSI F enable = 11, TH EXIF(c()uiiiJni=H10ir,) THEN couiitjnt<="0000”;ELSEcount int <= count int 1;-ELSE一 NULL;- IF (countjnt=n100r,) TH

17、EN-()iiniJni<=,0000H;END IF;END IF;END PROCESS;count <= coiint_int;- IF (rcsct=,01) thenrv="ooo(r;-ELSIF(dk'uvunt and clk='l) THEN- qV=q 1;-IF(q<=H100r,) thenrv="ooo(r;- -END IF;-IF (rcset<=T)THEN-qV=“00”;-ELSIF- wait until (clk*cvcnt and clk=*1t);- WAIT UNTIL (dk*EVENT

18、 AND elk = 'I1);- WAIT UNTIL (clockVENT AND clock = '1);-qV=qT;- end if;- coiint<=q;- -WAIT UNTIL clock = T;- if (clcck'rvunt and clock-11)then- WAIT UNTIL rising_cdgc(cl()ck);- clock-ciit and clock=,r;- count <= 0;- WAIT UNTIL (clockVENT AND clock = '1);- WAIT riscedge clock =

19、 T;- -if (clock'cvunt and clock-T) then- WAIT UNTIL rising_cdgc(clock);- count <= 1;- WAIT UNTIL (clockVENT AND clock = '1);- WAIT UNTIL clock = T;- if (clcck'cvuni; and clock=,r)thcn- WAIT UNTIL rising_cdgt(clock);- count <= 2;- end if;- end if;- end if;- -END PROCESS;END counter;

20、十一計(jì)數(shù)器library iccc;use iccc.std_logical 164.all;use iccc.std_logic_uilsigiicd.all;ENTITY ulcvuncoui ISP()RT(clk,rcsct,cnablc : IN std_logic; count: OUT s td_k)gic_vcc t( >r (3 down to 0); END clc'Ciicout;ARCHITECTURE counter OF devseout ISSIGNAL c()uni_int:stdJ()gic_vcct()r(O to 3);BEGINPROCES

21、S(clk,reset)BEGINWAIT UNTIL rising_cdgc(clk);IF reset = T THENcountjnt <= (OTHERS => W);ELSIF mablu = T THENIF(couiitJnt=H1010H) THEN co unt_inK="0000”;ELSE count int <= count int 1;-ELSE- -NULL;- IF (countjni=n100rr) THEN-c(nintJnt<=HOOOOH;ENP1F;END IF;END PROCESS;count <= coiin

22、tjnt;- -IF (rcsct=V) then_qv="ooo(r;ELSIF(clklcvciit and clk='l) THEN- -qV=q 1;-IF(q<=H100r,) then_qv="ooo(r;- END IF;-IF (rcset<=,lt)THEN-ELSIF- wait until (clkfcvcnt and clk=,lt);- WAIT UNTIL ©k'EVENT AND elk = T);- WAIT UNTIL (clockEVENT AND clock = '1);-qV=qT;- e

23、nd if;- count<=q;- -WAIT UNTIL clock = T;- if (clock'cvunt and clock-T)then- WAIT UNTIL rising_cdgc(clock);- clock-ciii and clocks T;- count <= 0;- WAIT UNTIL ©ock'EVENT AND clock = '1);- WAIT riscedge clock = T;- if (clockfevcnt and clock-T) then- WAIT UNTIL rising_cdge(clock

24、);- count <= 1;- WAIT UNTIL (clockVENT AND clock = '1);- WAIT UNTIL clock = T;-if (clcck'cvuni; and clock=,r)thcn- WAIT UNTIL rising_cdge(clock);- count <= 2;- end if;- end if;- end if;- -END PROCESS;END counter;十計(jì)數(shù)器library iccc;use iccc.std_logic_l 164.all;use iccc.std_logic_unsigiicd

25、.all;ENTIT17 count ISP()RT(clk,rcsct,cnablc : IN std_k)gic; count: OUT std_l()gic_vcct(>r(3 downt。0); END count;ARCHITECTURE counter OF count ISSIGNAL c()uni_int:stdJ()gic_vcct()r(O to 3);BEGINPROCESS(clk,reset)BEGINWAIT UNTIL rising_cdgt(clk);IF reset = T THENcounijnt <= (OTHERS => U);ELSI

26、F cihiblc = T THENlF(couiitJnt=H100r,) THEN co unt_int<="0000”;ELSEcount int <= count int 1;-ELSE一 NULL;- IF (countjni=,t100r,) THEN-c()uniJnt<=H0000H;END IF;END IF;END PROCESS;count <= coiint_int;-IF (rcsct=*O*) then-q<=H0000H;-ELSlFCclkvcnt and clk='l) THEN-M<=q 1;-IF(q&

27、lt;=H100r,) then-qV 廿 ooo(r;-END IF;-IF (rcsct<=llt)THEN-qV=“00”;-ELSIF-wait until (clkvcnt and c)k=*lt);-WAIT UNTIL (clk'EVENT AND elk = '1%- WAIT UNTIL (dockEVENT AND clock = '1);- q<=q,V;- end if;- coiint<=q;- -WAIT UNTIL clock = ,1,;if (clock'cvunt and clock-T)then- WAIT

28、 UNTIL rising_cdge(clock);- clock-ciit and cl()ck=,r;- count <= 0;- WAIT UNTIL ©ock'EVENT AND clock = '1);- WAIT risccdgc clock = T;- if (clockevent and clock=,I1) then- WAIT UNTIL rising_cdge(clock);- count <= 1;- WAIT UNTIL ©ock'EVENT AND clock = '1);- WAIT UNTIL cl

29、ock = T;- if (clockfevcnt and clock-T) then- WAIT UNTIL rising_cdge(clock);- count <= 2;- end if;- end if;- end if;一 END PROCESS;END counter;九計(jì)數(shù)器library iccc;use iccc.std_logic_l 164.all;use iccc.std_l()gic_unsigiicd.all;ENTITY7 ninccoui ISPC )RT(clk,reset,enable : IN stdogic; count: OUT std_logi

30、c_vcct(>r(3 down to 0); END ninecout;ARCHITECTURE counter OF ninecout ISSIGNAL c()uiit_int:stdJ()gic_vcct()r(O to 3);BEGINPROCESS(clk,rcset)BEGINWAIT UNTIL rising_cdgc(clk);IF reset = T THENcountjnt <= (OTHERS => U);ELSIF mablu = T THENIF(ccum_int=1000")THENcouni_int<=,0000M;ELSEcou

31、nt int <= count int 1;-ELSE一NULL;-IF (countjni=,1100r,) THEN-c()untJni<=H0000n;END IF;END IF;END PROCESS;count <= coiint_int;-IF (rcsct=*0*) then-q<=H0000H;-ELSIF(clk'uvunt and dk='l) THEN-M<=q 1;-lF(q<=,1001H) then-qV 廿0000”;-END IF;-IF (rcsct<=,lt)THEN-qV="00”;-EL

32、SIF- wait until (clkvcnt and clk=T);- WAIT UNTIL (dk'EVENT AND elk = T);- WAIT UNTIL (clock'EVENT AND clock = '1);-qV=qT;- end if;-countv=q;- -WAIT UNTIL clock = T;- if (clock'cvunt and clock-T)then- WAIT UNTIL rising_cdgt(clock);- clock-ciit and clock=,r;- count <= 0;- WAIT UNTIL

33、 (clockEVENT AND clock = '1);- WAIT riscedge clock = T;- if (clock'cvunt and clock-T) then- WAIT UNTIL rising_cdge(clock);- count <= 1;- WAIT UNTIL (clock'EVENT AND clock = U1);- WAIT UNTIL clock = T;- -if (clock event and clock=,l,)thcn- WAIT UNTIL rising_cdgc(clock);- count <= 2;

34、- end if;- end if;- end if;- -END PROCESS;END counter;八計(jì)數(shù)器 library iccc;use iccc.std_logic_l 164.all;use iccc.std_logic_unsigiicd.all;ENTITY7 eightcout ISPORT(elk,resc tenable : IN stdjogic; count: OLT s td_l()gic_vcc t( > r (2 down to 0);END cightcout;ARCHITECTURE counter OF cightcout IS SIGNAL

35、c()unt_int:stdJogic_vcct()r(0 to 2);BEGINPRQCESS(clkjusut)BEGINWAIT UNTIL rising_cdgt(clk);IF reset = fr THENcountjnt <= (OTHERS => %;ELSIF enable = T THENIF(countJnt=Hl 1 l,f) THEN c()uni_int<="000"ELSEcount int <= count int 1;-ELSE一 NULL;-IF (countjni=,l100r,) THEN-c()iintJnt

36、<=M0000H;ENP1F;END IF;ENP PROCESS; count <= c(>iint_int;-IF (rcsct=V) then-qv 廿 o(x)(r;ELSIFCclVevent and clk=L) THENqV=q 1;-IF(q<=H100r<) then-qv 廿 o(x)(r;-END IF;-IF (rcsct<=tr)THEN-qV="00”;-ELSIF -wail until (clkvcnt and clk=*lt);-WAIT UNTIL (clk*EVENT AND elk = T);-WAIT UN

37、TIL ©ock'EVENT AND clock = '1);end if;- count<=q;- -WAIT UNTIL clock = ,V;- if (clcck'cvunt and clock-T) then- WAIT UNTIL rising_cdge(ck)ck);- clock-ciit and clock=,r;- count <= 0;- WAIT UNTIL (clockEVENT AND clock = '1);- WAIT riscedge clock = T;-if (clock'cvunt and c

38、lock='l) then- WAIT UNTIL rising_cdge(clock);- count <= 1;- WAIT UNTIL (clockEVENT AND clock = '1);- WAIT UNTIL clock = T;- if (clock'cvunt and clock-T)then- WAIT UNTIL rising_cdge(clock);- count <= 2;- end if;- end if;- end if;- -END PROCESS;END counter;六計(jì)數(shù)器library iuyuse iccc.std

39、_logic_1164.al);use iccc.std_logic_unsigiicd.all;ENTITY sixcoui ISPORT(elk,reset,enable : IN sidogic; count: OUT s td_l()gic_vcc u >r (2 down to 0);END sixcout;ARCHITECTURE counter OF sixcoutlSSIGNAL c()uiii_int:std_l(>gic_vcct()r(0 to 2);BEGINPR()CESS(clk,reset)BEGINWAIT UNTIL rising_cdgt(clk

40、);IF reset = T THENcounijnt <= (OTHERS => U);ELSIFcmblc = TTHENIF(couiiiJnt=H101tr) THEN c()uiit_int<=,000n;ELSEcount int <= count int 1;-ELSE一 NULL;-IF (countjnt=n100r,) THEN-c()iintJni<=H0000M;END IF;END IF;END PROCESS;count <= coiinOnt;-IF (rcsct=*0*) then-qV 廿0000”;-ELSlFCclkvc

41、nt and clk='l) THENqV=q 1;-IF(q<=H1001H) then-qV 廿0000”;- END IF;- IF (rcsct<=t1l)THEN_qV 廿 00”;-ELSIF- wait until (clkvcnt and c)k=,lt);- WAIT UNTIL (clk'EVENT AND elk = T);- WAIT UNTIL (clock'EVENT AND clock = U1);-qV=qT;- end if;- c()iint<=q;- -WAIT UNTIL clock = T;- if (clcc

42、k'cvuni; and clock=,r)thcn- WAIT UNTIL rising_cdgc(clock);-clock'evuni: and clock=*r;- count <= 0;- WAIT UNTIL (clockVENT AND dock = '1);- WAIT riscedge clock = T;- if (clockrevcnt and clock=,r)then- WAIT UNTIL rising_cdge(clock);- count <= 1;- WAIT UNTIL (ck)ck*EVENT AND clock = '1);- WAIT UNTIL clock = T;- if (clcck'rvuiii and clock-11)then- WAIT UNTIL rising_cdgt(clock);- count <= 2;- end if;- end if;- end if;- -END PROCESS;END counter;四計(jì)數(shù)器library i

溫馨提示

  • 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)論