From 1e31a07f20089d4ba5bb4499410fd0a3e98263ba Mon Sep 17 00:00:00 2001 From: Dimitrios Andronikou <52114437+jimaandro@users.noreply.github.com> Date: Sat, 1 Feb 2025 13:45:33 +0200 Subject: [PATCH] Fix serial_deglitch.sv if we want to count zeros, then we should check if count_q != 0. Checking count_q!=SIZE will lead to stuck in 1 for q_o --- src/serial_deglitch.sv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/serial_deglitch.sv b/src/serial_deglitch.sv index 3302e1ae..07aa4ce1 100644 --- a/src/serial_deglitch.sv +++ b/src/serial_deglitch.sv @@ -32,7 +32,7 @@ module serial_deglitch #( if (en_i) begin if (d_i == 1'b1 && count_q != SIZE[SIZE-1:0]) begin count_q <= count_q + 1; - end else if (d_i == 1'b0 && count_q != SIZE[SIZE-1:0]) begin + end else if (d_i == 1'b0 && count_q != 0) begin count_q <= count_q - 1; end end