FPGA实验报告1.docx
《FPGA实验报告1.docx》由会员分享,可在线阅读,更多相关《FPGA实验报告1.docx(6页珍藏版)》请在冰点文库上搜索。
FPGA实验报告1
武汉工程大学
电气信息学院
《FPGA与硬件描述语言》实验报告[1]
专业班级
13电信01班
实验时间
2015年10月12日
学生学号
1304201426
实验地点
4B315
学生姓名
曾维颖
指导教师
曹新莉
实验项目
闪烁的LED
实验类别
基础实验
实验学时
4学时
实验目的及要求
1.掌握QuartusII设计电路的基本流程,熟悉VHDL程序,分别设计分频电路,LED闪烁延时计数程序。
2.将设计好的LED闪烁电路程序下载到DEII开发板上进行实物测试。
成绩评定表
类别
评分标准
分值
得分
合计
上机表现
按时出勤、遵守纪律
认真完成各项实验内容
30分
报告质量
程序代码规范、功能正确
填写内容完整、体现收获
70分
说明:
评阅教师:
日期:
2015年月日
实验内容
(说明:
此部分应包含:
实验内容、实验步骤、实验数据与分析过程等)
一、实验内容
1.用VHDL语言设计分频器,得到0.1Hz——1Hz的时钟信号;
2.设计闪烁延时程序,控制发光二极管的闪烁。
二、实验方法与步骤
分频电路的产生
1.分频原理:
(50MHz晶振信号怎样分频成你所需要的低频信号。
)
50MHz=50×100×100×100Hz,这样就需要1个50Hz分频器,3个100Hz分频器
2.50分频器:
源程序如下(记作cnt50)
libraryieee;
useieee.std_logic_1164.all;
useieee.std_logic_unsigned.all;
entitycnt50is
port(clk:
instd_logic;
en:
instd_logic;
clr:
instd_logic;
cout:
outstd_logic;
q:
bufferstd_logic_vector(5downto0));
endcnt50;
architectureoneofcnt50is
begin
process(clk,clr)begin
ifclr='1'thenq<="000000";
elsifclk'eventandclk='1'then
ifen='1'thenifq="110001"
thenq<="000000";
elseq<=q+1;
endif;endif;endif;
ifq="110001"
thencout<='1';elsecout<='0';
endif;
endprocess;
endone;
3.100分频器:
(记作cnt100)
源程序:
libraryieee;
useieee.std_logic_1164.all;
useieee.std_logic_unsigned.all;
entitycnt100is
port
(clk:
instd_logic;
en:
instd_logic;
clr:
instd_logic;
cout:
outstd_logic;
q:
bufferstd_logic_vector(6downto0));
endcnt100;
architectureoneofcnt100is
begin
process(clk,clr)begin
ifclr='1'thenq<="0000000";
elsifclk'eventandclk='1'then
ifen='1'thenifq="1100011"
thenq<="0000000";
elseq<=q+1;
endif;endif;endif;
ifq="1100011"
thencout<='1';elsecout<='0';
endif;
endprocess;
endone;
4.LED闪烁定时电路:
源程序:
libraryieee;
useieee.std_logic_1164.all;
useieee.std_logic_unsigned.all;
entitycnt5is
port
(clk:
instd_logic;
en:
instd_logic;
clr:
instd_logic;
cout:
outstd_logic;
q:
bufferstd_logic_vector(2downto0));
endcnt5;
architectureoneofcnt5is
begin
process(clk,clr)begin
ifclr='1'thenq<="000";
elsifclk'eventandclk='1'then
ifen='1'thenifq="100"
thenq<="000";
elseq<=q+1;
endif;endif;
endif;
ifq="100"
thencout<='1';elsecout<='0';
endif;
endprocess;
endone;
5.顶层文件,将所有底层原件集成为顶层设计文件:
三、实验数据与结果分析
t50波形图
t100波形图
实验总结
(说明:
总结实验认识、过程、效果、问题、收获、体会、意见和建议。
)