VHDL数字秒表设计.docx
- 文档编号:30320546
- 上传时间:2023-08-13
- 格式:DOCX
- 页数:15
- 大小:61.86KB
VHDL数字秒表设计.docx
《VHDL数字秒表设计.docx》由会员分享,可在线阅读,更多相关《VHDL数字秒表设计.docx(15页珍藏版)》请在冰豆网上搜索。
VHDL数字秒表设计
课程设计(综合实验)报告
(2014--2015年度第一学期)
名称:
EDA技术及应用—VHdl版
题目:
数字秒表的设计
院系:
班级:
学号:
学生姓名:
指导教师:
设计周数:
成绩:
日期:
2015年1月21日
《VHDL语言与数字系统设计》课程设计
任务书
一、目的与要求
本课程设计是学生在完成数字电子技术基础课程的学习后,使用VHDL硬件描述语言件进行数字系统设计的实践课程。
并进一步理解基于QUARTUS软件进行VHDL数字系统设计的一般流程,掌握VHDL语言的基本语法,掌握典型组合逻辑电路和典型时序逻辑电路的基本模块描述方法。
从而能够独立开发小系统的数字系统设计。
二、主要内容
1.VHDL的基本知识:
实体,结构体,数据类型,对象.
2.VHDL的描述方法:
行为描述,数据流描述,结构描述.
3.组合逻辑电路和时序逻辑电路的VHDL模型
4.QUARTUS软件的基本使用方法
5.数字系统设计实例
三、进度计划
序号
设计(实验)内容
完成时间
备注
1
语法介绍
第1-2天
2
全加器,半加器设计和调试
第3天
3
数字综合系统设计
第4-8天
4
撰写实验报告
第9-10天
四、设计(实验)成果要求
1.熟练运用Quartus完成数字系统设计的一般流程。
2.完成电子综合系统的VHDL描述,编译,以及功能仿真验证,包括数字秒表,交通信号灯,数字钟,密码锁,拔河器,抢答器,彩灯显示等小系统的编译和仿真
3.完成实验报告总结
五、考核方式
1.口头答辩+2.现场演示+3.书面报告
学生姓名:
指导教师:
年月日
目录
一、课程设计(综合实验)的目的与要求;。
。
。
。
。
。
。
。
。
。
。
。
。
。
。
。
。
。
第3页
二、设计(实验)正文;。
。
。
。
。
。
。
。
。
。
。
。
。
。
。
。
。
。
。
。
。
。
。
。
。
第4页
三、课程设计(综合实验)总结或结论;。
。
。
。
。
。
。
。
。
。
。
。
。
。
。
。
。
。
第13页
四、参考文献。
。
。
。
。
。
。
。
。
。
。
。
。
。
。
。
。
。
。
。
。
。
。
。
。
。
。
。
。
。
第14页
一、课程设计(综合实验)的目的与要求
1.设计思路分析
1.1秒表输出分析。
秒表共有6个输出显示,分别为百分之一秒、十分之一秒、秒、十秒、分,十分,所以共有六个计数器与之对应,六个计数器的输出全部为BCD码,这样可以和显示译码器链接,当计时达到60分钟后蜂鸣器响10下。
1.2秒表的控制端。
秒表要能实现随时启动、暂停和归零,因此需要有相关的驱动信号和归零信号。
1.3秒表计时的实现。
首先需要获得精确的100HZ计时脉冲,以及各计数器之间的链接,实现进位;每一个计数器的码要通过转换实现在数码显示管上显示。
二、设计(实验)正文
1.相关程序
1.1产生100HZ的时钟源程序。
libraryieee;
useieee.std_logic_1164.all;
entitydivis
port(clk,clr:
instd_logic;
q:
bufferstd_logic);
endentitydiv;
architectureartofdivis
signalcount:
integerrange0to10#29999#;
begin
process(clr,clk)
begin
ifclk'eventandclk='1'then
ifclr=’1’thencount<=0;
elsifcount=29999thencount<=0;
count<=0;
q<=notq;
elsecount<=count+1;
endif;
endif;
endprocess;
endarchitectureart;
1.2十进制计数器-
libraryieee;
useieee.std_logic_1164.all;
useieee.std_logic_unsigned.all;
useieee,std_logic_arith.all;
entitycount10is
port(clk,clr,start:
instd_logic;
daout:
bufferstd_logic_vector(3downto0);
cout:
outstd_logic);
endcount10;
architecturebehaveofcount10is
begin
process(clk,clr,start)
begin
ifclr='1'thendaout<="0000";cout<='0';
elsifclk'eventandclk='1'then
ifstart='1'then
ifdaout="1001"thendaout<="0000";cout<='1';
elsedaout<=daout+1;cout<='0';
endif;
endif;
endif;
endprocess;
endbehave;
1.3六进制计数器
libraryieee;
useieee.std_logic_1164.all;
useieee.std_logic_unsigned.all;
useieee.std_logic_arith.all;
entitycount6is
port(clk,clr,start:
instd_logic;
daout:
bufferstd_logic_vector(3downto0);
cout:
outstd_logic);
endcount6;
architecturebehaveofcount6is
begin
process(clk,start,clr)
begin
ifclr='1'thendaout<="0000";
elsifclk‘eventandclk=’1’then
ifstart=’1’then
ifdaout="0101"thendaout<="0000";cout<='1';
elsedaout<=daout+1;cout<='0';
endif;
endif;
endif;
endprocess;
endbehave;
1.4控制电路
libraryieee;
useieee.std_logic_1164.all;
useieee.std_logic_unsigned.all;
useieee.std_logic_aruth.all;
entityseltimeis
port(clr,clk:
instd_logic;
dain1:
instd_logic_vector(3downto0);
dain2:
instd_logic_vector(3downto0);
dain3:
instd_logic_vector(3downto0);
dain4:
instd_logic_vector(3downto0);
dain5:
instd_logic_vector(3downto0);
dain6:
instd_logic_vector(3downto0);
sel:
outstd_logic_vector(2downto0);
daout:
outstd_logic_vector(3downto0));
endseltime;
architecturebehaveofseltimeis
signalcount:
std_logic_vector(2downto0);
begin
sel<=count;
process(clk,clr)
begin
ifclr='1'thencount<="000";
elsifclk‘eventandclk=’1’then
ifcount=”110”thencount<=”000”;
elsecount<=count+1;
endif;
endif;
casecountis
when“001”=>daout<=dain1;
when“010”=>daout<=dain2;
when“011”=>daout<=dain3;
when“100”=>daout<=dain4;
when“101”=>daout<=dain5;
when“110”=>daout<=dain6;
whenothers=>null;
endcase;
endprocess;
endbehave;
1.5译码器
libraryieee;
useieee.std_logic_1164.all;
useieee.std_logic_unsigned.all;
useieee.std_logic_arith.all;
entityymis
port(num:
instd_logic_vector(3downto0);
led:
outstd_logic_vector(6downto0));
endym;
architecturebehaveofymis
begin
process(num)
--abcdef
begin
casenumis
when"0000"=>led<="1111110";
when"0001"=>led<="0110000";
when"0010"=>led<="1101101";
when"0011"=>led<="1111011";
when"0100"=>led<="0110011";
when"0101"=>led<="1011011";
when"0110"=>led<="1011111";
when"0111"=>led<="1110000";
when"1000"=>led<="1111111";
when"1001"=>led<="1111011";
whenothers=>null;
endcase;
endprocess;
endbehave;
1.6蜂鸣器
libraryieee;
useieee.std_logic_1164.all;
useieee.std_logic_unsigned.all;
useieee.std_logic_arith.all;
entityalarmis
port(clk,i:
instd_logic;
q:
outstd_logic);
endalarm;
architecturebehaveofalarmis
signalcount:
integerrange0to20;
signalq0:
std_logic;
begin
process(clk,i)
begin
ifclk'eventandclk='1'then
ifi='0'thenq0<='0';count<=0;
elsifi=’1’then
ifcount<=19thencount<=count+1;
q0<=notq0;
endif;endif;endif;
endprocess;
q<=q0;
endbehave;
1.7整体例化程序
libraryieee;
useieee.std_logic_1164.all;
useieee.std_logic_arith.all;
useieee.std_logic_unsigned.all;
entitymb_topis
port(stop,start,clk:
instd_logic;
sel:
outstd_logic_vector(2downto0);
a,b,c,d,e,f,g:
outstd_logic;
speaker:
outstd_logic);
endmb_top;
architecturegoodofmb_topis
componentdiv
port(clr,clk:
instd_logic;
q:
bufferstd_logic);
endcomponent;
componentcount10
port(clr,start,clk:
instd_logic;
cout:
outstd_logic;
daout:
bufferstd_logic_vector(3downto0));
endcomponent;
componentcount6
port(clr,start,clk:
instd_logic;
cout:
outstd_logic;
daout:
bufferstd_logic_vector(3downto0));
endcomponent;
componentseltime
port(clr,clk:
instd_logic;
dain1:
instd_logic_vector(3downto0);
dain2:
instd_logic_vector(3downto0);
dain3:
instd_logic_vector(3downto0);
dain4:
instd_logic_vector(3downto0);
dain5:
instd_logic_vector(3downto0);
dain6:
instd_logic_vector(3downto0);
sel:
outstd_logic_vector(2downto0);
daout:
outstd_logic_vector(3downto0));
endcomponent;
componentym
port(num:
instd_logic_vector(3downto0);
led:
outstd_logic_vector(6downto0));
endcomponent;
componentalarm
port(clk,i:
instd_logic;
q:
outstd_logic);
endcomponent;
signaldiv_q,b_cout,s_cout,m_cout,sm_cout,f_cout,sf_cout:
std_logic;
signalb_daout,s_daout,m_daout,sm_daout,f_daout,sf_daout,seltime_daout:
std_logic_vector(3downto0);
signalledout:
std_logic_vector(6downto0);
begin
a<=ledout(0);b<=ledout
(1);c<=ledout
(2);d<=ledout(3);e<=ledout(4);f<=ledout(5);g<=ledout(6);
u1:
divportmap(stop,clk,div_q);
u2:
count10portmap(stop,start,div_q,b_cout,b_daout);
u3:
count10portmap(stop,start,b_cout,s_cout,s_daout);
u4:
count10portmap(stop,start,s_cout,m_cout,m_daout);
u5:
count6portmap(stop,start,m_cout,sm_cout,sm_daout);
u6:
count10portmap(stop,start,sm_cout,f_cout,f_daout);
u7:
count6portmap(stop,start,f_cout,sf_cout,sf_daout);
u8:
seltimeportmap(stop,div_q,b_daout,s_daout,m_daout,sm_daout,f_daout,sf_daout,sel,seltime_daout);
u9:
ymportmap(seltime_daout,ledout);
u10:
alarmportmap(div_q,sf_cout,speaker);
endgood;
2.相应显示波形
2.1十进制波形
2.2六进制波形
2.3数码管
2.4选择器
三、课程设计(综合实验)总结或结论
通过本次的课程设计,我初步了解了VHDL语言的编程思想,以及利用VHDL软件进行电子电路设计的方法,通过对一个课题的分析,将实验内容进行分块解读,具体到每一个模块的具体作用,然后将各个功能的模块通过VHdl语言进行组合,然后需要在程序编译成功的基础上,进行仿真。
此次课程设计让自己发现了不少盲点,对于基础知识的掌握不太牢靠,相关语言不能熟练使用,需要在今后的学习中不断加强,积极实践。
四、参考文献
EDA技术及应用——VHDL版,作者,谭会生,张昌凡;
XX文库
数字电子技术基础,
附录(设计流程图、程序、表格、数据等)
注:
根据课程设计、综合实验的内容将标题任选其一。
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- VHDL 数字 秒表 设计
![提示](https://static.bdocx.com/images/bang_tan.gif)