// SPDX-License-Identifier: MIT module pulse_count(input wire clk, input wire reset_n, input wire pulse, output reg [3:0] count); always @(posedge clk) begin if (!reset_n) count <= 0; else if (pulse) count <= count + 1'b1; end endmodule