Short Note on Base Conversions
Is there a convenient method for converting decimal to binary? Here is one
technique:
For the integer part: Example- Convert 49 to binary. Divide by powers of
two
49/2 24 r 1
24/2 12 r 0
12/2 6 r 0
6/2
3r0
3/2
1r1
1/2
0r1
Now read the remainders from bottom to top: (49)10 = (110001)2
For the fractional part: Multiply by 2, take the remaining fractional part.
For example, convert 0.7 into base 2:
0.7
0.4
0.8
0.6
0.2
0.4
*
*
*
*
*
*
2
2
2
2
2
2
1.4
0.8
1.6
1.2
0.4
0.8
At this point, we see that this will repeat- Our number, base 2 is (read from
top to bottom): 0.1011001100110011...
To go from any base to base 10, it’s probably easiest to do the straight
conversion. For example,
(110001)2 = 1 × 20 + 1 × 24 + 1 × 25 = 1 + 16 + 32 = 49
For repeating fractional parts, we could convert using a geometric series.
Recall that:
∞
X
1
1+
rn =
1
−
r
n=1
Example: Convert the base 4 representation: 0.03030303... into base 10
(0.03030303...)4 = 3
∞ 2n
X
1
n=1
4
=3
n
∞
X
1
1
1
−
1
=
=3
1
5
16
1
−
16
n=1
1