欢迎来到天天文库
浏览记录
ID:57739801
大小:12.50 KB
页数:1页
时间:2020-09-02
《四位二进制计数器vhdl程序.doc》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、LIBRARYIEEE;USEIEEE.STD_LOGIC_1164.ALL;USEIEEE.STD_LOGIC_UNSIGNED.ALL;entityCNT4isPORT(cp,r:INSTD_LOGIC;q:OUTSTD_LOGIC_VECTOR(3DOWNTO0));endcNT4;ARCHITECTUREONEOFCNT4ISSIGNALcount:STD_LOGIC_VECTOR(3DOWNTO0);BEGINPROCESS(cp,r)BEGINifr='0'thencount<="0000";elsiFcp'EVENTANDcp='1'THENifcount="
2、1111"THENcount<="0000";ELSEcount<=count+1;ENDIF;endif;ENDPROCESS;q<=count;endONE;LIBRARYIEEE;USEIEEE.STD_LOGIC_1164.ALL;USEIEEE.STD_LOGIC_UNSIGNED.ALL;entityCNT4isPORT(cp,r:INSTD_LOGIC;q:OUTSTD_LOGIC_VECTOR(3DOWNTO0));endcNT4;ARCHITECTUREONEOFCNT4ISSIGNALcount:STD_LOGIC_VECTOR(3DOWNTO0);BE
3、GINPROCESS(cp,r)BEGINifr='0'thencount<="0000";elsiFcp'EVENTANDcp='1'THENifcount="0000"THENcount<="1111";ELSEcount<=count-1;ENDIF;endif;ENDPROCESS;q<=count;endONE;
此文档下载收益归作者所有