Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
14 years ago

Determining the index of the first 1 bit in a vector

Let's say I have a 64b wire, and I want to efficiently determine the index of the first 1 bit. For example: wire [63:0] sum; wire [5:0] index; assign sum = 64'b0000000111010110....1010...