分类:
2008-07-28 10:17:03
第一个实验-8路开关控制8个灯
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;