Eric Sosman wrote:[color=blue]
>
slebetman@yahoo.com wrote:[color=green]
>>
>> Personally I don't know of any computer ever constructed in the
>> history of computing that have an instruction that reverses the
>> bits within a byte/word like what you want. Also I don't know of
>> any programming language in the history of computing that has
>> built in functions to do what you want. So you'll have to do it
>> yourself regardless of what programming language or CPU you use.[/color]
>
> Machines with special features to help with Fourier
> transforms (digital signal processors and the like) have,
> I'm told, addressing modes where array indices are bit-
> reversed. Thus, a loop that runs from "0 to 7" would
> access elements 0, 4, 2, 6, 1, 5, 3, and 7, in that order.
> I don't know whether such machines can deliver the bit-
> reversed index as an explicit value, or whether the reversal
> remains hidden within the addressing circuitry. Nor do I
> know how the capability is usually exposed to programmers.
> Nonetheless, the bit-reversal action is certainly present.
>
> The only circumstance I've seen where bit-reversal is
> called for is when you're rearranging the transformed values
> after the Fast Fourier Transform's "butterfly" steps have
> scrambled them (or pre-scrambling the inputs beforehand,
> depending on how the FFT is set up). So when someone asks
> about bit-reversal I immediately suspect he's doing FFT's --
> and if he's doing FFT's, there's at least a chance he's
> doing them on a machine with special capabilities, and those
> capabilities may even be exposed to C. Not as an integral
> part of the language, of course, but as an extension or a
> set of extra functions or something of the kind. If it's
> there, the O.P. will need to search the documentation for it.[/color]
Way back when my 8080 based embedded machines provided for it with
a parallel input/output port. All it took was a jumper plug with 8
wires, and some byte swapping software. Turned out I never needed
to do a FFT, and the provision never was used for that.
--
"If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers." - Keith Thompson
More details at: <http://cfaj.freeshell.org/google/>
Also see <http://www.safalra.com/special/googlegroupsreply/>