library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_logic_unsigned.ALL;
-- Uncomment the following library declaration if using
-- arithmetic functions with Signed or Unsigned values
--use IEEE.NUMERIC_STD.ALL;
-- Uncomment the following library declaration if instantiating
-- any Xilinx primitives in this code.
--library UNISIM;
--use UNISIM.VComponents.all;
entity newv is
Port ( clk : in STD_LOGIC;
reset : in STD_LOGIC;
sw1 : in STD_LOGIC;
LED : out STD_LOGIC_VECTOR (7 downto 0));
end newv;
architecture Behavioral of newv is
signal c :std_logic_vector(7 downto 0);
signal counter :std_logic_vector(4 downto 0):="00000";
begin
process (clk,reset,sw1)
--variable c :std_logic_vector(7 downto 0);
--variable counter :std_logic_vector(4 downto 0):="00000";
begin
if (clk'event and clk='1') then
if reset='1' then
LED <= "00000000";
elsif sw1='1' then
LED <= "11111111";
else
counter <= counter+1 ;
if (counter = "10000") then
c <=c+1;
LED<= c;
counter <= "00000";
end if;
end if;
end if;
end process;
end Behavioral;