VHDL设计十进制计数器

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

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_vector(3downto0);beginp0:process(clk,en,load,reset)beginif(reset='0')thenqq=0000;elsif(clk'eventandclk='1')thenifload='0'thenqq=d;elsif(en='1')thenifqq=1001thenqq=0000;elseqq=qq+'1';endif;endif;endif;endprocessp0;q=qq;p1:process(qq)beginifqq=1001thencout='1';elsecout='0';endif;endprocessp1;endexx1;仿真波形:

1 / 2
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功