数字电子钟设计报告.doc

上传人:仙人指路1688 文档编号:3944271 上传时间:2023-03-28 格式:DOC 页数:14 大小:251.50KB
返回 下载 相关 举报
数字电子钟设计报告.doc_第1页
第1页 / 共14页
数字电子钟设计报告.doc_第2页
第2页 / 共14页
数字电子钟设计报告.doc_第3页
第3页 / 共14页
数字电子钟设计报告.doc_第4页
第4页 / 共14页
数字电子钟设计报告.doc_第5页
第5页 / 共14页
点击查看更多>>
资源描述

《数字电子钟设计报告.doc》由会员分享,可在线阅读,更多相关《数字电子钟设计报告.doc(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

11、=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:begin b=4b0010;c=4b0011; end 24:begin b=4b0010;c=4b0100; end 25:begin b=4b0010;c=4b0101; end 26:begin b=4b0010;c=4b0110; end 27:begin b=4b0010;c=4b0111; end 28:begin b=4b0010;c=4b

12、1000; end 29:begin b=4b0010;c=4b1001; end 30:begin b=4b0011;c=4b0000; end 31:begin b=4b0011;c=4b0001; end 32:begin b=4b0011;c=4b0010; end 33:begin b=4b0011;c=4b0011; end 34:begin b=4b0011;c=4b0100; end 35:begin b=4b0011;c=4b0101; end 36:begin b=4b0011;c=4b0110; end 37:begin b=4b0011;c=4b0111; end 38

13、:begin b=4b0011;c=4b1000; end 39:begin b=4b0011;c=4b1001; end 40:begin b=4b0100;c=4b0000; end 41:begin b=4b0100;c=4b0001; end 42:begin b=4b0100;c=4b0010; end 43:begin b=4b0100;c=4b0011; end 44:begin b=4b0100;c=4b0100; end 45:begin b=4b0100;c=4b0101; end 46:begin b=4b0100;c=4b0110; end 47:begin b=4b0

14、100;c=4b0111; end 48:begin b=4b0100;c=4b1000; end 49:begin b=4b0100;c=4b1001; end 50:begin b=4b0101;c=4b0000; end 51:begin b=4b0101;c=4b0001; end 52:begin b=4b0101;c=4b0010; end 53:begin b=4b0101;c=4b0011; end 54:begin b=4b0101;c=4b0100; end 55:begin b=4b0101;c=4b0101; end 56:begin b=4b0101;c=4b0110

15、; end 57:begin b=4b0101;c=4b0111; end 58:begin b=4b0101;c=4b1000; end 59:begin b=4b0101;c=4b1001; end default: begin b=00000;c=00000; end endcase endendmodule(2)原理图(3)仿真波形8.钟摆电路(1)程序module zhongbai(clk,out); input clk; output 7:0out; reg 5:0out; reg3:0Q; always (posedge clk) begin if(Q=9) Q=4b0000;

16、else Q=Q+1b1; end always (Q) begin case(Q) 0:out=6b000001; 1:out=6b000010; 2:out=6b000100; 3:out=6b001000; 4:out=6b010000; 5:out=6b100000; 6:out=6b010000; 7:out=6b001000; 8:out=6b000100; 9:out=6b000010; endcase end endmodule (2)原理图(3)仿真波形9.整点报时(1) 程序module baoshi(clk5,clk6,clk7,minute,second,sound);

17、 input clk5,clk6,clk7; input 5:0minute,second; output sound; reg sound;always (minute or second)if (minute=6b111011) /59 begin case(second) 6d51,6d53,6d55,6d57:sound=clk6; /短音 6d59:sound=clk7; /长音 default:sound=1b0; /不发音 endcase endelse sound=1b0;endmodule(2)原理图(3)仿真波形四总结功能总结:完成了基本的功能指标,实现了时,分,秒的显示,具有清零的功能,调节分钟的功能,具有整点报时的功能。性能总结:性能很好,其计时器单元可以作为其他设计课程的中间环节,分频器也可以作为其他电路的其中环节。

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 办公文档 > 其他范文


备案号:宁ICP备20000045号-2

经营许可证:宁B2-20210002

宁公网安备 64010402000987号