数字时钟设计

数字时钟设计

ID:38107589

大小:97.00 KB

页数:5页

时间:2019-05-25

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

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

1、数字时钟设计程序:小时计数器LIBRARYieee;useieee.std_logic_1164.all;useieee.std_logic_unsigned.all;ENTITYhourISPORT(clk,reset:INSTD_LOGIC;daout:outstd_logic_vector(5downto0));ENDentityhour;ARCHITECTUREfunOFhourISSIGNALcount:STD_LOGIC_VECTOR(5downto0);BEGINdaout<=count;process(clk,reset)beginif(reset='0')thencount

2、<="000000";elsif(clk'eventandclk='1')thenif(count(3downto0)="1001")thenif(count<16#24#)thencount<=count+7;elsecount<="000000";endif;elsif(count<16#24#)thencount<=count+1;elsecount<="000000";endif;endif;endprocess;endfun;分钟计数器LIBRARYieee;useieee.std_logic_1164.all;useieee.std_logic_unsigned.all;ENTI

3、TYminuteISPORT(clk,clk1,reset,sethour:INSTD_LOGIC;enhour:OUTSTD_LOGIC;daout:outstd_logic_vector(6downto0));ENDentityminute;ARCHITECTUREfunOFminuteISSIGNALcount:STD_LOGIC_VECTOR(6downto0);BEGINdaout<=count;process(clk,reset,sethour)beginif(reset='0')thencount<="0000000";elsif(sethour='0')thenenhour<

4、=clk1;elsif(clk'eventandclk='1')thenif(count(3downto0)="1001")thenif(count<16#60#)thenif(count="1011001")thenenhour<='1';count<="0000000";ELSEcount<=count+7;endif;elsecount<="0000000";endif;elsif(count<16#60#)thencount<=count+1;enhour<='0'after100ns;elsecount<="0000000";endif;endif;endprocess;ENDfu

5、n;秒钟计数器LIBRARYieee;useieee.std_logic_1164.all;useieee.std_logic_unsigned.all;ENTITYsecondISPORT(clk,reset,setmin:INSTD_LOGIC;enmin:OUTSTD_LOGIC;daout:outstd_logic_vector(6downto0));ENDentitysecond;ARCHITECTUREfunOFsecondISSIGNALcount:STD_LOGIC_VECTOR(6downto0);BEGINdaout<=count;process(clk,reset,se

6、tmin)beginif(reset='0')thencount<="0000000";elsif(setmin='0')thenenmin<=clk;elsif(clk'eventandclk='1')thenif(count(3downto0)="1001")thenif(count<16#60#)thenif(count="1011001")thenenmin<='1';count<="0000000";ELSEcount<=count+7;endif;elsecount<="0000000";endif;elsif(count<16#60#)thencount<=count+1;en

7、min<='0'after100ns;elsecount<="0000000";endif;endif;endprocess;ENDfun;时间选择程序LIBRARYieee;useieee.std_logic_1164.all;useieee.std_logic_unsigned.all;useieee.std_logic_arith.all;ENTITYseltimeISPORT(clk1,reset:I

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

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

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