输入输出:
input clk
input rst
output [3:0] cnt_ge
output [3:0] cnt_shi
output [3:0] cnt_bai
output [3:0] cnt_qian
时分秒 时钟设计:
output [4:0] cnt_shi 最大5位!! 代码中可写到 5’d0
output [5:0] cnt_fen 最大6位!! 可写到 6’d0
output [6:0] cnt_miao 最大7位!! 可写到 7’d0
always@( posedge clk )begin
if(rst)begin
cnt_fen <=0;
cnt_miao <= 0;
cnt_shi <= 0;
end
else begin
if(cnt_miao == 6'd59)begin
cnt_miao <= 6'd0;
cnt_fen <= cnt_fen + 1'd1;
if(cnt_fen == 6'd59)begin
cnt_fen <= 6'd0;

最低0.47元/天 解锁文章
1658

被折叠的 条评论
为什么被折叠?



