K
Krypto
Hi,
This is the problem of reversing a number from 10110110 to 01101101. I
am wanting to reverse bits in an a byte, i.e. 8 bit.
I have already went through some old posts about bit reversal. I was
trying to approach this problem from a different perspective and
thought of the following two solutions.
1. Using Bit fields. If we can swap MSB to LSB and subsequently
internal bits.
2. Using masking and recursion. First swap left and right partition.
Then swap internally like quick sort.
The previous solutions that were proposed were to do a look up using a
table and it was told that it was the fastest means of doing it. I
could not properly understand that solution as to how to create a look
up table and look up. Can somebody please explain it.
Can you (experienced) folks comments on my approach or what other
approach would be better for this problem ?
This is the problem of reversing a number from 10110110 to 01101101. I
am wanting to reverse bits in an a byte, i.e. 8 bit.
I have already went through some old posts about bit reversal. I was
trying to approach this problem from a different perspective and
thought of the following two solutions.
1. Using Bit fields. If we can swap MSB to LSB and subsequently
internal bits.
2. Using masking and recursion. First swap left and right partition.
Then swap internally like quick sort.
The previous solutions that were proposed were to do a look up using a
table and it was told that it was the fastest means of doing it. I
could not properly understand that solution as to how to create a look
up table and look up. Can somebody please explain it.
Can you (experienced) folks comments on my approach or what other
approach would be better for this problem ?