Ripple Counter

Ripple Counter

2-Bit Asynchronous/ Ripple Counter

library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
 entity counter2 is
  port(clk : in std_logic;
       rst : in std_logic;
       count : out unsigned(1 downto 0));
 end counter2;
architecture counter_2 of counter2 is
 signal temp : unsigned(1 downto 0);
  begin
   process(clk,rst)
    begin
     if rst='1' then
     temp <= "00";
     elsif (clk='1') then
     temp <= temp + "01";
     end if;
   end process;
   count <= temp;
end counter_2;