F
Florian Schlembach
Guest
I need some advise modeling a log2-quantiser. Here is my minimal example:
log2(7000) = 12.7731
7000 in binary is: 0011001011001000
It's quite obvious that a log2 of a binary number is the bit-position of the leftmost 1 of the binary number (floor operation).
My question is now how to model this log2-quantiser? Certainly, I can use a for-loop and look for the leftmost 1 but I reckon this is not the right way? How would a for-loop then be synthesised?
So, is there a smart way how to model such a log2-quantiser in order to implement in efficiently into hardware?
log2(7000) = 12.7731
7000 in binary is: 0011001011001000
It's quite obvious that a log2 of a binary number is the bit-position of the leftmost 1 of the binary number (floor operation).
My question is now how to model this log2-quantiser? Certainly, I can use a for-loop and look for the leftmost 1 but I reckon this is not the right way? How would a for-loop then be synthesised?
So, is there a smart way how to model such a log2-quantiser in order to implement in efficiently into hardware?