// decade_counter.sv — counts 0..9 and wraps module decade_counter ( input logic clk, rst, en, output logic [3:0] cnt ); always_ff @(posedge clk) begin if (rst) cnt <= 4'd0; else if (en) cnt <= (cnt == 4'd9) ? 4'd0 : cnt + 4'd1; end endmodule