数字电子钟设计报告

上传人:工**** 文档编号:458497346 上传时间:2024-01-15 格式:DOC 页数:14 大小:268.50KB
返回 下载 相关 举报
数字电子钟设计报告_第1页
第1页 / 共14页
数字电子钟设计报告_第2页
第2页 / 共14页
数字电子钟设计报告_第3页
第3页 / 共14页
数字电子钟设计报告_第4页
第4页 / 共14页
数字电子钟设计报告_第5页
第5页 / 共14页
点击查看更多>>
资源描述

《数字电子钟设计报告》由会员分享,可在线阅读,更多相关《数字电子钟设计报告(14页珍藏版)》请在金锄头文库上搜索。

1、数字电子钟设计及报告一 明确电子系统的设计任务要求任务:用文本法或图形法设计一个能显示时,分,秒的数字电子钟要求:1.设计由晶振电路产生标准信号的单元电路 2.时为0023二十四进制计数器,分,秒为0059六十进制计数器; 3.能够显示出时分秒; 4.具有清零,调节分钟的功能; 5.具有整点报时功能,整点报时的同时灯花样显示,声响电路发出叫声;.对时,分,秒单元电路进行仿真并记录;.选作部分:具有定时闹钟功能,可在任意设定一时间,到时自动提醒,通过声响电路发出叫声。二方案选择.总体方案设计输入信号分频器六十进制计数器译码器数码管二选一选择器六十进制计数器译码器数码管二十四进制计数器译码器数码管

2、七进制计数器译码器数码管钟摆电路分频器整点报时电路分频器六十进制计数器秒计数六十进制计数器分计数.电路图法.法.方案论证()电路图法一目了然,但是耗费太多原材料()是用语言来编写的,虽然没有电路图法一目了然,但是他的每个单元电路都清晰明了,在确保每个单元都正确的情况下进行总的编成,其精确性比较高,而且只要下载到片子上就可以使用了()最终选择法来完成设计三单元电路的设计、参数计算和器件选择1.分频器(1)程序module fenpin(clk,fout,fout2,fout3);input clk;output fout,fout2,fout3;reg 23:0 cnt,cnt1,cnt2;re

3、g fout,fout2,fout3;always(posedge clk)begin if(cnt=20000) begin cnt=1; fout3=1; end else begin cnt=cnt+1; fout3=0; end end /1000Hz, always(posedge fout3)begin if(cnt=100) begin cnt2=1; fout2=1; end else begin cnt2=cnt2+1; fout2=0; endend /10Hz always(posedge fout2)begin if(cnt1=10) begin cnt1=1; fou

4、t=1; end else begin cnt1=cnt1+1; fout=0; end end /1Hzendmodule(2)原理图(3)仿真波形2.六十进制计数器(1)程序module cnt60(clk,full,reset,q);input clk,reset;output full;output 5:0q;reg 5:0q;reg full;always(posedge reset or posedge clk) begin if(reset) q=6b000000; else if(q=59) begin q=6b000000; full=1; end else begin q=

5、q+1; full=0; end endendmodule(2)原理图(3)仿真波形3.校验电路(二选一选择器)(1)程序module jiaoyan(f0,cp0,enable,cp1); input f0,cp0,enable; output cp1; reg cp1; always (enable) begin case(enable) 0:cp1=f0; 1:cp1=cp0; endcase endendmodule(2)原理图(3)仿真波形4.二十四进制计数器(1)程序module cnt24(clk,full,reset,q);input clk,reset;output full

6、;output 5:0q;reg 5:0q;reg full;always(posedge reset or posedge clk) begin if(reset) q=6b000000; else if(q=23) begin q=6b000000; full=1; end else begin q=q+1; full=0; end endendmodule (2)原理图(3)仿真波形5.七进制计数器(1)程序module cnt7(clk,full,reset,q);input clk,reset;output full;output 2:0q;reg 2:0q;reg full;alw

7、ays(posedge reset or posedge clk) begin if(reset) q=3b000; else if(q=6) begin q=3b000; full=1; end else begin q=q+1; full=0; end endendmodule(2)原理图(3)仿真波形6.七段显示译码器(1)程序module decode4_7(indec,decodeout); output6:0decodeout; input3:0indec; reg6:0decodeout; always (indec) begin case(indec) 4d1:decodeou

8、t=7b0110000; 4d2:decodeout=7b1101101; 4d3:decodeout=7b1111001; 4d4:decodeout=7b0110011; 4d5:decodeout=7b1011011; 4d6:decodeout=7b1011111; 4d7:decodeout=7b1110000; endcase endendmodule(2)原理图(3)仿真波形7.译码器(1)程序module yimaqi(a,b,c); input 5:0a; output 3:0b,c; reg 3:0b,c; always (a) begin case(a) 0:begin

9、b=4b0000;c=4b0000; end 1:begin b=4b0000;c=4b0001; end 2:begin b=4b0000;c=4b0010; end 3:begin b=4b0000;c=4b0011; end 4:begin b=4b0000;c=4b0100; end 5:begin b=4b0000;c=4b0101; end 6:begin b=4b0000;c=4b0110; end 7:begin b=4b0000;c=4b0111; end 8:begin b=4b0000;c=4b1000; end 9:begin b=4b0000;c=4b1001; en

10、d 10:begin b=4b0001;c=4b0000; end 11:begin b=4b0001;c=4b0001; end 12:begin b=4b0001;c=4b0010; end 13:begin b=4b0001;c=4b0011; end 14:begin b=4b0001;c=4b0100; end 15:begin b=4b0001;c=4b0101; end 16:begin b=4b0001;c=4b0110; end 17:begin b=4b0001;c=4b0111; end 18:begin b=4b0001;c=4b1000; end 19:begin b=4b0001;c=4b1001; end 20:begin b=4b0010;c=4b0000; end 21:begin b=4b0010;c=4b0001; end 22:begin b=4b0010;c=4b0010; end 23:

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 大杂烩/其它

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号