基于FPGA的电子万年历显示年月日设计Verilog代码VIVADO仿真
创始人
2024-12-27 07:41:06
0

名称:基于FPGA的电子万年历显示年月日设计Verilog代码VIVADO仿真(文末获取)

软件:VIVADO

语言:Verilog

代码功能:电子万年历显示年月日

1. 工程文件

2. 程序文件

3. 程序编译

4. RTL图

5. Testbench

6. 仿真图

部分代码展示:

/* --万年历 */ `timescale  1ns/100ps module wannianli ( input sysclk,//1s时钟 input reset_n,//低电平复位 //输出年月日,时分秒 output [7:0]   year_high_dis,// output [7:0]   year_low_dis,// output [7:0]   month_dis,// output [7:0]   day_dis,// output [7:0]   hour_dis,// output [7:0]   minute_dis,// output [7:0]   second_dis// ); //定义计数常数 parameter   second_cnt   = 60;//60秒 parameter   minute_cnt   = 60;//60分 parameter   hour_cnt   = 24;//24时 //定义计数器 reg [7:0]   year_high  =  8'd0; reg [7:0]   year_low   =  8'd0; reg [3:0]   month     =  4'd0; reg [4:0]   day       =  5'd0; reg [4:0]   hour      =  5'd0; reg [5:0]   minute    =  6'd0; reg [5:0]   second    =  6'd0; //闰年控制2月时间及大月小月控制------------------------------------------------------------------------------ wire  month_flag = (day == 28)&!(year_low[1:0] == 0 & year_low !=0 | year_high[1:0] ==0 & year_low ==0)&(month == 2)|                    (day == 29)& (year_low[1:0] == 0 & year_low !=0 | year_high[1:0] ==0 & year_low ==0)&(month == 2)|                    (day == 30)& ((month == 4)|(month == 6)|(month == 9)|(month == 11))|                    (day == 31)& ((month == 1)|(month == 3)|(month == 5)|(month == 7)|(month == 8)|(month == 10)|(month == 12)); //------------------------------------------------------------------------------ always@(posedge sysclk or negedge reset_n) begin   if (!reset_n)//复位,修改该处可以修改起始时间,目前设置为2019.12.31日22:10:00   begin     second  <= 6'd0;     minute  <= 6'd10;     hour    <= 5'd22;     day     <= 5'd30;     month   <= 4'd12;     year_low  <= 8'd19;     year_high  <= 8'd20;   end   else begin           if ((second == second_cnt - 1'b1)) //秒计时到59           begin             second <= 6'd0;//秒回0             if (minute == minute_cnt - 1'b1)  //分计时到59             begin               minute <= 6'd0;//分回0               if (hour == hour_cnt - 1'b1)  //时计时到23               begin                 hour <= 5'd0;//时回0                 if (month_flag) //month_flag指示当月最后一天,根据闰年及大小月判断,闰年2月为29,否则28;大月31,小月30                 begin                   day <= 5'd1;//回到1号                   if (month == 12) //12月                   begin                     month <= 5'd1;//回到1月                     if (year_low == 100 -1'b1)//年低位最大到99                     begin                       year_low <= 8'd0;//回0                       if (year_high == 100 -1'b1)//年高位最大到99                       begin                         year_high <= 8'd0;//回0                       end                       else if (year_low == 100 -1'b1)//计数到99年,年高位加1                       begin                         year_high <= year_high + 1'b1;                       end 
源代码

 扫描文章末尾的公众号二维码

相关内容

热门资讯

十分钟讲解!wepoke用模拟... 十分钟讲解!wepoke用模拟器有有用(透视)外挂透明挂辅助安装(2020已更新)(微博客户端);十...
六分钟掌握!好运大菠萝有挂的(... 六分钟掌握!好运大菠萝有挂的(辅助挂)外挂透明挂辅助工具(2023已更新)(今日头条)1、实时好运大...
5分钟了解!德州之星app辅助... 5分钟了解!德州之星app辅助器可以用(辅助挂)外挂透明挂辅助工具(2021已更新)(哔哩哔哩)1)...
8分钟揭秘!微扑克可以用模拟器... 8分钟揭秘!微扑克可以用模拟器(透视辅助)外挂透明挂辅助插件(2020已更新)(微博客户端);1、微...
七分钟攻略!epoker外挂(... 七分钟攻略!epoker外挂(辅助挂)外挂透明挂辅助软件(2025已更新)(微博客户端)1、实时ep...
五分钟指导!来玩德州扑克约局神... 五分钟指导!来玩德州扑克约局神器(黑科技辅助挂)外挂透明挂辅助软件(2025已更新)(百度知乎);1...
九分钟曝光!wepower辅助... 九分钟曝光!wepower辅助软件(软件透明挂)外挂透明挂辅助工具(2020已更新)(知乎)1、下载...
8分钟解密!线上德州aapok... 8分钟解密!线上德州aapoker透明挂(透视)外挂透明挂辅助工具(2025已更新)(百度知乎)线上...
3分钟攻略!微扑克系统发牌规律... 3分钟攻略!微扑克系统发牌规律(辅助挂)外挂透明挂辅助脚本(2023已更新)(小红书)1、构建自己的...
wpk透视辅助测试(WepoK... wpk透视辅助测试(WepoKe)wpk数据透视(黑科技)一直真的有挂(有挂插件挂)-今日头条1)W...