1、EDA16x16点阵滚动+动画显示四、课程设计的总体步骤1、单个字符的显示(如:黄):library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity xianshi isport( clk2:in std_logic; rck,sck:out std_logic; si:out std_logic);end ;architecture one of xianshi issignal sel:std_logic_vector(3 downto 0);signal q: std_logic_vector
2、(31 downto 0);signal i:integer range 0 to 31;signal coi:std_logic;begin process(sel,clk1)begincase sel is when0000=qqqqqqqqqqqqqqqqnull; end case; if clk1event and clk1=1then 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 ;时序仿真:从图中可以看出,当cl
3、k1在第32个上升沿rck变为低电频,sck与clk1是同一电频,故此程序满足要求。 2、多个字符的跳动显示(如:黄小红):library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity xianshi isport( clk1:in std_logic; clk2:in std_logic; rck,sck:out std_logic; si:out std_logic);end ;architecture one of xianshi issignal lie:std_logic_vector(
4、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)beginif clk2event and clk2=1 then lie case sel is when0000=qqqqqqqqqqqqqqqqnull; end case; when0001= case sel is when0000=qqqqqq
5、qqqqqqqqqqnull; end case; when0010= case sel is when0000=qqqqqqqqqqqqqqqqnull; end case; when others=null; end case; if clk1event and clk1=1then 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是同一电
6、频,故此程序满足要求。3、汉字的滚动和动画显示(如:黄小红+笑脸):library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity xianshi isport( clk1:in std_logic; clk2:in std_logic; rck,sck:out std_logic; si:out std_logic);end ;architecture one of xianshi issignal lie:std_logic_vector(3 downto 0);signal sel:std_l
7、ogic_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)beginif clk2event and clk2=1 then lie case sel is when0000=qqqqqqqqqqqqqqqqnull; end case; when0001= case sel is when0000=qqqqqqqqqqqqqqqqnull; end case; when0010= case sel is when0000=qqqqqqqqqqqqqqqqnull; end case; when0011= case sel is when0000=qqqqqqqqqqqqqqqqnull; end case; when0100= case sel is when0000=qqqqqqqqqqqq=11111111111111101111111011111111; when11
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1