名称:基于FPGA的电子日历的设计Verilog代码Quartus? 远程云端平台
软件:Quartus
语言:Verilog
基于FPGA的电子日历的设计
设计基于FPGA的电子日历的设计,要求可以显示年、月、日;年、月、日可调;注意闰年;年份显示区间为2010年和2030年。
使用远程云端平台验证
FPGA代码Verilog/VHDL代码资源下载:www.hdlcode.com
本代码已在远程云端平台验证,远程云端平台如下,其他开发板可以修改管脚适配:
演示视频:
设计文档:
1. 工程文件
2. 远程平台电路图
3. 程序文件
4. 程序编译
5. RTL图
6. 管脚分配
7. 仿真文件(VWF)
8. 仿真图
部分代码展示:
//万年历 `timescale??1ns/100ps module?calendar ( input??CLK, 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
点击链接获取代码文件:http://www.hdlcode.com/index.php?m=home&c=View&a=index&aid=1289
阅读全文
233