软件:Quartus
语言:Verilog
代码功能:
模60计数器
用Quartus9做一个模60计数器,然后用modelsim仿真
FPGA代码Verilog/VHDL代码资源下载:www.hdlcode.com
演示视频:
设计文档:
1. 工程文件
2. 程序文件
3. 程序编译
4. Testbench
5. 仿真图
部分代码展示:
//模60计数器 module mod_60( input clk,//时钟 input rst_p,//复位 output [5:0] count,//计数器 output reg cin//进位 ); reg [5:0] cnt; always@(posedge clk or posedge rst_p) if(rst_p)begin cnt<=6'd0; cin<=0; end else if(cnt==6'd59)begin//计数到59后归零 cnt<=6'd0; cin<=1;//进位 end
阅读全文
759