Professional Documents
Culture Documents
2-Bit Counter VHDL Code: Library Ieee Use Ieee - STD - Logic - 1164.all Entity Bit - Counter Is
2-Bit Counter VHDL Code: Library Ieee Use Ieee - STD - Logic - 1164.all Entity Bit - Counter Is
library ieee;
use ieee.std_logic_1164.all;
entity bit_counter is
port (
clk : in std_logic;
rst : in std_logic;
count_out : out std_logic_vector(1 downto 0));
end bit_counter;
begin -- 2bit_counter_ar
begin -- process
if rst = '1' then -- asynchronous reset (active high)
count_out_sig <= "11";
elsif clk'event and clk = '1' then -- rising clock edge
count_out_sig(0) <= sig1;
count_out_sig(1) <= sig2;
end if;
end process;
-- Combinational Logic
end bit_counter_ar;