程序下载进去以后,灯全亮了。
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;
entity lled is
port(
clk:in std_logic;
doutut std_logic_vector(7 downto 0)
);
end lled;
architecture behav of lled is
signal q:std_logic_vector(7 downto 0);
signal d:std_logic_vector(3 downto 0);
begin
process(clk)
begin
if clk'event and clk='1'then
d<=d+1;
end if;
case d is
when"0000"=>dout<="1000000000000000" after 10 ms;
when"0001"=>dout<="0100000000000000" after 10 ms;
when"0010"=>dout<="0010000000000000" after 10 ms;
when"0011"=>dout<="0001000000000000" after 10 ms;
when"0100"=>dout<="0000100000000000" after 10 ms;
when"0101"=>dout<="0000010000000000" after 10 ms;
when"0110"=>dout<="0000001000000000" after 10 ms;
when"0111"=>dout<="0000000100000000" after 10 ms;
when"1000"=>dout<="0000000010000000" after 10 ms;
when"1001"=>dout<="0000000001000000" after 10 ms;
when"1010"=>dout<="0000000000100000" after 10 ms;
when"1011"=>dout<="0000000000010000" after 10 ms;
when"1100"=>dout<="0000000000001000" after 10 ms;
when"1101"=>dout<="0000000000000100" after 10 ms;
when"1110"=>dout<="0000000000000010" after 10 ms;
when "1111"=>dout<="0000000000000001" after 10 ms;
when others=>dout<="XXXXXXXXXXXXXXXX";
end case;
end process;
end behav;