I
摘要 ...................................................................................................................................................I
Abstract.............................................................................................................................................II
1.引言 ...............................................................................................................................................0
2.设计要求 .......................................................................................................................................0
3.模块电路设计原理 .......................................................................................................................2
3.1. .........................................................................................................................................2
3.1.1 顶层模块元件图 .....................................................................................................2
3.1.2 顶层模块设计原理 .................................................................................................2
3.2PLL 模块...............................................................................................................................6
3.2.1PLL 模块元件图........................................................................................................6
3.2.2PLL 模块设计原理....................................................................................................6
3.3 显示彩条模块 ....................................................................................................................9
3.3.1 显示彩条模块元件图 .............................................................................................9
3.3.2 显示彩条模块设计原理 .........................................................................................9
4.VGA 顶层原理图 .........................................................................................................................17
5.设计小结 .....................................................................................................................................17
附录 1:作品实物图片 .................................................................................................................18
附录 2:源程序 .............................................................................................................................19
II
摘要
VHDL 主要用于描述数字系统的结构,行为,功能和接口。除了含有许多具
有硬件特征的语句外,VHDL 的语言形式、描述风格以及语法是十分类似于一般
的。VHDL 的程序结构特点是将一项工程设计,或称设计实体(可以是一个元件,
一个电路模块或一个系统)分成外部(或称可视部分,及端口)和内部(或称不可
视部分),既涉及实体的内部功能和算法完成部分。在对一个设计实体定义了外
部界面后,一旦其内部开发完成后,其他的设计就可以直接调用这个实体。这种
将设计实体分成内外部分的概念是 VHDL 系统设计的基本点。
本次设计是用 VHDL 语言设计 VGA 驱动电路,并用 Quartus II 仿真。
关键词:VHDL VGA 驱动电路 Quartus II
III
Abstract
VHDL is mainly used to describe the structure, behavior, function,
and interface of digital systems. In addition to containing many
statements with hardware characteristics, VHDL's language form,
description style, and syntax are very similar to general. The program
structure of VHDL is characterized by dividing an engineering design, or
design entity (which can be a component, a circuit block or a system),
into external (or visible part, and port) and internal (or invisible part),
which involves both the internal function of the entity and the algorithm
completion part. After defining an external interface for a design entity,
other designs can call the entity directly once its internal development
is complete. This concept of dividing the design entity into inner and
outer parts is the fundamental point of VHDL system design.
The design was designed in the VHDL language and simulated with Quartus
II.
Keywords: VHDL VG drive circuit Quartus II
0
1.引言
我们在用 VGA 实现 VGA 驱动的时候,只需要按照 VGA 的时序生成 R、G、B、行同
步信号和场同步信号就可以实现 VGA 的驱动,这里需要注意我们这里的 VGA 信号
是模拟信号,但我们用 FPGA 生成的是数据信号,所以我们需要将数字信号转换
成模拟信号。目前,可编程逻辑器件 FPGA 以其开发周期短、成本低、功耗低、
可靠性高等优势,广泛应用于通信、航空、医疗等领域,近年来在消费电子领域
中的应用也日渐增加。为进一步挖掘 FPGA 在家庭娱乐如游戏机开发与应用中的
巨大商机,介绍了一款以 Altera 公司 FPGA 芯片为控制核心,附加少量外围电路
组成的乒乓球比赛游戏机。整个系统设计模块划分清晰:包括时钟分频模块,计
分模块,状态机模块等;其功能有:包括发球权控制、犯规则对方得分、比分显
示等,模拟实际乒乓球比赛相似程度比较高。采用了 VHDL 语言编程实现,在
QuartusⅡ13.0 集成环境下进行了模拟仿真,结果表明在设定的比赛规则下,
游戏机运行正常,通过进一步优化可将其商品化,推入市场。
2.设计要求
设计一个简单的 VGA 显示驱动电路,采用 640×480 的分辨率,刷新频率为 60Hz。通
过矩阵键盘切换多种显示图形。当然,也可以自行改变显示内容
3.模块电路设计原理
3.1.顶层模块
3.1.1 模块元件图
(1)其元件图如下: