点阵汉字显示VHDL语言设计.docVIP

  • 18
  • 0
  • 约 4页
  • 2015-08-18 发布于河南
  • 举报
点阵汉字显示VHDL语言设计.doc

16*16的点阵显示设计 1、实验目的 熟悉MAX+plusⅡ的VHDL文本设计流程的全过程,学会用可编程逻辑器件设计制作一个16*16的点阵的显示设计。 16*16点阵显示是传统的点阵显示基本应用,它是很多复杂的显示的基础。这种点阵的显示可以使用多种方法来实现,其中所用到的器件也不尽相同,但是很多基本算法和思想都是相同的,只是根据不同的硬件,具体的方法有所区别。在此设计中,我所使用的点阵的列式有16个行信号组成的,每一行是由一个单独的位来控制,高电平有效,而列式由四个位矢量来控制的。例如:“0000”表示第0行,“0000000000000001”表示第1行的点亮。由于列式由一个矢量决定的,而每一时刻列只能有一个固定的值,因而只能是某一列的如干点亮,因此就决定了只能用逐列扫描的方法。 2、各模块及功能 模块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_vector(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 clkevent and clk=1then if cnt10000 then Cnt:=cnt+1; Else Cnt:=0; If tmp=11then 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=0010000000000000; when 0001 = q=0100011111110000; when 0010 = q=0010000000100000; when 0011 = q=0001000001000000; when 0100 = q=0000100010000000; when 0101 = q=0100000100000000; when 0110 = q=0010001111111000; when 0111 = q=0001000000010100; when 1000 = q=0000100000100010; when 1001 = q=0000000001000010; when 1010 = q=0000000010001010; when 1011 = q=0000101100010010; when 1100 = q=0001000000100

文档评论(0)

1亿VIP精品文档

相关文档