数字时钟数电设计

数字时钟数电设计

ID:32849375

大小:291.50 KB

页数:9页

时间:2019-02-16

数字时钟数电设计_第1页
数字时钟数电设计_第2页
数字时钟数电设计_第3页
数字时钟数电设计_第4页
数字时钟数电设计_第5页
资源描述:

《数字时钟数电设计》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库

1、.数字电路课程设计VHDL语言数字钟...一、系统功能概述1.完成秒/分/时的依次显示并正确计数;2.秒/分/时各段个位满10正确进位,秒/分能做到满60向前进位;3.定时闹钟:实现整点报时,又扬声器发出报时声音;4.时间设置即手动调时功能,能对不精确的时间进行分/时的调整。二、系统组成以及系统各部分的设计1、顶层文件2、系统以及各个模块的仿真波形1)分频模块(原理图输入)2)秒模块程序libraryieee;useieee.std_logic_1164.all;useieee.std_logic_unsigned.all;.

2、..entitySECONDisport(clk,clr:instd_logic;----时钟/清零信号sec1,sec0:outstd_logic_vector(3downto0);----秒高位/低位co:outstd_logic);-------输出/进位信号endSECOND;architectureSECofSECONDisbeginprocess(clk,clr)variablecnt1,cnt0:std_logic_vector(3downto0);---计数beginifclr='1'then----当ckr为

3、1时,高低位均为0cnt1:="0000";cnt0:="0000";elsifclk'eventandclk='1'thenifcnt1="0101"andcnt0="1000"then----当记数为58(实际是经过59个记时脉冲)co<='1';----进位cnt0:="1001";----低位为9elsifcnt0<"1001"then----小于9时cnt0:=cnt0+1;----计数elsecnt0:="0000";ifcnt1<"0101"then----高位小于5时cnt1:=cnt1+1;elsecnt1:

4、="0000";co<='0';endif;endif;endif;sec1<=cnt1;sec0<=cnt0;endprocess;endSEC;...3)分模块程序libraryieee;useieee.std_logic_1164.all;useieee.std_logic_unsigned.all;entityMINUTEisport(clk,en:instd_logic;min1,min0:outstd_logic_vector(3downto0);co:outstd_logic);endMINUTE;archite

5、ctureMINofMINUTEisbeginifclk'eventandclk='1'thenifen='1'thenifcnt1="0101"andcnt0="1000"thenco<='1';cnt0:="1001";elsifcnt0<"1001"thencnt0:=cnt0+1;elsecnt0:="0000";ndMINUTE;architectureMINofMINUTEisbeginifcnt1<"0101"thencnt1:=cnt1+1;elsecnt1:="0000";co<='0';endif;endi

6、f;endif;endif;min1<=cnt1;min0<=cnt0;endprocess;endMIN;...4)时模块程序libraryieee;useieee.std_logic_1164.all;useieee.std_logic_unsigned.all;entityHOURisport(clk,en:instd_logic;----输入时钟/高电平有效的使能信号h1,h0:outstd_logic_vector(3downto0));----时高位/低位endHOUR;architecturehour_arcof

7、HOURisbeginprocess(clk)variablecnt1,cnt0:std_logic_vector(3downto0);----记数beginifclk'eventandclk='1'then---上升沿触发ifen='1'then---同时“使能”为1ifcnt1="0010"andcnt0="0011"thencnt1:="0000";----高位/低位同时为0时cnt0:="0000";elsifcnt0<"1001"then----低位小于9时,低位记数累加cnt0:=cnt0+1;elsecnt0:=

8、"0000";cnt1:=cnt1+1;-----高位记数累加endif;endif;endif;h1<=cnt1;h0<=cnt0;endprocess;endhour_arc;...5)动态扫描模块libraryieee;useieee.std_logic_1164.al

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。