SOFA/BENCHMARK/counter/counter.v

17 lines
211 B
Verilog

module counter(clk, q, rst);
input clk;
input rst;
output [7:0] q;
reg [7:0] q;
always @ (posedge clk)
begin
if(rst)
q <= 8'b00000000;
else
q <= q + 1;
end
endmodule