多功能时钟设计Verilog代码Quartus仿真
名称:多功能时钟设计Verilog代码Quartus仿真
软件:Quartus
语言:Verilog
代码功能:
多功能时钟设计
1、具有计时功能,可以调时
2、具有万年历功能,可以设置年月日
3、通过按键切换显示年月日还是时分秒
FPGA代码Verilog/VHDL代码资源下载:www.hdlcode.com
演示视频:
设计文档:
1. 工程文件

2. 程序文件

3. 程序编译

4. RTL图

5. 仿真图
日期模块仿真


时钟模块

显示模块

分频模块

按键模块

部分代码展示:
//万年历 `timescale 1ns/100ps module calendar ( input CLK,//1KHz input RST,//复位 input day_add,//天加 input day_sub,//天减 input month_add,//月加 input month_sub,//月减 input year_add,//年加 input year_sub,//年减 output reg [7:0] year_h,//年高位 output reg [7:0] year_l,//年低位 output reg [3:0] month,//月 output reg [4:0] day//天 ); reg month_add_cin=0; reg month_sub_cin=0; reg year_add_cin=0; reg year_sub_cin=0; reg [4:0] day_max = 5'd30;//定义月最大天数 always@(posedge CLK or posedge RST) begin if (RST) day_max <= 5'd30; else if(!(year_l[1:0] == 0 & year_l !=0 | year_h[1:0] ==0 & year_l ==0)&(month == 2)) day_max <= 5'd28;//非闰年2月 else if((year_l[1:0] == 0 & year_l !=0 | year_h[1:0] ==0 & year_l ==0)&(month == 2)) day_max <= 5'd29;//闰年2月 else if((month == 4)|(month == 6)|(month == 9)|(month == 11)) day_max <= 5'd30;//小月 else if((month == 1)|(month == 3)|(month == 5)|(month == 7)|(month == 8)|(month == 10)|(month == 12)) day_max <= 5'd31;//大月 else day_max <= 5'd30; end
代码文件(付费下载):
![]()
1、代码文件需要付费后才可见。
2、支付问题请联系微信公众号客服。
3、优质Verilog/VHDL代码资源,所见即所得。
Verilog/VHDL资源下载 » 多功能时钟设计Verilog代码Quartus仿真
2、支付问题请联系微信公众号客服。
3、优质Verilog/VHDL代码资源,所见即所得。
Verilog/VHDL资源下载 » 多功能时钟设计Verilog代码Quartus仿真