From f89c74205a5c6d54c20dd3375d11ff09ae103c7a Mon Sep 17 00:00:00 2001 From: yangshenbo Date: Wed, 3 Dec 2025 16:46:03 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20try=5Fsmg/counter.v?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- try_smg/counter.v | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/try_smg/counter.v b/try_smg/counter.v index dd57199..4a04b76 100644 --- a/try_smg/counter.v +++ b/try_smg/counter.v @@ -1,15 +1,14 @@ -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) - count <= count + 1; -end - +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) + count <= count + 1; +end endmodule \ No newline at end of file