📄 bin_count_8bit.vhd
字号:
--***********************************
--* 8 Bit Binary Counter *
--* Filename : BIN_COUNT_8BIT.VHD *
--***********************************
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity BIN_COUNT_8BIT is
Port ( CLK : in std_logic;
RESET : in std_logic;
BIN_OUT : out std_logic_vector(7 downto 0));
end BIN_COUNT_8BIT;
architecture Behavioral of BIN_COUNT_8BIT is
signal COUNTER : std_logic_vector(7 downto 0);
signal DIVIDER : std_logic_vector(23 downto 1);
signal COUNT_CLK : std_logic;
begin
--***************************
--* Time Base Generation *
--***************************
process (CLK,RESET)
begin
if RESET = '0' then
DIVIDER <= "00000000000000000000000";
elsif CLK'event and CLK = '1' then
DIVIDER <= DIVIDER + 1;
end if;
end process;
COUNT_CLK <= DIVIDER(23);
--**************************
--* 8 Bit Binary Counter *
--**************************
process (COUNT_CLK,RESET)
begin
if RESET = '0' then
COUNTER <= "00000000";
elsif COUNT_CLK'event and COUNT_CLK = '1' then
COUNTER <= COUNTER + 1;
end if;
end process;
BIN_OUT <= not (COUNTER);
end Behavioral;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -