How to reverse bits...
Steven R. Jacobs
jacobs at cs.utah.edu
Wed Aug 15 01:53:11 AEST 1990
In article <2059 at ux.acs.umn.edu> dhoyt at vw.acs.umn.edu writes:
> In article <1990Aug13.185757.3236 at sti.fi>, ttl at sti.fi (Timo Lehtinen) writes...
>>This might be trivial, but here goes...
>>What's the most optimal way to reverse the bits in an unsigned char,
>>i.e. change from MSB to LSB ordering ?
>
> You don't have to change anything. Big and little endians only cause
> trouble when you look at different integer formats. Bytes is bytes, as they
> say.
Why do you assume this is a big/little endian question? Reversing bit order
is a common operation used in DSP (digital signal processing) algorithms.
--
Steve Jacobs ({bellcore,hplabs,uunet}!utah-cs!jacobs, jacobs at cs.utah.edu)
More information about the Comp.lang.c
mailing list