COMS30046_2022_TB-2_playground/verilog_iverilog/counter/counter.v

18 lines
289 B
Coq
Raw Normal View History

module counter(out, clk, reset);
parameter WIDTH = 8;
output [WIDTH: 0] out;
input clk, reset;
reg [WIDTH: 0] out;
wire clk, reset;
always @(posedge clk or posedge reset)
if (reset)
out <= 0;
else
out <= out + 1;
endmodule // counter