Re: [myhdl-list] help - hot bit encoder
Brought to you by:
jandecaluwe
From: Jan C. <jan...@mu...> - 2011-04-05 04:03:22
|
On 05/04/11 03:50, David Blubaugh wrote: > Is there anything that I can do to help ?? Yes please! Run the code attached to my posting. It prints the correct result in reversed binary during simulation, but the result is not converted back from a signal list to intbv for return. Hot-bit encoding has just one bit set true at any time. My code should convert this back into a simple number, representing the position of the set bit. For a sixteen bit wide input vector, and a four bit output vector it produces code the equivalent of this: o[3] = i[15]|i[14]|i[13]|i[12]|i[11]|i[10]|i[9]|i[8] o[2] = i[15]|i[14]|i[13]|i[12]|i[7]|i[6]|i[5]|i[4] o[1] = i[15]|i[14]|i[11]|i[10]|i[7]|i[6]|i[3]|i[2] o[0] = i[15]|i[13]|i[11]|i[9]|i[7]|i[5]|i[3]|i[1] Jan Coombs |