您好,欢迎来到微智科技网。
搜索
您的当前位置:首页可编程硬件描述语言VHDL Quartus 八进制计数器源代码

可编程硬件描述语言VHDL Quartus 八进制计数器源代码

来源:微智科技网


VHDL Quartus 八进制计数器源代码

LIBRARY IEEE;

USE IEEE.STD_LOGIC_11.ALL; USE IEEE.STD_LOGIC_ARITH.ALL; USE IEEE.STD_LOGIC_UNSIGNED.ALL; ENTITY COUNTER_8 IS PORT (

CLK : IN STD_LOGIC; RS : IN STD_LOGIC;

COUNT_OUT : OUT STD_LOGIC_VECTOR(3 DOWNTO 0) );

END COUNTER_8;

ARCHITECTURE BEHAVIORAL OF COUNTER_8 IS

SIGNAL NEXT_COUNT : STD_LOGIC_VECTOR(3 DOWNTO 0); SIGNAL D_COUNT BEGIN

: STD_LOGIC_VECTOR(3 DOWNTO 0);

PROCESS ( CLK,RS ) BEGIN

IF RS = '0' THEN

NEXT_COUNT <= \"0000\";

ELSIF CLK'EVENT AND CLK='1' THEN IF NEXT_COUNT = \"0111\" THEN NEXT_COUNT <= \"0000\"; ELSE

NEXT_COUNT <= NEXT_COUNT + 1; END IF; END IF; END PROCESS; PROCESS ( CLK,RS ) BEGIN

IF RS = '0' THEN D_COUNT <= \"0000\";

ELSIF CLK'EVENT AND CLK='1' THEN

IF NEXT_COUNT = \"0111\" THEN

D_COUNT <= D_COUNT + 1; END IF; END IF; END PROCESS;

COUNT_OUT <= D_COUNT; END BEHAVIORAL;

因篇幅问题不能全部显示,请点此查看更多更全内容

Copyright © 2019- 7swz.com 版权所有 赣ICP备2024042798号-8

违法及侵权请联系:TEL:199 18 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务