基于多功能数字钟的课程设计报告.doc_第1页
基于多功能数字钟的课程设计报告.doc_第2页
基于多功能数字钟的课程设计报告.doc_第3页
基于多功能数字钟的课程设计报告.doc_第4页
基于多功能数字钟的课程设计报告.doc_第5页
已阅读5页,还剩7页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

eda技术课程设计多功能数字钟 学院: 城市学院 专业、班级: 姓名: 指导老师: 2015年12月目 录1、设计任务与要求22、总体框图23、选择器件24、功能模块3(1)时钟记数模块3(2)整点报时驱动信号产生模块6(3)八段共阴扫描数码管的片选驱动信号输出模块7(4)驱动八段字形译码输出模块8(5)高3位数和低4位数并置输出模块95、总体设计电路图10(1)仿真图10(2)电路图106、设计心得体会11一、设计任务与要求1、具有时、分、秒记数显示功能,以24小时循环计时。2、要求数字钟具有清零、调节小时、分钟功能。3、具有整点报时,整点报时的同时输出喇叭有音乐响起。二 、总体框图 多功能数字钟总体框图如下图所示。它由时钟记数模块(包括hour、minute、second三个小模块)、驱动8位八段共阴扫描数码管的片选驱动信号输出模块(seltime)、驱动八段字形译码输出模块(deled)、整点报时驱动信号产生模块(alart)。 系统总体框图 三、 选择器件 网络线若干、 共阴八段数码管4个、蜂鸣器、hour(24进制记数器)、minute(60进制记数器)、second(60进制记数器)、alert(整点报时驱动信号产生模块)、seltime(驱动4位八段共阴扫描数码管的片选驱动信号输出模块)、deled(驱动八段字形译码输出模块)。四、功能模块多功能数字钟中的时钟记数模块、驱动8位八段共阴扫描数码管的片选驱动信号输出模块、驱动八段字形译码输出模块、整点报时驱动信号产生模块。 (1) 时钟记数模块:该模块的功能是:在时钟信号(clk)的作用下可以生成波形;在清零信号(reset)作用下,即可清零。vhdl程序如下:第 11 页 共 12 页library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity hour24 isport( clk: in std_logic; reset:instd_logic; qh:buffer std_logic_vector(2 downto 0); ql:buffer std_logic_vector(3 downto 0);end hour24;architecture behav of hour24 isbeginprocess(reset,clk)beginif reset=1 then qh=000; ql=0000; elsif(clkevent and clk=1) then if (qh2) then if (ql=9) then ql=0000; qh=qh + 1; else ql=ql+1; end if; else if (ql=3) then ql=0000; qh=000; else ql=ql+1; end if; end if;end if; end process;end behav;仿真波形如下:vhdl程序如下:library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity min60 is port(reset:in std_logic; load:in std_logic; clk1:in std_logic; clk:in std_logic; co:out std_logic; qh:buffer std_logic_vector(2 downto 0); ql:buffer std_logic_vector(3 downto 0);end min60;architecture behave of min60 is begin process(clk,reset,load) begin if(reset=1) thenqh=000; ql=0000;elsif(load=1) then co=clk1;elsif(clkevent and clk=1) then if(ql=9) thenql=0000;-低4位清零if(qh=5) then qh=000;-高4位清零else qh=qh+1 ;-计数功能的实现; end if; else ql=ql+1;-低4位加1 end if;if(qh=5 and ql=9) then co=1;else co=0;end if;end if;end process;end behave;仿真波形如下: vhdl程序如下:library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity sec60 is port(reset:in std_logic; load:in std_logic; clk1:in std_logic; co:out std_logic; qh:buffer std_logic_vector(2 downto 0); ql:buffer std_logic_vector(3 downto 0);end sec60;architecture behave of sec60 is begin process(clk,reset,load) begin if(reset=1)thenqh=000; ql=0000;elsif(load=1)then co=clk1;elsif(clkevent and clk=1) then if(ql=9)then ql=0000;-低4位清零 if(qh=5) then qh=000;-高4位清零 else qh=qh+1 ;-计数功能的实现; end if; else ql=ql+1;-低4位加1 end if;if(qh=5 and ql=9) then co=1;else co=0;end if;end if ;end process;end behave;波形仿真如下:(2)整点报时驱动信号产生模块该模块功能:在时钟信号(clk)的作用下可以生成波形,speak输出接扬声器,以产生整点报时发声。vhdl程序如下:library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity alert isport(clk:in std_logic;dain:in std_logic_vector(6 downto 0);speak:out std_logic;lamp:out std_logic_vector(2 downto 0);end alert;architecture fun of alert issignal count:std_logic_vector(1 downto 0);signal count1:std_logic_vector(1 downto 0);beginspeaker:process(clk)beginspeak=10)thencount1=00;else count1=count1+1;end if;else count1=00;end if;end if;end process speaker;lamper:process(clk)beginif(clk event and clk=1)then if(dain=1011001) thenif(count=10)thenif(count=00)thenlamp=001;elsif(count=01)thenlamp=010;elsif(count=10)thenlamp=100;end if;count=count+1;else count=00;end if;end if; end if;end process lamper;end fun;波形仿真如下:(3)驱动8位八段共阴扫描数码管的片选驱动信号输出模块vhdl程序如下:library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;use ieee.std_logic_arith.all;entity seltime isport(clk2,reset:in std_logic;hourqh,secqh,minqh:in std_logic_vector(2 downto 0); hourql,minql,secql:in std_logic_vector(3 downto 0);daout:out std_logic_vector(3 downto 0);sel:out std_logic_vector(2 downto 0);end seltime;architecture fun of seltime issignal count:std_logic_vector(2 downto 0);beginsel=count;-选择数码管的那一块process(clk2,reset)beginif(reset=1) then count=101) then count=000;else countdaoutdaout(3)=0;daout(2 downto 0)daoutdaout(3)=0;daout(2 downto 0)daoutdaout(3)=0;daout(2 downto 0)ledledledledledledledledledled null;end case;end process;end fun;波形仿真如下:(5)高3位数和低4位数并置输出模块该模块功能:输入高3位和低4位,并置后以高3位在前第4位在后输出7位。 vhdl源程序如下:library ieee;use ieee.std_logic_1164.all;entity bingzhi isport( qh: in std_logic_vector(2 downto 0); ql: in std_logic_vector(3 downto 0); dain: out std_logic_vector(6 downto 0) );end entity bingzhi;architecture one of bingzhi isbegindain=qh&ql;end architecture one;五、总体设计电路图 仿真是eda技术的重要组成部分,也是对设计的电路进行功能和性能测试的有效手段。eda工具提供了强大且与电路实时行为相吻合的精确硬件系统测试工具。在建立了波形文件、输入信号节点、波形参数、加输入信号激励电平并存盘之后,选择主菜单“max+plusii”中的仿真器项“simulator”,弹出对话框之后单击“start”进行仿真运算,完成之后就可以看到时序波形。图为总电路的时序图。总体框图的时序仿真图如下总体(顶层)电路原理图如下 接线:输入接口:1、代表清零,调时,调分信号reset、sethour、setmin的管脚分别连接按键开关。2、代表记数时钟信号clk、clk1和扫描时钟信号clk2的管脚分别同1hz时钟源和32hz(或更高)时钟源相连。输出接口:1、代表扫描显示的驱动信号管脚sel2,sel1,sel0的管脚同四位扫描驱动地址的低3位相连,最高位地址接“0”(也可以悬空);代表7段字码驱动信号a,b,c,d,e,f,g的管脚分别同扫描数码管的段输入a,b,c,d,e,f,g相连。2、代表扬声器驱动信号的管脚speak同扬声器驱动接口speaker相连。 3、代表花样led灯显示的信号管脚lamp0,lamp1,lamp2同3个led灯相连。六、设计心得体会 作为电子信息工程的一名学生,理论课上学到的知识,理论性太强,根本理解不透彻,学以致用,在实践中去

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论