【笔记】12-hour clock
module top_module(
input clk,
input reset,
input ena,
output pm,
output [7:0] hh,
output [7:0] mm,
output [7:0] ss);
reg [3:0] s1; //秒针个位
reg [3:0] s2; //秒针十位
always@(posedge clk)begin
if(reset)begin
s1 <= 4'd0;
end
else if(ena)begin
if(s1==4'd9)begin
s1 <= 4'd0;
end
else begin
s1 <= s1 +
共有 0 条评论