summaryrefslogtreecommitdiff
path: root/ntoa.sv
diff options
context:
space:
mode:
authorJulian Blake Kongslie2021-03-23 12:29:00 -0700
committerJulian Blake Kongslie2021-03-23 12:29:22 -0700
commited2f2d8e5df20768fd23c45d97478e19f7346725 (patch)
tree6e4a50dda735c23deb6d7a15c01ad2348c98ba88 /ntoa.sv
parentInitial commit. (diff)
downloadtoycpu-ed2f2d8e5df20768fd23c45d97478e19f7346725.tar.xz
Clean up the preshifts on bin2bcd and ntoa.
Diffstat (limited to '')
-rw-r--r--ntoa.sv2
1 files changed, 1 insertions, 1 deletions
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
50 // verilator lint_off WIDTH 50 // verilator lint_off WIDTH
51 work = b2b.DIGITS; 51 work = b2b.DIGITS;
52 // verilator lint_on WIDTH 52 // verilator lint_on WIDTH
53 for (int i = b2b.DIGITS; i > 1; i = i - 1) begin 53 for (int i = 0; i < b2b.DIGITS - 1; i = i + 1) begin
54 if (bcd_b_data[b2b.DIGITS-1] != 0) break; 54 if (bcd_b_data[b2b.DIGITS-1] != 0) break;
55 bcd_b_data = { bcd_b_data[b2b.DIGITS-2:0], {b2b.BASE_BITS{1'b0}} }; 55 bcd_b_data = { bcd_b_data[b2b.DIGITS-2:0], {b2b.BASE_BITS{1'b0}} };
56 work = work - 1; 56 work = work - 1;