欢迎来到天天文库
浏览记录
ID:56705316
大小:68.50 KB
页数:2页
时间:2020-07-05
《异步复位8421码十进制计数器vhdl.doc》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、异步复位8421码十进制计数器:LIBRARYIEEE;USEIEEE.STD_LOGIC_1164.ALL;USEIEEE.STD_LOGIC_UNSIGNED.ALL;ENTITYBCDcoderISPORT(cp,clear:INSTD_LOGIC;q:OUTSTD_LOGIC_VECTOR(3DOWNTO0));ENDBCDcoder;ARCHITECTUREaOFBCDcoderISSIGNALtemp:STD_LOGIC_VECTOR(3DOWNTO0);SIGNALtmp:INTEGERRANG
2、E0TO49999999;SIGNALclk_out:STD_LOGIC;BEGINP1:PROCESS(cp)BEGINIFcp'eventANDcp='1'THENIFtmp=49999999THENtmp<=0;ELSEtmp<=tmp+1;ENDIF;IFtmp<=24999999THENclk_out<='0';ELSEclk_out<='1';ENDIF;ENDIF;ENDPROCESSP1;P2:PROCESS(clear,clk_out)BEGINIFclear='1'THENtemp<="0
3、000";ELSIF(clk_out'eventandclk_out='1')THENIFtemp="1001"THENtemp<="0000";ELSEtemp<=temp+1;ENDIF;ENDIF;ENDPROCESSP2;q<=temp;ENDa;
此文档下载收益归作者所有