这些小活动你都参加了吗?快来围观一下吧!>>
电子产品世界 » 论坛首页 » 嵌入式开发 » MCU » 大家来讨论下:关于VHDL实现汉字滚动显示器的制作

共2条 1/1 1 跳转至

大家来讨论下:关于VHDL实现汉字滚动显示器的制作

菜鸟
2005-03-23 06:16:35     打赏

模块CHW,作用控制显示的时间--编译出错程序 library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; entity chw is port(clk: in std_logic; q: out std_logic_vertor (1 downto 0)); end chw; architecture chw_arc of chw is begin process (clk) variable cnt:integer; variable tmp:std_logic_vector(1 downto 0); begin if clk‘event and clk=‘1‘ then If cnt< 10000 then Cnt:=cnt+1; Else Cnt:=0; If tmp= "11" then tmp:="00"; else tmp:=tmp+1; end if; end if; end if; q<=tmp; end process; end chw_arc;

模块CNTA,产生列选择的信号:--通过编译 library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; entity cnta is port (clk: in std_logic; q: out std_logic_vector(3 downto 0)); end cnta; architecture cnt_arc of cnta is begin process (clk) variable tmp:std_logic_vector(3 downto 0); begin if clk‘event and clk=‘1‘ then if tmp="1111" then tmp:="0000"; else tmp:=tmp+1; end if; end if; q<=tmp-1; end process; end cnt_arc;

模块CORA,对应列选择信号输出每一列对应的数据,点亮相应的灯:--通过编译

library ieee; use ieee.std_logic_1164.all; entity cora is port( ch: in std_logic_vector(1 downto 0); Sel: in std_logic_vector(3 downto 0); q: out std_logic_vector(15 downto 0)); end cora; architecture corn_arc of cora is begin process (ch,sel) begin case ch is when"00"=> case sel is when "0000" =>q<="0110000000000000"; when "0001" =>q<="0111100000000000"; when "0010" =>q<="0001111000000000"; when "0011" =>q<="0000011110000000"; when "0100" =>q<="0000000011110000"; when "0101" =>q<="0000000000111100"; when "0110" =>q<="0000000000000111"; when "0111" =>q<="0000000000000111"; when "1000" =>q<="0000000000011110"; when "1001" =>q<="0000000001111000"; when "1010" =>q<="0000000111100000"; when "1011" =>q<="0000111100000000"; when "1100" =>q<="0001111000000000"; when "1101" =>q<="0001111000000000"; when "1110" =>q<="0111100000000000"; when "1111" =>q<="0110000000000000"; when others=>null; end case; when"01"=> case sel is when "0000" =>q<="0000000000000000"; when "0001" =>q<="0000000000000000"; when "0010" =>q<="1111111111111111"; when "0011" =>q<="1111111111111111"; when "0100" =>q<="0000000110000000"; when "0101" =>q<="0000000110000000"; when "0110" =>q<="0000000110000000"; when "0111" =>q<="0000000110000000"; when "1000" =>q<="0000000110000000"; when "1001" =>q<="0000000110000000"; when "1010" =>q<="0000000110000000"; when "1011" =>q<="0000000110000000"; when "1100" =>q<="1111111111111111"; when "1101" =>q<="1111111111111111"; when "1110" =>q<="0000000000000000"; when "1111" =>q<="0000000000000000"; when others => null; end case; when "10" => case sel is when "0000" =>q<="0000000000000000"; when "0001" =>q<="0000000000000000"; when "0010" =>q<="1111111111111111"; when "0011" =>q<="1111111111111111"; when "0100" =>q<="1100000000000011"; when "0101" =>q<="1100000000000011"; when "0110" =>q<="1100000000000011"; when "0111" =>q<="0110000000000110"; when "1000" =>q<="0110000000000110"; when "1001" =>q<="0110000000000110"; when "1010" =>q<="0011000000001100"; when "1011" =>q<="0001100000011000"; when "1100" =>q<="0000111111110000"; when "1101" =>q<="0000011111100000"; when "1110" =>q<="0000000000000000"; when "1111" =>q<="0000000000000000"; when others => null; end case; when"11" => case sel is when "0000" =>q<="0000000000000000"; when "0001" =>q<="0000000000000000"; when "0010" =>q<="0000000000000000"; when "0011" =>q<="1111111111111111"; when "0100" =>q<="1111111111111111"; when "0101" =>q<="0000000000000011"; when "0110" =>q<="0000000000000011"; when "0111" =>q<="0000000000000011"; when "1000" =>q<="0000000000000011"; when "1001" =>q<="0000000000000011"; when "1010" =>q<="0000000000000011"; when "1011" =>q<="0000000000000111"; when "1100" =>q<="0000000000000111"; when "1101" =>q<="0000000000000000"; when "1110" =>q<="0000000000000000"; when "1111" =>q<="0000000000000000"; when others => null; end case; when others =>null; end case; end process; end corn_arc;

以上程序是实现16*16点阵使用逐行扫描的方式来不间断地显示VHDL这四个字母; 我是想通过自己对以上程序1加一个移位寄存器,来实现汉字的滚动显示。 通不过软件地编译,有哪位高手帮忙看看!我使用的软件是MAX+PLUS2 能够用VHDL实现汉字的滚动显示就算目标达到




关键词: 大家     讨论     关于     实现     汉字     滚动     显示器     制作         

菜鸟
2006-08-31 17:15:00     打赏
2楼

程序错了,我改过了,调试通过了。

联系QQ:190213650


共2条 1/1 1 跳转至

回复

匿名不能发帖!请先 [ 登陆 注册 ]