Altera_Forum
Honored Contributor
14 years agoOn/Off led
unable to turn on/off led. the component does not trigger does anyone knows why?
--main filearchitecture Behavioral of DigitaleKlok is
component OnOff is
port (
led_state : in std_logic_vector(1 downto 0);
LEDR : out std_logic_vector(9 downto 0)
);
end component ;
signal sig : std_logic_vector(1 downto 0); --> 01,10,11
begin
process(Clock)
begin
if (SW(2) = '1') then
sig <="01";
else
sig <="10";
end if;
end process;
test: OnOff port map (sig);
end Behavioral;
------------------------
library IEEE;
use IEEE.std_logic_1164.all;
entity OnOff is
port (
led_state : in std_logic_vector(1 downto 0);
LEDR : out std_logic_vector(9 downto 0)
);
end entity OnOff;
architecture Behavioral of OnOff is
begin
process(led_state)
begin
if(Clock'event and Clock='1') then
if (led_state = "10") then
LEDR(9) <= '1';
end if;
if (led_state = "01") then
LEDR(9) <= '0';
end if;
end if;
end process;
end Behavioral;