ImageVerifierCode 换一换
格式:DOCX , 页数:16 ,大小:26.31KB ,
资源ID:9239537      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/9239537.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(多功能数字电子钟 VHDL.docx)为本站会员(b****7)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

多功能数字电子钟 VHDL.docx

1、多功能数字电子钟 VHDLVHDL课程设计实验报告 多功能数字电子钟 姓 名: 班 级: 学 号: 指导老师: 成 绩: 完成时间:2008年1月4日 星期五 完成地点:502机房 一、实验目的 1.学习数字系统设计的自顶向下设计法及控制器的设计。 2.加深利用EDA技术实现数字系统的体会。 二、实验仪器及器件 台)微机(11套) 2.1.EDA 开发软件( 其他器件与材料(若干) 4.实验开发系统(1台)3.三、实验要求及设计方案 1.设计一个具有24进制计时、显示、整点报时、时间设置和闹钟功能的数字钟,要求时钟的最小分辨率时间为1s。 2.数字钟的设计方案如下: 系统输入:mode为计时显

2、示和闹钟定时显示转换输入;set为校时和定时设置的时、分、秒转换输入;k为校时和定时设置的时、分、秒手动加1输入;clk为时钟信号;reset为系统复位信号。输入信号均由按键产生。 系统输出:LED显示输出;蜂鸣器(bell)声音信号输出。 3.多功能数字钟系统功能的具体描述如下: 计时:正常工作状态下,每日按24小时计时制计时并显示,蜂鸣器逢整点报时。 校时:在计时显示状态下,按下“set键”,进入“小时”校时状态,再次按下“set键”,进入“分”校时状态,继续按下“set键”,进入“秒”校时状态,第四次按下“set键”又回复到正常计时显示状态。 1)“小时”校时状态:进入“小时”校时状态后

3、,显示“小时”的数码管闪烁,每按动“k” 键一次,“小时”+1,若不按动“k”键则小时数不变,一直按下“k” 键则小时数一4Hz的频率递增计数。 2)“分”校时状态:进入“分”校时状态后,显示“分”的数码管闪烁,每按动“k” 键一次,“分”+1,若不按动“k”键则分数不变,一直按下“k” 键则分数一4Hz的频率递增计数。 3)“秒”校时状态:进入“秒”校时状态后,显示“秒”的数码管闪烁,每按动“k” 键一次,“秒”+1,若不按动“k”键则秒数不变,一直按下“k” 键则秒数一4Hz的频率递增计数。 整点报时:蜂鸣器在“59”分钟的第51、53、55、57秒发出频率为512Hz的低音,在“59”秒

4、发出频率为1024Hz的高音,结束时为整点。 显示:采用8个LED数码管分别显示时、分、秒并且他们之间用“”隔开。 闹钟:闹钟定时时间到,蜂鸣器发出周期为1s的滴、滴声, 秒;闹钟定时显示。10持续时间为,进入“小键”在闹钟显示状态下,按下“set 闹钟定时设置: ,进入“分”校时状态,继续按键”时”校时状态,再次按下“set键”又回复到set键”,进入“秒”校时状态,第四次按下“下“set 闹钟显示状态。 闹钟的时、分、秒设置过程和计时设置相同。 ”键,数字钟将计时显示和闹钟显示之间的转换:按动“mode 在计时显示和闹钟定时显示之间转换。 4)多功能数字钟系统结构逻辑框图如下: mode

5、动 set 态计时 显示控 校时显 k 制 选择 电路示 器 控制电reset 电路 路clk闹f1024定clk3比f4电f 5)控制器的MDS图如下: 0mods4s0modset=0 set=0 显示计时时间S0: s5 s1 set=0 调计时的时S1: set=0 set=0 set=0 S2: 调计时的分 调计时的秒S3: s6 s2 显示闹钟时间S4: set=0 set=0 S5: 调闹钟的时s7 s3 S6: 调闹钟的分 : 四、各功能模块的源程序代码 - CONTOR 模块library ieee; use ieee.std_logic_1164.all; use ieee

6、.std_logic_unsigned.all; use ieee.std_logic_arith.all; entity contor is port(clk,k,set,reset,mode : in std_logic; :out std_logic); chs,cht,cms,cmt,css,cst,flashh,flashm,flashs,sel_show end contor; architecture contor_arch of contor is type states is(s0,s1,s2,s3,s4,s5,s6,s7); signal current_state,nex

7、t_state :states; begin process (reset,clk,next_state) begin if (reset=1)then current_state=s0; elsif (clkevent and clk=1)then current_state flashh=0;flashm=0;flashs=0;cht=0;cmt=0;cst=0; chs=0;cms=0;css=0;sel_show=1; if(mode=0)then next_state=s4; elsif(k=1and set=0 ) then next_state=s1; else next_sta

8、te flashh=1;flashm=0;flashs=0;cht=1;cmt=0;cst=0; chs=0;cms=0;css=0;sel_show=1; if (set=0 ) then next_state=s2; else next_state flashh=0;flashm=1;flashs=0;cht=0;cmt=1;cst=0; chs=0;cms=0;css=0;sel_show=1; if (set=0) then next_state=s3; else next_state flashh=0;flashm=0;flashs=1;cht=0;cmt=0; cst=1;chs=

9、0;cms=0;css=0;sel_show=1; if ( set=0 ) then next_state=s0; else next_state flashh=0;flashm=0;flashs=0;cht=0;cmt=0;cst=0; chs=0;cms=0;css=0;sel_show=0; if ( mode=0 ) then next_state=s0; elsif ( k=1and set=0 ) then next_state=s5; else next_state flashh=1;flashm=0;flashs=0;cht=0;cmt=0;cst=0; chs=1;cms=

10、0;css=0;sel_show=0; if (set=0) then next_state=s6; else next_state flashh=0;flashm=1;flashs=0;cht=0;cmt=0; cst=0;chs=0;cms=1;css=0;sel_show=0; if (set=0 ) then next_state=s7; else next_state flashh=0;flashm=0;flashs=1;cht=0;cmt=0; cst=0;chs=0;cms=0;css=1;sel_show=0; then If (set=0) next_state=s4; el

11、se next_state=s7; end if; end case; end process; end contor_arch; * -*TIMER模块 * 模块-*MUX2-1 * 模块-*cnt60library ieee; library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; entity mux2_1 is entity cnt60 is port(d0,d1,en :in std_logic; :in std_logic; po

12、rt(clkin sel :in std_logic; std_logic_vector(3 mh,ml :buffer :out std_logic); y downto 0); end mux2_1; co :buffer std_logic); architecture mux2_1_arch of mux2_1 is end minute; begin architecture cnt60x of minutecnt60 is begin process(d0,d1,sel) process(clkin) begin begin if(sel=0)then if (rising_edg

13、e(clkin)then y=d0; if (mh=1and ml=1)then elsif(sel=1and en=0)then mh=y=d1 ; elsif(ml=1)then end if; ml=else ml=ml+1;co=0; end process; end if; end mux2_1_arch; end if; end process; end cnt60x; *Time_com 模块* library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_arith.all; use ieee.std_logic_u

14、nsigned.all; entity time_com is port(hh,mh,sh,hl,ml,k :in std_logic_vector(3 downto 0); chs,cms,css,f4 :in std_logic; bsg,bmg,bhg,bsd,bmd,bhd :buffer std_logic_vector(3 downto 0); comout :out std_logic); end time_com; architecture time_comx of time_com is begin com:process(hh,mh,sh,hl,ml) begin if(b

15、hg=hh and bhd=hl and bmg=mh and bmd=ml and bsg=sh)then comout=1; else comout=0; end if; end process; set:process(f4) begin if(f4event and f4=1)then if(chs=1and k=0)then if(bhg=0 and bhd=1)then bhd=elsif(bhd=1)then bhd=elsif(bhd=bhd=1or bhd=0or bhd=1or bhd= 0or bhd= 1or bhd=0)then bhd=bhd+1; end if;

16、end if; end if; end process; process(f4) begin if(f4event and f4=1)then if(cms=1and k=0)then if(bmg=1 and bmd=1)then bmd=elsif(bmd=1)then bmd=elsif(bmd=bmd=1or bmd=0or bmd=1or bmd= 0or bmd= 1or bmd=0)then bmd=bmd+1; end if; end if; end if; end process; process(f4) begin if(f4event and f4=1)then if(c

17、ss=1 and k=0)then if(bsg=1 and bsd=1)then bsd=elsif(bsd=1)then bsd=elsif(bsd=bsd=1or bsd=0or bsd=1or bsd= 0or bsd= 1or bsd=0)then bsd=bsd+1; end if; end if; end if; end process; end time_comx; -*Show_contor模块* library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_arith.all; use ieee.std_logi

18、c_unsigned.all; entity show_contor is port(hh,mh,sh,bhh,bmh,bsh,hl,ml,sl,bhl,bml,bsl :in std_logic_vector(3 downto 0); flashh,flashm,flashs,clk1,sel_show :in std_logic; sld0,shd1,mld3,mhd4,hld6,hhd7,line :out std_logic_vector(3 downto 0); end show_contor; architecture show_contor_arch of show_contor

19、 is begin line=A0; process(clk1) begin if sel_show=1then sld0=sl; shd1=sh; mld3=ml; mhd4=mh; hld6=hl; hhd7=hh; elsif sel_show=0then sld0=bsl; shd1=bsh; mld3=bml; mhd4=bmh; hld6=bhl; hhd7=bhh; end if; if(clk1=1 and flashs=1)then sld0=I1;shd1=I1; end if; if(clk1=1 and flashm=1)then mld3=I1;mhd4=I1; en

20、d if; if(clk1=1 and flashh=1)then hld6=I1;hhd7=I1; end if; end process; end show_contor_arch; -*Dynamic_show模块代码(略)* -*Bell模块* library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; entity bel is port(mh,sh,ml,sl :in std_logic_vector(3 downto 0); comout,f512hz,f1024hz,clk :in st

21、d_logic; bell :out std_logic); end bel; architecture bel_arch of bel is begin process(clk,mh,ml,sh,sl,f1024hz,f512hz) begin if(comout=1)then bell=clk; elsif(mh=1and ml=1 )then if(sh=1) then if(sl=1) then bell=f1024hz; elsif(sl= bell=f512hz; end if; else bell=0; end if; elsif(ml1or mh1or sh1 )then be

22、ll=0; end if; end process; end bel_arch; 五、连接总图(如右): 六、波形仿真: 七、引脚锁定、编译、连线并下载到实验箱进行验证12 14 16 111 150 151 152 153 154 155 156 78 79 80 183 182 reset2 reset1 k y3 bell sel1 sel0 sel2 y0 y1 y2 y4 y5 y6 mode set 八、心得体会 为期一周的课程设计在紧张与忙碌中飞逝而过,我所选择的多功能电子钟在老师孜孜不倦的指导下和同学的热心帮助下终于成功了。不但实现了题目所要求的全部功能,还实现了更人性化的功能

23、(按一下按键执行一次加1操作)。 这一功能的实现是在x老师的启发和指导以及在xxx同学的帮助与提问下才得以实现的。刚开始按照老师的思路虽然实现了按一下按键执行一次加1的功能,当时我以为自己成功了,可她发现秒钟到59后没有产生进位信号,分位没有加1。在她发现错误后,我仔细研究了产生这种错误的原因,原来我把控制校时的使能信号输入端放在了计数器里边,它屏蔽了进位信号。最后,我把控制校时的使能信号放在了mux2_1终于解决了不进位的错误。通过这件事使我认识到与同学的讨论是十分有必要和重要的。在与同学的讨论中不但使我发现了自己的错误和不足,还使自己开阔了眼界,增长了见识,增进了同学之间的友谊。 课程设计全方位的培养和考察我们解决问题以及处理将理论应用到实际当中的能力。在设计编程的过程中,我们既经过了独立思考,也经过了团体协作。我们必须在短期内锻炼迅速掌握一门语言的能力,并学会利用其他的资料与书籍。可见课程设计的意义是十分重大 和深远的。

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1