Library IEEE;
USE IEEE std_logic_1164.all;
Entity Decade is
port (clk,rst : IN std_logic;
q : OUT std_logic_vector (3 downto 0);
End Decade;
Architecture Behavioral of Decade is
Signal count : std_logic_vector (3 downto 0);
begin
Process (clk,rst)
begin
if (rst = '0') then count <= "0000" ;
elsif (clk' event and clk = '1') then
count = count+1;
end if;
if (count = "1010") then count <= "0000" ;
end if;
end process;
q <= count ;
End behavioral;



