VHDL点阵显示.docx

上传人:b****5 文档编号:6295614 上传时间:2023-01-05 格式:DOCX 页数:14 大小:329.74KB
下载 相关 举报
VHDL点阵显示.docx_第1页
第1页 / 共14页
VHDL点阵显示.docx_第2页
第2页 / 共14页
VHDL点阵显示.docx_第3页
第3页 / 共14页
VHDL点阵显示.docx_第4页
第4页 / 共14页
VHDL点阵显示.docx_第5页
第5页 / 共14页
点击查看更多>>
下载资源
资源描述

VHDL点阵显示.docx

《VHDL点阵显示.docx》由会员分享,可在线阅读,更多相关《VHDL点阵显示.docx(14页珍藏版)》请在冰豆网上搜索。

VHDL点阵显示.docx

VHDL点阵显示

 

课程:

基于FPGA的点阵显示控制器的设计

学院:

电气信息工程学院

专业:

测控技术与仪器

班级:

姓名:

学号:

合作者姓名:

日期:

 

一、引言

随着我国经济的高速发展,对公共场合发布信息的需求日益增长,利用LED点阵滚动显示汉字的出现正好适应了这一市场需求,已经成为信息传播的一种重要手段。

采用传统方法设计的汉字滚动显示器,通常需要使用单片机、存储器和制约逻辑电路来进行PCB板级的系统集成。

尽管这种方案有单片机软件的支持较为灵活,但是由于受硬件资源的限制,未来对设计的变更和升级,总是难以避免要付出较多研发经费和较长投放市场周期的代价。

随着电子设计自动化(EDA)技术的进展,基于可编程FPGA器件进行系统芯片集成的新设计方法,也正在快速地到代基于PCB板的传统设计方式。

因此,基于FPGA和VHDL语言实现在8*8点阵上的汉字静态或一屏显示问题。

二、课题要求

(1)技术要求

1根据电路特点,用层次设计概念。

将此设计任务分成若干模块,规定每一模块的功能和各模块之间的借口,透视加深层次化设计概念;

2软件的原件管理深层含义,以及模块元件之间的连接概念,对于不同目录下的同一设计,如何熔合;

3适配划分前后的仿真内容有何不同概念,仿真信号对象有何不同,有更深一步了解。

熟悉了FPGA设计的调试过程中手段的多样化;

4按适配划分后的管脚定位,同相关功能块硬件电路接口连线;

(2)功能要求

1在8*8点阵上显示汉字

2可以静态显示或一屏显示

3利用拨码开关来实现静态显示与一屏显示切换

(3)本人的工作

三、设计方案

(1)工作原理

8*8点阵原理:

按照要求可知,点阵模块,共由8*8=64个发光二极管组成,如何在该点阵模块上显示汉字是本实验的关键。

先将要显示的每幅图像画在8*8共64个小方格的矩形框中,再在有笔划下落处的小方格里填上“1”,五笔划处填上“0”,这样就形成了与这个汉字所对应的二进制数据在该矩形矿上的分布以“正”为例,点阵分布为:

10000000

10000001

11110001

10000001

11111111

10001001

10001001

10000000

(2)原理框图

四、单元电路设计,仿真结果与分析

(1)静态显示“正”

libraryieee;

useieee.std_logic_1164.all;

useieee.std_logic_Unsigned.all;

useieee.std_logic_ARITH.all;

ENTITYpengis

port(clk,en:

instd_logic;

lie:

outstd_logic_vector(7downto0);--列

com:

outstd_logic_vector(7downto0));--行

Endpeng;

Architectureaofpengis

signalst1:

std_logic_vector(7downto0);

signalosc:

std_logic;

signalosd:

std_logic;

signald_ff:

std_logic_vector(27downto0);

signaldata:

std_logic_vector(7downto0);

signald0,d1,d2,d3,d4,d5,d6,d7:

std_logic_vector(7downto0);

signallie0,lie1,lie2,lie3,lie4,lie5,lie6,lie7:

std_logic_vector(7downto0);

Begin

com<=data;

lie<=st1;

d0<="10000000";

d1<="10000001";

d2<="11110001";

d3<="10000001";

d4<="11111111";

d5<="10001001";

d6<="10001001";

d7<="10000000";--字库正

First:

process

begin

waituntilclk='1';

if(d_ff(27downto0)>=2e8)then

d_ff(27downto0)<="0000000000000000000000000000";

else

d_ff(27downto0)<=d_ff+1;

endif;

osc<=notd_ff(10);

endprocessfirst;

second:

process(osc)

begin

if(osc='1'andosc'eventanden='0')then

ifst1(7downto0)="00000000"orst1(7downto0)="01111111"then

st1(7downto0)<="11111110";data<=d0;

elsifst1(7downto0)="11111110"then

st1(7downto0)<="11111101";data<=d1;

elsifst1(7downto0)="11111101"then

st1(7downto0)<="11111011";data<=d2;

elsifst1(7downto0)="11111011"then

st1(7downto0)<="11110111";data<=d3;

elsifst1(7downto0)="11110111"then

st1(7downto0)<="11101111";data<=d4;

elsifst1(7downto0)="11101111"then

st1(7downto0)<="11011111";data<=d5;

elsifst1(7downto0)="11011111"then

st1(7downto0)<="10111111";data<=d6;

elsifst1(7downto0)="10111111"then

st1(7downto0)<="01111111";data<=d7;

endif;

endif;

endprocesssecond;

enda;

(2)一屏显示“上下五千年”

Libraryieee;

Useieee.std_logic_1164.all;

Useieee.std_logic_unsigned.all;

Useieee.std_logic_arith.all;

Entitywengis

Port(

Clk,en:

instd_logic;

lie:

outstd_logic_vector(7downto0);--列

Com:

outstd_logic_vector(7downto0));--行

Endweng;

Architectureaofwengis

signalst1:

std_logic_vector(7downto0);

signalosc:

std_logic;

signalosd:

std_logic;

signald_ff:

std_logic_vector(27downto0);

signaldata:

std_logic_vector(7downto0);

signald0,d1,d2,d3,d4,d5,d6,d7:

std_logic_vector(7downto0);

signallie0,lie1,lie2,lie3,lie4,lie5,lie6,lie7:

std_logic_vector(6downto0);

begin

com<=data;

lie<=st1;

D0<=

"10000000"whenlie0(6downto0)="0000000"else

"00000001"whenlie0(6downto0)="0000001"else

"10000000"whenlie0(6downto0)="0000010"else

"00010000"whenlie0(6downto0)="0000011"else

"00100100"whenlie0(6downto0)="0000100"else

"00000000";

D1<=

"10000000"whenlie0(6downto0)="0000000"else

"00000001"whenlie0(6downto0)="0000001"else

"10001001"whenlie0(6downto0)="0000010"else

"00010100"whenlie0(6downto0)="0000011"else

"00111011"whenlie0(6downto0)="0000100"else

"00000000";

D2<=

"10000000"whenlie0(6downto0)="0000000"else

"00000001"whenlie0(6downto0)="0000001"else

"10001001"whenlie0(6downto0)="0000010"else

"00010100"whenlie0(6downto0)="0000011"else

"00101010"whenlie0(6downto0)="0000100"else

"00000000";

D3<=

"11111111"whenlie0(6downto0)="0000000"else

"11111111"whenlie0(6downto0)="0000001"else

"11111111"whenlie0(6downto0)="0000010"else

"11111100"whenlie0(6downto0)="0000011"else

"00101010"whenlie0(6downto0)="0000100"else

"00000000";

D4<=

"10010000"whenlie0(6downto0)="0000000"else

"00001001"whenlie0(6downto0)="0000001"else

"10001001"whenlie0(6downto0)="0000010"else

"00010010"whenlie0(6downto0)="0000011"else

"11111110"whenlie0(6downto0)="0000100"else

"00000000";

D5<=

"10010000"whenlie0(6downto0)="0000000"else

"00010001"whenlie0(6downto0)="0000001"else

"10001001"whenlie0(6downto0)="0000010"else

"00010001"whenlie0(6downto0)="0000011"else

"00101010"whenlie0(6downto0)="0000100"else

"00000000";

D6<=

"10010000"whenlie0(6downto0)="0000000"else

"00100001"whenlie0(6downto0)="0000001"else

"11111000"whenlie0(6downto0)="0000010"else

"00010000"whenlie0(6downto0)="0000011"else

"00101010"whenlie0(6downto0)="0000100"else

"00000000";

D7<=

"10000000"whenlie0(6downto0)="0000000"else

"00000001"whenlie0(6downto0)="0000001"else

"10000000"whenlie0(6downto0)="0000010"else

"00010000"whenlie0(6downto0)="0000011"else

"00100000"whenlie0(6downto0)="0000100"else

"00000000";

first:

process

begin

waituntilclk='1';

if(d_ff(27downto0)>=2e8)then

d_ff(27downto0)<="0000000000000000000000000000";

else

d_ff(27downto0)<=d_ff+1;

endif;

osc<=notd_ff(10);

osd<=notd_ff(26);

endprocessfirst;

second:

process(osc)

begin

if(osc='1'andosc'eventanden='0')then

ifst1(7downto0)="00000000"orst1(7downto0)="01111111"then

st1(7downto0)<="11111110";data<=d0;

elsifst1(7downto0)="11111110"then

st1(7downto0)<="11111101";data<=d1;

elsifst1(7downto0)="11111101"then

st1(7downto0)<="11111011";data<=d2;

elsifst1(7downto0)="11111011"then

st1(7downto0)<="11110111";data<=d3;

elsifst1(7downto0)="11110111"then

st1(7downto0)<="11101111";data<=d4;

elsifst1(7downto0)="11101111"then

st1(7downto0)<="11011111";data<=d5;

elsifst1(7downto0)="11011111"then

st1(7downto0)<="10111111";data<=d6;

elsifst1(7downto0)="10111111"then

st1(7downto0)<="01111111";data<=d7;

endif;

endif;

endprocesssecond;

third:

process(osd)

begin

if(osd='1'andosd'eventanden='0')then

iflie0(6downto0)="0000100"then

lie0(6downto0)<="0000000";

elselie0(6downto0)<=lie0+1;

endif;

endif;

endprocessthird;

enda;

五.顶层文件电路设计,仿真结果与分析

顶层文件

libraryieee;

useieee.std_logic_1164.all;

useieee.std_logic_Unsigned.all;

useieee.std_logic_ARITH.all;

entityzongis

port(a:

instd_logic_vector(1downto0);

clk:

instd_logic;

hang:

outstd_logic_vector(7downto0);

lie:

outstd_logic_vector(7downto0));

endentityzong;

architectureoneofzongis

componentpengis

port(clk,en:

instd_logic;

lie:

outstd_logic_vector(7downto0);--列

com:

outstd_logic_vector(7downto0));

endcomponent;

componentwengis

Port(

Clk,en:

instd_logic;

lie:

outstd_logic_vector(7downto0);--列

Com:

outstd_logic_vector(7downto0));--行

endcomponent;

signalh1,h2:

std_logic_vector(7downto0);

signall1,l2:

std_logic_vector(7downto0);

begin

u1:

pengportmap(clk=>clk,en=>a

(1),com=>h1,lie=>l1);

u2:

wengportmap(clk=>clk,en=>a(0),com=>h2,lie=>l2);

hang<=h1orh2;

lie<=l1orl2;

endarchitectureone;

六、调试结果

创建工程

在QuartusII中新建一个VHDLFile文件,将vhdl代码输入这个文件,并保存到工作目录,名为zong.vhd。

利用newprejectwizard工具创建一个工程,工程名为zong,顶层文件实体名为zong,并将上面创建的zong.vhd文件加入到工程中。

编译前设置

(1)选择目标芯片。

用assignmemts-→settings命令,弹出settings对话框,选择目标芯片为EP2C5T144C8。

(2)选择工作方式,编程方式,及闲置引脚状态

单击上图中的device&pinoptions按钮,弹出device&pinoptions窗口。

在configuration项中,其下方的Generatecompressedbitstreams处打勾,这样就能产生用于EPCS的POF压缩配置文件。

在Configuration选项页,选择配置器件为EPCS1,其配置模式选择为activeserial。

图3选择编程方式

 

全程编译

设置好前面的内容之后,就可以进行编译了。

选择Processing菜单中startcompilation,在窗口的下方processing栏中显示编译信息。

 

图5全程编译成功完成

完成后在工程管理窗口左是角显示了工程zong的层次结构和其中结构模块耗用的逻辑宏单元数。

此栏的右边是编译处理流程,包括数据网表建立、逻辑综合、适配、配置文件装配和时序分析等。

时序仿真

(1)新建一个矢量波形文件,同时打开波形编辑器。

设置仿真时间为50us,保存波形文件为zong.vwf。

(2)将工程zong的端口信号名选入波形编辑器中

图6选择仿真控制

 

仿真器参数设置。

选择菜单Assignment中的Settings,在Settings窗口下选择Simulator,在右侧的simulationmode项下选择timing,即选择时序仿真,并选择仿真激励文件名zong.vwf。

现在所有设置进行完毕,在菜单processing项下选择startsimulation,直到出现simulationwassuccessful,仿真结束。

仿真文件simulationreport通常会自动弹出,否则选择processing→simulationreport。

 程序调试的时候,要将整个系统程序分成不同的功能块进行调试,最后再加以整合。

元器件清单

器件名称

数量

杜邦线

19根

电阻

10K欧姆

3个

1K欧姆

8个

200欧姆

19个

三极管

9012

8个

9013

8个

芯片FPGA

1个

开关

3个

8*8点阵

1个

硬件电路与FPGA的连接

硬件电路所需接至FPGA的管脚名称

对应可用FPGA管脚

H1

24

H2

26

H3

28

H4

31

H5

40

H6

42

H7

44

H8

47

L1

51

L2

53

L3

57

L4

59

L5

63

L6

65

L7

69

L8

71

K

4

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 党团工作 > 入党转正申请

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1