Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!hellgate.utah.edu!hellgate!jacobs From: jacobs@cs.utah.edu (Steven R. Jacobs) Newsgroups: comp.lang.c Subject: Re: How to reverse bits... Message-ID: Date: 14 Aug 90 15:53:11 GMT References: <2059@ux.acs.umn.edu> Organization: University of Utah CS Dept Lines: 14 In-reply-to: dhoyt@vw.acs.umn.edu's message of 14 Aug 90 15:52:15 GMT In article <2059@ux.acs.umn.edu> dhoyt@vw.acs.umn.edu writes: > In article <1990Aug13.185757.3236@sti.fi>, ttl@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@cs.utah.edu)