Mod 10 Counter For Downloading
Mod 10 Counter For Downloading
----------------------------------------------------------------------------------
-- Company:
-- Engineer:
--
-- Design Name:
-- Project Name:
-- Target Devices:
-- Tool versions:
-- Description:
--
-- Dependencies:
--
-- Revision:
-- Additional Comments:
--
----------------------------------------------------------------------------------
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
---- Uncomment the following library declaration if instantiating
--library UNISIM;
--use UNISIM.VComponents.all;
entity count1 is
Port (
clk : in std_logic;
up_down : in STD_LOGIC;
rst : in STD_LOGIC);
end count1;
begin
process(rst,clk)
begin
if (rst='0')then
divider<=(others=>'0');
divider<=divider+1;
end if;
end process;
clk_new<=divider(21);
process(clk_new)
begin
if(rst='0')then
count<="0000";
elsif(up_down='1')then
end if;
elsif(up_down='0')then
count<= count-1;
end if;
end if;
end if;
end process;
output<= count;
end Behavioral;