jackseiko
Programmer
- May 6, 2009
- 5
someone please tell me what's the problem with the code? TAI
------------------------------------------------------------
entity switches is
port(
clock : in std_logic;
Switches : in std_logic_vector ( 3 downto 0);
output: out std_logic_vector (7 downto 0) );
end switches;
architecture switches of switches is
begin
process(clock, switches)
begin
if(rising_edge(clock)) then
if( switch(0)<='1') then
output <="00000001" ;
elsif (switch(1)<='1') then
output <="00000010" ;
elsif (switch(2) <='1') then
output <="00000100" ;
elsif (switch(3) <='1') then
output <="00001000" ;
end if;
end if;
end process;
end switches;
------------------------------------------------------------
entity switches is
port(
clock : in std_logic;
Switches : in std_logic_vector ( 3 downto 0);
output: out std_logic_vector (7 downto 0) );
end switches;
architecture switches of switches is
begin
process(clock, switches)
begin
if(rising_edge(clock)) then
if( switch(0)<='1') then
output <="00000001" ;
elsif (switch(1)<='1') then
output <="00000010" ;
elsif (switch(2) <='1') then
output <="00000100" ;
elsif (switch(3) <='1') then
output <="00001000" ;
end if;
end if;
end process;
end switches;