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