library ieee;use ieee.std_logic_1164.all;entity switch_led is port(key : in std_logic_vector(7 downto 0); light : out std_logic_vector(7 downto 0));end entity switch_led; architecture behav of switch_led is begin process(key) begin for i in 7 downto 0 loop light(i) <= key(i);--the led is lighting when the votage is high; end loop; end process; end architecture behav;

评论