From ed2f2d8e5df20768fd23c45d97478e19f7346725 Mon Sep 17 00:00:00 2001 From: Julian Blake Kongslie Date: Tue, 23 Mar 2021 12:29:00 -0700 Subject: Clean up the preshifts on bin2bcd and ntoa. --- ntoa.sv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ntoa.sv') diff --git a/ntoa.sv b/ntoa.sv index c55c9e6..2a5c1ef 100644 --- a/ntoa.sv +++ b/ntoa.sv @@ -50,7 +50,7 @@ always_ff @(posedge clk) begin // verilator lint_off WIDTH work = b2b.DIGITS; // verilator lint_on WIDTH - for (int i = b2b.DIGITS; i > 1; i = i - 1) begin + for (int i = 0; i < b2b.DIGITS - 1; i = i + 1) begin if (bcd_b_data[b2b.DIGITS-1] != 0) break; bcd_b_data = { bcd_b_data[b2b.DIGITS-2:0], {b2b.BASE_BITS{1'b0}} }; work = work - 1; -- cgit v1.2.3