level 10
设计一个点阵 要求显示自己的姓。我姓 林
——往事若能下酒,
回忆便是一场宿醉。
2014年06月24日 10点06分
1
level 10
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;
--------------------------------------------------------------------
entity exp11 is port( clkin : in std_logic; --时钟输入
keyc : out std_logic_vector(15 downto 0); --点阵列控制
keyr : out std_logic_vector(15 downto 0) --点阵行显示
);
end exp11
--------------------------------------------------------------------
architecture behave of exp11 is
signal cdount : std_logic_vector(3 downto 0);
signal jishu : std_logic_vector(3 downto 0);
signal dount : std_logic_vector(9 downto 0);
signal S : std_logic_vector(6 downto 0);
signal Sdount : std_logic_vector(6 downto 0);
signal clk : std_logic:='0';
begin
process(clkin)
variable count: integer range 0 to 12010:=0;
begin
if clkin'event and clkin='1' then
count:=count+1;
if(count=12000) then
clk<=not clk;
count:=0;
end if;
end if;
end process;
process(clk) --显示时序控制
begin
if clk'event and clk='1' then
dount<=dount+1;
if dount=510 then
if S> 126 then
S<="0000000";
else
S<=S+1;
end if;
else
Sdount<=S;
end if;
if jishu<15 then
jishu<=jishu+1; Sdount<=S+1;
else
jishu<="0000"; Sdount<=S;
end if;
if cdount<15 then
cdount<=cdount+1;
else
cdount<="0000";
end if;
end if;
end process;
process(Sdount,cdount)
begin
case cdount is
when "0000"=>keyc<="0000000000000001"; --列选择
when "0001"=>keyc<="0000000000000010";
when "0010"=>keyc<="0000000000000100";
when "0011"=>keyc<="0000000000001000";
when "0100"=>keyc<="0000000000010000";
when "0101"=>keyc<="0000000000100000";
when "0110"=>keyc<="0000000001000000";
when "0111"=>keyc<="0000000010000000";
when "1000"=>keyc<="0000000100000000";
when "1001"=>keyc<="0000001000000000";
when "1010"=>keyc<="0000010000000000";
when "1011"=>keyc<="0000100000000000";
when "1100"=>keyc<="0001000000000000";
when "1101"=>keyc<="0010000000000000";
when "1110"=>keyc<="0100000000000000";
when "1111"=>keyc<="1000000000000000";
when others=>keyc<="0000000000000000";
end case;
CASE Sdount IS
when "0000000"=>keyr<="1111111111111111"; --行显示
when "0000001"=>keyr<="1111111111111111";
when "0000010"=>keyr<="1111011111011111";
when "0000011"=>keyr<="1111011111011111";
when "0000100"=>keyr<="1100000000000111";
when "0000101"=>keyr<="1110001110001111";
when "0000110"=>keyr<="1101010101010111";
when "0000111"=>keyr<="1011011011011011";
when "0001000"=>keyr<="1111111111111111";
when "0001001"=>keyr<="1111111111111111";
when "0001010"=>keyr<="1111111111111111";
when "0001011"=>keyr<="1111111111111111";
when "0001100"=>keyr<="1111111111111111";
when "0001101"=>keyr<="1111111111111111";
when "0001110"=>keyr<="1111111111111111";
when "0001111"=>keyr<="1111111111111111";
end case;
end process;
end behave;
2014年06月25日 15点06分
3
level 10
麻烦会的,帮我 改一下程序或者补充完整,怎样才能完成
2014年06月25日 15点06分
4