EDA实验报告60S电子闹钟

上传人:新** 文档编号:460283469 上传时间:2023-08-04 格式:DOC 页数:10 大小:193.20KB
返回 下载 相关 举报
EDA实验报告60S电子闹钟_第1页
第1页 / 共10页
EDA实验报告60S电子闹钟_第2页
第2页 / 共10页
EDA实验报告60S电子闹钟_第3页
第3页 / 共10页
EDA实验报告60S电子闹钟_第4页
第4页 / 共10页
EDA实验报告60S电子闹钟_第5页
第5页 / 共10页
点击查看更多>>
资源描述

《EDA实验报告60S电子闹钟》由会员分享,可在线阅读,更多相关《EDA实验报告60S电子闹钟(10页珍藏版)》请在金锄头文库上搜索。

1、 EDA实验报告 题 目 60秒电子闹钟 学 院 电子工程学院 专 业 学生姓名 导师姓名 初秀琴 一 功能描述电路上电后自动计时,到达预置的闹响时刻后,由扬声器发出音乐报警。闹响时刻可利用DIP开关设置,两位数:059。二 设计思路电路主要由分频器、M60计数器、闹铃电路、显示电路等部分组成。秒信号脉冲可由分频器产生,用DIP开关设置闹响时刻,当M60计数器的输出与设置的闹响时刻相等时,闹铃电路输出脉冲驱动扬声器发出音乐报警。总体设计思路如图1所示:七段显示扬声器显示电路DIP开关闹铃电路M60计数器高频脉冲分频器图1 总体设计思路三 功能模块1 分频器程序代码如下:library ieee

2、;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity devide isport(clk:in std_logic; -输入时钟clk_out:out std_logic -输出信号);end devide;architecture arc_devide of devide issignal count:std_logic_vector (14 downto 0); -定义内部信号beginprocessbeginwait until clkevent and clk=1;if(count32767)then -

3、改变最大计数值即可得到不同的分频系数count=count+1;clk_out=1;end if;end process;end architecture arc_devide;符号图如图2所示:图2 分频器符号图2 M60计数器程序代码如下:library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity bcd_m60 isport (CLK:in std_logic;EN:in std_logic;CR:in std_logic;QL,QH:out std_logic_vector(3 down

4、to 0) -8421BCD码个位、十位输出);end bcd_m60;architecture behav of bcd_m60 issignal couL,couH:std_logic_vector(3 downto 0);beginprocess(CR,CLK)beginif CR=0 then -异步复位couL=0000;couH=0000;elsif clkevent and clk=1 then if EN=1 then if (couL=9 and couH=5) then -个位计到9十位计到5回零couL=0000;couH=0000;elsif couL=9 then -

5、个位计到9回零十位加1couL=0000;couH=couH+1;elsecouL=couL+1; -否则个位加1end if;end if;end if;end process;QL=couL;QH=couH;end behav;符号图如图3所示:图3 M60计数器符号图仿真波形如图4所示:图4 M60计数器仿真波形经分析,M60计数器仿真波形正确。3 闹铃电路程序代码如下:library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity alert isport (STOP:in std_logi

6、c; -控制是否响铃CLK:in std_logic;DIPL,DIPH:in std_logic_vector(3 downto 0);QL,QH:in std_logic_vector(3 downto 0);SPEAK:out std_logic);end alert;architecture behav of alert isbeginprocess(STOP,CLK,QL,QH)beginif STOP=0 then SPEAK=0;elsif QL=DIPL and QH=DIPH then -输出脉冲驱动扬声器SPEAK tmp tmp tmp tmp tmp tmp tmp t

7、mp tmp tmp tmp tmp tmp tmp tmp tmp null;end case;end process;a=tmp(6);b=tmp(5);c=tmp(4);d=tmp(3);e=tmp(2);f=tmp(1);g=tmp(0);end arc;符号图如图6所示:图6 显示电路符号图四 总体仿真顶层文件原理图如图7所示:图7 顶层文件原理图仿真波形如图8所示:如图8所示,当M60计数器计数与置入时刻相等时,SPEAKOUT为脉冲,驱动扬声器发声,从而实现报警。五 心得体会学习quartus II 的使用花了相当长的时间,虽然最后做出来的电路比较简单,但感觉很有成就感,因为这是我慢慢摸索得到的成果。10

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 大杂烩/其它

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号