library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity dian is
port(clk,d:in std_logic;
led7s:out std_logic_vector(7 downto 0);
led7x:out std_logic_vector(7 downto 0)
);
end dian;
architecture en of dian is
signal q:std_logic_vector(2 downto 0);
signal dd:std_logic_vector(1 downto 0);
begin
process(clk,d)
begin
if clk'event and clk='1'
then q<=q+1;
end if;
if d'event and d='1'
then dd<=dd+1;
end if;
if dd="01" then
case q is
when "000"=>led7s<="10000000";led7x<="11111111";
when "001"=>led7s<="01000000";led7x<="11111111";
when "010"=>led7s<="00100000";led7x<="10101011";
when "011"=>led7s<="00010000";led7x<="10010010";
when "100"=>led7s<="00001000";led7x<="00000000";
when "101"=>led7s<="00000100";led7x<="10010011";
when "110"=>led7s<="00000010";led7x<="10101011";
when "111"=>led7s<="00000001";led7x<="11111111";
when others=>null;
end case;
end if;
if dd="10"then
case q is
when "000"=>led7s<="10000000";led7x<="11011111";
when "001"=>led7s<="01000000";led7x<="10010111";
when "010"=>led7s<="00100000";led7x<="00000000";
when "011"=>led7s<="00010000";led7x<="10010110";
when "100"=>led7s<="00001000";led7x<="11111111";
when "101"=>led7s<="00000100";led7x<="10101011";
when "110"=>led7s<="00000010";led7x<="00000000";
when "111"=>led7s<="00000001";led7x<="00101010";
when others=>null;
end case;
end if;
if dd="11"then
case q is
when "000"=>led7s<="10000000";led7x<="11011010";
when "001"=>led7s<="01000000";led7x<="00000000";
when "010"=>led7s<="00100000";led7x<="11011011";
when "011"=>led7s<="00010000";led7x<="10101000";
when "100"=>led7s<="00001000";led7x<="10000010";
when "101"=>led7s<="00000100";led7x<="11010100";
when "110"=>led7s<="00000010";led7x<="10000000";
when "111"=>led7s<="00000001";led7x<="01010100";
when others=>null;
end case;
end if;
if dd="00"then
case q is
when "000"=>led7s<="10000000";led7x<="00000000";
when "001"=>led7s<="01000000";led7x<="00000000";
when "010"=>led7s<="00100000";led7x<="00111100";
when "011"=>led7s<="00010000";led7x<="00111100";
when "100"=>led7s<="00001000";led7x<="00111100";
when "101"=>led7s<="00000100";led7x<="00111100";
when "110"=>led7s<="00000010";led7x<="00000000";
when "111"=>led7s<="00000001";led7x<="00000000";
when others=>null;
end case;
end if;
end process;
end en;
求大神帮我解释哈每句的意思,我们需要这个,但是我不懂!可以QQ联系我358904397!在此小弟先谢过了!