
Appendix C
The Bit-Reversal Algorithm
The Number System
A number consists of i digits in sequence, each digit taking any of r possible
values, written as ni-i,rii-2,
• •
.,rii,no- The symbol r represents the radix
or base of the number system. In the familiar decimal number system
r = 10, indicating that there are 10 distinct digits used in that number
system, namely {0,1,2,3,4,5,6,7,8,9}. The decimal number 253 is equal
to 2 x 10
2
+ 5 x 10
1
+ 3 x 10°. If we use only two digits {0,1} (r = 2),
then the number system is called radix-2 or binary number system. A digit
in the binary number system is called a bit (fiinary digit). The rightmost
bit, no, is called the least significant bit (lsb) and the leftmost bit, rij_i, is
called the most significant bit (msb). The binary number 11001 is equal to
1 x 2
4
+ 1 x 2
3
+ 0 x 2
2
+ 0 x 2
1
+ 1 x 2° = 25 in decimal.
Conversion of a Decimal Number into a Binary Number
One way of converting a decimal number into the corresponding binary
number is to find the bits from msb to lsb. Remember that each bit has a
weight attached to it depending on its position. The weight attached to bit
n
0
is 2° = 1 and, in general, the weight of a bit n» is 2*. Given a decimal
number, find the largest weight that is equal to or just less than the decimal
number. For example, the largest weight that is equal to or just less than
25 is 16. Therefore, we fix m = 1 and subtract 16 from 25 to get 9. We
repeat the process again with 9 and continue until the number becomes a
0 or 1. Every weight must be tested in decreasing order. Note that if the
343