2025-12-03 16:46:03 +08:00
|
|
|
module counter
|
|
|
|
|
(
|
|
|
|
|
input clk, enable, rst_n,
|
|
|
|
|
output reg [8-1:0] count
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
always @ (posedge clk or negedge rst_n)
|
|
|
|
|
begin
|
|
|
|
|
if (!rst_n)
|
|
|
|
|
count <= 0;
|
|
|
|
|
else if (enable == 1'b1)
|
2025-12-04 18:33:08 +08:00
|
|
|
<<<<<<< HEAD
|
2025-12-03 16:46:03 +08:00
|
|
|
count <= count + 1;
|
2025-12-04 12:31:53 +08:00
|
|
|
end//
|
2025-12-04 18:33:08 +08:00
|
|
|
=======
|
2025-12-04 18:12:59 +08:00
|
|
|
count <= count + 1;//00sss
|
2025-12-03 16:46:03 +08:00
|
|
|
end
|
2025-12-04 18:33:08 +08:00
|
|
|
>>>>>>> 3dc244fbc9669daee2436d70f0933dbd577fece0
|
2025-12-03 16:33:55 +08:00
|
|
|
endmodule
|