📅  最后修改于: 2022-03-11 14:59:27.287000             🧑  作者: Mango
module up_counter(out, enable, clk, reset);
output [7:0] out;
input enable, clk, reset;
reg [7:0] out;
always @(posedge clk)
if (reset) begin
out <= 8'b0;
end else if (enable) begin
out <= out + 1;
end
endmodule