if the input is in unsigned char x, then

x = ((x << 1) & 0xAA) | ((x >> 1) & 0x55)
x = ((x << 2) & 0xCC) | ((x >> 2) & 0x33)

On Nov 20, 10:41 pm, Divesh Dixit <[email protected]>
wrote:
> assuming all are 8bit no.
> input = 0x46  (0100   0110)
>  output = 0x26 ( 0010  0110 )
> input = 0x75 (0111  0101)
> output = 0xFC (1110  1010 )
>
> Algorithm..???

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to