EDA16x16点阵滚动动画显示
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
四、课程设计的总体步骤
1、单个字符的显示(如:黄):
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity xianshi is
port( clk2:in std_logic;
rck,sck:out std_logic;
si:out std_logic);
end ;
architecture one of xianshi is
signal sel:std_logic_vector(3 downto 0);
signal q: std_logic_vector(31 downto 0);
signal i:integer range 0 to 31;
signal coi:std_logic;
begin
process(sel,clk1)
begin
case sel is
when"0000"=>q<="00000100000000000111111111111111";
when"0001"=>q<="00000100000000011011111111111111";
when"0010"=>q<="00100100000000011101111111111111";
when"0011"=>q<="00100101111110101110111111111111";
when"0100"=>q<="00100101010100101111011111111111";
when"0101"=>q<="11111101010101001111101111111111";
when"0110"=>q<="00100101010100001111110111111111";
when"0111"=>q<="00100111111100001111111011111111";
when"1000"=>q<="00100101010100001111111101111111";
when"1001"=>q<="11111101010101001111111110111111";
when"1010"=>q<="00100101010101001111111111011111";
when"1011"=>q<="01100111111100101111111111101111";
when"1100"=>q<="00100100100000101111111111110111";
when"1101"=>q<="00001100000000011111111111111011";
when"1110"=>q<="00000100000000001111111111111101";
when"1111"=>q<="00000000000000001111111111111110"; when others =>null;
end case;
if clk1'event and clk1='1'then
si<=q(i);i<=i+1;coi<='0';
if i=31 then i<=0;coi<='1';sel<=sel+'1';
end if;
rck<=not coi;
end if;
end process;
sck<=clk1;
end ;
时序仿真:
从图中可以看出,当clk1在第32个上升沿rck变为低电频,sck与clk1是同一电频,故此程序满足要求。
2、多个字符的跳动显示(如:黄小红):
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity xianshi is
port( clk1:in std_logic;
clk2:in std_logic;
rck,sck:out std_logic;
si:out std_logic);
end ;
architecture one of xianshi is
signal lie:std_logic_vector(3 downto 0); signal sel:std_logic_vector(3 downto 0); signal q: std_logic_vector(31 downto 0); signal i:integer range 0 to 31;
signal coi:std_logic;
begin
process(sel,clk1,clk2)
begin
if clk2'event and clk2='1' then
lie<=lie+'1';
end if;
case lie is
when "0000"=>
case sel is
when"0000"=>q<="00000100000000000111111111111111";
when"0001"=>q<="00000100000000011011111111111111";
when"0010"=>q<="00100100000000011101111111111111";
when"0011"=>q<="00100101111110101110111111111111";
when"0100"=>q<="00100101010100101111011111111111";
when"0101"=>q<="11111101010101001111101111111111";
when"0110"=>q<="00100101010100001111110111111111";
when"0111"=>q<="00100111111100001111111011111111";
when"1000"=>q<="00100101010100001111111101111111";
when"1001"=>q<="11111101010101001111111110111111";
when"1010"=>q<="00100101010101001111111111011111";
when"1011"=>q<="01100111111100101111111111101111";
when"1100"=>q<="00100100100000101111111111110111";
when"1101"=>q<="00001100000000011111111111111011";
when"1110"=>q<="00000100000000001111111111111101";
when"1111"=>q<="00000000000000001111111111111110";