基于Verilog HDL的模60BCD码计数器设计
最近学习了verilog HDL语言,自己写了一个模60的计数器,计数编码是BCD码,可置位复位,带进位输出,代码如下
module counter_60(clkin, rst_n, ld, data, out, c);
input clkin, rst_n, ld;
input [7:0] data;
output [7:0] out;
output c;
reg c = 0;
reg[3:0] ten, unit;
assign out = {ten, unit};
always@(posedge clkin or negedge rst_n or posedge ld)
begin
if(!rst_n)
{t