您好,欢迎访问三七文档
当前位置:首页 > 商业/管理/HR > 信息化管理 > EDA十进制-100计数器
CNT10.VHD仿真波形图Cnt100.vhdLIBRARYIEEE;USEIEEE.STD_LOGIC_1164.ALL;USEIEEE.STD_LOGIC_UNSIGNED.ALL;ENTITYCNT100ISPORT(CLK,reset:INSTD_LOGIC;CAR:OUTSTD_LOGIC;BOUT:OUTSTD_LOGIC_VECTOR(6DOWNTO0));ENDCNT100;ARCHITECTURERTLOFCNT100ISBEGINPROCESS(CLK,reset)VariableCONT_I:STD_LOGIC_VECTOR(6DOWNTO0);BEGINifreset='0'thencont_i:=0000000;elsifclk'eventandclk='1'thenifcont_i=1100011thencont_i:=0000000;car='1';elsecont_i:=cont_i+'1';car='0';endif;endif;bout=cont_i;endprocess;endrtl;CNT10.vhdLIBRARYIEEE;USEIEEE.STD_LOGIC_1164.ALL;USEIEEE.STD_LOGIC_UNSIGNED.ALL;ENTITYcnt10ISPORT(CLK,RST,EN,LOAD:INSTD_LOGIC;DATA:INSTD_LOGIC_VECTOR(3DOWNTO0);DOUT:OUTSTD_LOGIC_VECTOR(3DOWNTO0);COUT:OUTSTD_LOGIC);ENDCNT10;ARCHITECTUREbehavOFCNT10ISBEGINPROCESS(CLK,RST,EN,LOAD)VARIABLEQ:STD_LOGIC_VECTOR(3DOWNTO0);BEGINIFRST='0'THENQ:=(OTHERS='0');ELSIFCLK'EVENTANDCLK='1'THENIFEN='1'THENIF(LOAD='0')THENQ:=DATA;ELSEIFQ9THENQ:=Q+1;ELSEQ:=(OTHERS='0');ENDIF;ENDIF;ENDIF;ENDIF;IFQ=1001THENCOUT='1';ELSECOUT='0';ENDIF;DOUT=Q;ENDPROCESS;ENDbehav;CNT100仿真波形图Cnt10rtlCnt100rtl
本文标题:EDA十进制-100计数器
链接地址:https://www.777doc.com/doc-5279497 .html