Skip to content

Commit

Permalink
onehot_to_bin: Fix width mismatch assignment (#192)
Browse files Browse the repository at this point in the history
* Fix width mismatch assignment issue #191

* Update src/onehot_to_bin.sv

Co-authored-by: Nils Wistoff <[email protected]>
  • Loading branch information
rsharanesh and niwis authored Dec 13, 2023
1 parent 52f83ee commit 6ff3a09
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/onehot_to_bin.sv
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 6ff3a09

Please sign in to comment.