时钟是多少?
如果时钟是 50M,则2s 对应 100000000个周期。
蜂鸣器持续多长?
如果持续1ms,则对应 50000 个周期。
reg [31:0] R_cnt ;
always @ (posedge I_clk) begin
if (R_cnt == 32'd99999999) begin
R_cnt <= 32'd0;
end
else begin
R_cnt <= 32'd0;
end
end
assign O_out = R_cnt < 32'd50000 ;