欢迎来到天天文库
浏览记录
ID:26255015
大小:86.00 KB
页数:8页
时间:2018-11-25
《电子钟课程设计报告--数字钟设计》由会员上传分享,免费在线阅读,更多相关内容在应用文档-天天文库。
1、题目:数字钟设计一、实验目的学习并掌握数字钟的原理、设计方法。二、实验内容计数时钟由模60秒计数器、模60分计数器、模24小时计数器、报时模块、分、时校定模块及输出显示模块构成。可以采用同步计数器或异步计数器设计方法。三、实验要求1.计时范围为0小时0分0秒至23小时59分59秒2.采用6个8段数码管分别显示小时十位,小时个位、分钟十位、分钟个位、秒十位、秒个位。3.整点报时,蜂鸣器响5声,每秒1声。4.校时功能,能够单独校分、校时。用按键控制。5.具有清零、启动/停止计数的功能。用按键控制。四、实验原理数字钟的基本原理是采用
2、时钟源提供的频率作为秒模块的时钟进行计数,当秒模块计数达到59秒时为分模块提供时钟,该时钟通过状态选择模块送到分模块,同理,分模块向小时模块提供时钟时也是如此。整点报时模块是利用分钟向小时的进位时钟脉冲作为触发源,利用秒的个位计时以及实验板提供的时钟源频率达到报时五秒的目的。译码显示模块则通过8421BCD码与数码管各段的关系进行转化,由于实验板不支持动态扫描所以需在秒,分,时的个位与十位都添加译码显示模块。原理框图如下:时钟源秒模块分模块状态选择模块时模块状态选择模块暂停信号调分模块块数码管数码管数码管报时模块五、模块设计1
3、、秒计数模块libraryieee;useieee.std_logic_1164.all;useieee.std_logic_unsigned.all;entitysecondisport(clk,rst:instd_logic;enmin:outstd_logic;shiwei:outstd_logic_vector(3downto0);gewei:outstd_logic_vector(3downto0));endentitysecond;architecturertlofsecondissignala,b:std_log
4、ic_vector(3downto0);signalc:std_logic_vector(7downto0);beginc<=b&a;process(clk,rst,c)beginif(rst='1')thena<="0000";b<="0000";enmin<='0';elsif(clk'eventandclk='1')thena<=a+1;if(a="1001")thena<="0000";b<=b+1;if(b="0101")thenb<="0000";endif;endif;endif;caseciswhen"0101
5、1001"=>enmin<='1';whenothers=>enmin<=null;endcase;endprocess;gewei<=a;shiwei<=b;endarchitecturertl;其模块仿真图为:1、分计数模块libraryieee;useieee.std_logic_1164.all;useieee.std_logic_unsigned.all;entityminuteisport(clk,rst:instd_logic;enhour:outstd_logic;mshiwei:outstd_logic_ve
6、ctor(3downto0);mgewei:outstd_logic_vector(3downto0));endentityminute;architecturertlofminuteissignalm,n:std_logic_vector(3downto0);signalc:std_logic_vector(7downto0);beginc<=n&m;process(clk,rst,c)beginif(rst='1')thenm<="0000";n<="0000";enhour<='0';elsif(clk'eventand
7、clk='1')thenm<=m+1;if(m="1001")thenm<="0000";n<=n+1;endif;endif;if(c="01011001")thenn<="0000";m<="0000";endif;caseciswhen"01011001"=>enhour<='1';whenothers=>enhour<=null;endcase;endprocess;mgewei<=m;mshiwei<=n;endarchitecturertl;其模块仿真图为:1、时计数模块libraryieee;useieee.st
8、d_logic_1164.all;useieee.std_logic_unsigned.all;entityhourisport(clk,rst:instd_logic;hshiwei:outstd_logic_vector(3downto0);hgewei:outstd_l
此文档下载收益归作者所有