欢迎来到天天文库
浏览记录
ID:50812808
大小:41.50 KB
页数:2页
时间:2020-03-14
《VHDL设计十进制计数器.doc》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、EDA课程设计——清零置数十进制计数器程序清单:libraryieee;useieee.std_logic_1164.all;useieee.std_logic_unsigned.all;entitycdu10isport(clk,en,load,reset:instd_logic;d:instd_logic_vector(3downto0);cout:outstd_logic;q:outstd_logic_vector(3downto0));endcdu10;architectureexx1ofcdu10issignalqq:std_logic_v
2、ector(3downto0);beginp0:process(clk,en,load,reset)beginif(reset='0')thenqq<="0000";elsif(clk'eventandclk='1')thenifload='0'thenqq<=d;elsif(en='1')thenifqq="1001"thenqq<="0000";elseqq<=qq+'1';endif;endif;endif;endprocessp0;q<=qq;p1:process(qq)beginifqq="1001"thencout<='1';elseco
3、ut<='0';endif;endprocessp1;endexx1;仿真波形:
此文档下载收益归作者所有