C
Colmeister
Hi,
This should be a simple task but I seem to be having a brain-block at the
moment.
I have a 6 bit number (0 - 63) that I need to reverse at the binary level,
e.g.
If the starting number is 5
The binary representation is 000101
The reversed binary representation is 101000
The result (which I need to be able to calculate) is 40
I can do this by converting the number to a string (or char array)
representation of the binary number, reversing it, and then converting back
to a number, but there must be a better method.
Thanks in advance,
Colin
This should be a simple task but I seem to be having a brain-block at the
moment.
I have a 6 bit number (0 - 63) that I need to reverse at the binary level,
e.g.
If the starting number is 5
The binary representation is 000101
The reversed binary representation is 101000
The result (which I need to be able to calculate) is 40
I can do this by converting the number to a string (or char array)
representation of the binary number, reversing it, and then converting back
to a number, but there must be a better method.
Thanks in advance,
Colin