From 6ff3a09503d0e2e0f9958e0d6518ed747e45619c Mon Sep 17 00:00:00 2001 From: Sharanesh R <55118792+rsharanesh@users.noreply.github.com> Date: Wed, 13 Dec 2023 21:49:31 +0530 Subject: [PATCH] onehot_to_bin: Fix width mismatch assignment (#192) * Fix width mismatch assignment issue #191 * Update src/onehot_to_bin.sv Co-authored-by: Nils Wistoff --- src/onehot_to_bin.sv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/onehot_to_bin.sv b/src/onehot_to_bin.sv index 58881a53..c11e0982 100644 --- a/src/onehot_to_bin.sv +++ b/src/onehot_to_bin.sv @@ -23,7 +23,7 @@ module onehot_to_bin #( logic [ONEHOT_WIDTH-1:0] tmp_mask; for (genvar i = 0; i < ONEHOT_WIDTH; i++) begin : gen_il logic [BIN_WIDTH-1:0] tmp_i; - assign tmp_i = i; + assign tmp_i = BIN_WIDTH'(i); assign tmp_mask[i] = tmp_i[j]; end assign bin[j] = |(tmp_mask & onehot);