EDA实习报告.docx
- 文档编号:10792070
- 上传时间:2023-02-22
- 格式:DOCX
- 页数:14
- 大小:253.42KB
EDA实习报告.docx
《EDA实习报告.docx》由会员分享,可在线阅读,更多相关《EDA实习报告.docx(14页珍藏版)》请在冰豆网上搜索。
EDA实习报告
贵州师范大学学生
实习报告
科目:
EDA实习
专业:
电气工程及其自动化
班级:
10电气
姓名:
李启应
学号:
101401010202
实验项目名称:
数字电子钟的设计
实验项目性质:
普通试验
所属课程名称:
VHDL程序设计
一、实验目的
1学习VHDL语言的一些基本特点。
2掌握VHDL程序的基本结构。
3掌握VHDL程序设计方法。
4要能够用vhdl语言读懂并编写eda程序,对eda设计的总体框架能有较好的把握,掌握各模块的调用方式。
二、实验内容和要求
设计一个数字时钟,显示时(2位),分(2位),秒(2位),具体要求是:
具有时分秒计数显示功能,以24小时循环计时;数码管动态显示时,分,秒;具有清零功能。
在软件工具平台上,进行VHDL语言的各模块编程输入、编译实现和仿真验证。
三、实验主要仪器设备和材料
计算机,开发环境MAX-PLUSII,ZY11EDA实验系统,VHDL语言。
四、实验方法、步骤及结果测试
1、设计思路:
数字钟的主体是计数器,它记录并显示接收到的秒脉冲个数,其中秒和分位60进制计数器,小时为24进制计数器,分别产生3位BCD码。
BCD码经译码,驱动后接数码显示电路。
根据实验要求,将设计分为5个主要部分,时功能模块、分功能模块、秒功能模块、扫描仪功能模块和7段LED功能模块。
在时、分、秒模块中,包括复位和预置数,其主要思路如下:
秒钟的模块:
设计一个60进制的计数器,以clk为其时钟信号,每60个clk后产生一个进位信号CF给分钟模块,作为分钟进程的响应信号。
秒钟模块VHDL程序见附录1:
仿真波形如下:
封装如下图:
分钟的模块:
同理于秒钟的模块,设计一个60进制的计数器,以CFM为其时钟信号,每60个CFM后产生一个进位信号CFM给小时模块,作为小时模块进程的响应信号。
分钟模块VHDL程序见附录二:
仿真波形如下:
封装如下图:
小时的模块:
为24进制计数器,在分的进位信号CFM的激发下计数,从0到23的时候产生一个信号CFH,全部清0,重新开始计时。
小时模块VHDL程序见附录三:
仿真波形如下:
封装如下图:
扫描仪模块:
在扫描仪内部,有一个3-8译码器的片选信号,当3-8译码器的片选信号为000时,片选信号选中7段LED模块中的秒的个位,当3-8译码器的片选信号为001时,片选信号选中7段LED模块中的秒的十位,当3-8译码器的片选信号为010时,片选信号选中7段LED模块中的分的个位,当3-8译码器的片选信号为011时,片选信号选中7段LED模块中的分的十位,当3-8译码器的片选信号为100时,片选信号选中7段LED模块中的时的个位,当3-8译码器的片选信号为101时,片选信号选中7段LED模块中的时的十位,就这样动态扫描,当输入的时钟信号频率很高的时候,就形成了我们的时钟。
扫描仪模块VHDL程序见附录四:
仿真波形如下:
封装如下图:
7段LED模块:
根据动态扫描仪的片选信号来依次点亮我们所需的时间。
7段LED模块VHDL程序见附录五:
仿真波形如下:
封装如下图:
综合以上5大模块,把它们用线连接起来就得到我们的总的电路图:
如下图所示:
其工作原理为:
扫描仪3-8译码器的片选信号根据时分秒的输入选中7段LED模块,然后再由时分秒中产生的3位BCD码来输出秒的个位,十位、时的个位,十位、小时的个位,十位。
4.总结:
在实验这两周的时间里,我们做过DC触发器、DQ触发器、3-8译码器、二选一电路和四选一电路等,最后综合做了数字时钟电路,通过这次实习,我对用VHDL来编程有了更深的了解,在要编程的时候,我学会了分模块进行,因为一开始的时候设计一个时钟系统比较麻烦,没有分模块之前总是会有差错,而之后思路就会比较清晰,有明确的方案,在对照书本里的编程规则与语句,就完成了这次的设计,总之就是获益良多。
附录1:
秒钟模块VHDL程序
libraryieee;
useieee.std_logic_1164.all;
useieee.std_logic_unsigned.all;
entitysecondis
port(clk,reset:
instd_logic;
cf:
outstd_logic;
second1_out:
outstd_logic_vector(3downto0);
second10_out:
outstd_logic_vector(2downto0));
endentitysecond;
architectureoneofsecondis
signalsecond1n:
std_logic_vector(3downto0);
signalsecond10n:
std_logic_vector(2downto0);
begin
second1_out<=second1n;
second10_out<=second10n;
process(clk,reset)
begin
if(reset='1')then
second1n<="0000";
second10n<="000";
elsif(clk'eventandclk='1')then
if(second1n="1001")then
second1n<="0000";
if(second10n="101")then
second10n<="000";
cf<='1';
elsesecond10n<=second10n+1;
endif;
elsesecond1n<=second1n+1;
endif;
endif;
endprocess;
endarchitectureone;
附录二:
分钟模块VHDL程序
libraryieee;
useieee.std_logic_1164.all;
useieee.std_logic_unsigned.all;
entityminuteis
port(clk,reset:
instd_logic;
cf:
outstd_logic;
minute1_out:
outstd_logic_vector(3downto0);
minute10_out:
outstd_logic_vector(2downto0));
endentityminute;
architectureoneofminuteis
signalminute1n:
std_logic_vector(3downto0);
signalminute10n:
std_logic_vector(2downto0);
begin
minute1_out<=minute1n;
minute10_out<=minute10n;
process(clk,reset)
begin
if(reset='1')then
minute1n<="0000";
minute10n<="000";
elsif(clk'eventandclk='1')then
if(minute1n="1001")then
minute1n<="0000";
if(minute10n="101")then
minute10n<="000";
cf<='1';
elseminute10n<=minute10n+1;
endif;
elseminute1n<=minute1n+1;
endif;
endif;
endprocess;
endarchitectureone;
附录三:
小时模块VHDL程序
libraryieee;
useieee.std_logic_1164.all;
useieee.std_logic_unsigned.all;
entityhouris
port(clk,reset:
instd_logic;
hour1_out:
outstd_logic_vector(3downto0);
hour10_out:
outstd_logic_vector(1downto0));
endentityhour;
architectureoneofhouris
signalhour1n:
std_logic_vector(3downto0);
signalhour10n:
std_logic_vector(1downto0);
begin
hour1_out<=hour1n;
hour10_out<=hour10n;
process(clk,reset)
begin
if(reset='1')then
hour1n<="0000";
hour10n<="00";
elsif(clk'eventandclk='1')then
if(hour1n="1001"or(hour1n="0011"andhour10n="0010"))then
hour1n<="0000";
if(hour10n="10")then
hour10n<="00";
elsehour10n<=hour10n+1;
endif;
elsehour1n<=hour1n+1;
endif;
endif;
endprocess;
endarchitectureone;
附录四:
扫描仪模块VHDL程序
libraryieee;
useieee.std_logic_1164.all;
useieee.std_logic_unsigned.all;
useieee.std_logic_arith.all;
entitysaomiaoyiis
port(clk:
instd_logic;
reset:
instd_logic;
second1,minute1,hour1:
instd_logic_vector(3downto0);
second_10,minute_10:
instd_logic_vector(2downto0);
hour_10:
instd_logic_vector(1downto0);
dataout:
outstd_logic_vector(3downto0);
sel:
outstd_logic_vector(2downto0));
endentitysaomiaoyi;
architectureoneofsaomiaoyiis
signalcount:
std_logic_vector(2downto0);
begin
sel<=count;
process(clk,reset)
begin
if(reset='1')then
dataout<="0000";
elsif(clk'eventandclk='1')then
ifcount>="101"then
count<="000";
else
count<=count+1;
endif;
endif;
casecountis
when"000"=>dataout<=second1;
when"001"=>dataout<='0'&second_10;
when"010"=>dataout<=minute1;
when"011"=>dataout<='0'&minute_10;
when"100"=>dataout<=hour1;
whenothers=>dataout<="00"&hour_10;
endcase;
endprocess;
endarchitectureone;
附录五:
7段LED模块VHDL程序
LIBRARYIEEE;
USEIEEE.STD_LOGIC_1164.ALL;
ENTITYled_7IS
PORT(A:
INSTD_LOGIC_VECTOR(3DOWNTO0);
LED7S:
OUTSTD_LOGIC_VECTOR(6DOWNTO0));
ENDentityled_7;
ARCHITECTUREoneOFled_7IS
BEGIN
PROCESS(A)
BEGIN
CASEA(3DOWNTO0)IS
WHEN"0000"=>LED7S<="0111111";--X"3F"0
WHEN"0001"=>LED7S<="0000110";--X"06"1
WHEN"0010"=>LED7S<="1011011";--X"5B"2
WHEN"0011"=>LED7S<="1001111";--X"4F"3
WHEN"0100"=>LED7S<="1100110";--X"66"4
WHEN"0101"=>LED7S<="1101101";--X"6D"5
WHEN"0110"=>LED7S<="1111101";--X"7D"6
WHEN"0111"=>LED7S<="0000111";--X"07"7
WHEN"1000"=>LED7S<="1111111";--X"7F"8
WHEN"1001"=>LED7S<="1101111";--X"6F"9
WHENOTHERS=>NULL;
ENDCASE;
ENDPROCESS;
ENDARCHITECTUREone;
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- EDA 实习 报告
![提示](https://static.bdocx.com/images/bang_tan.gif)