Do the following conversion problems:
(a) Convert decimal 27.315 to binary.
(b) Calculate the binary equivalent of 2/3 out to eight places. Then convert from binary to decimal. How close is the result to 2/3?
(c) Convert the binary result in (b) into hexadecimal. Then convert the result to decimal.Is the answer the same?
(a) (27.315)10 = (27)10 + (0.315)10
Divider | Number | Reminder |
2 | 27 | |
2 | 13 | 1 |
2 | 6 | 1 |
2 | 3 | 0 |
2 | 1 | 1 |
0 | 1 |
Thus, (27)10 = (11011)2 .
0.315 x 2 = 0.630 -> 0
0.630 x 2 = 1.260 -> 1
0.260 x 2 = 0.520 -> 0
0.520 x 2 = 1.040 -> 1
Thus, (0.315)10 = (0.0101)2
(27.315)10 = (11011.0101)2
(b)
2/3 x 2 = 4/3 -> 1
1/3 x 2 = 2/3 -> 0
2/3 x 2 = 4/3 -> 1
1/3 x 2 = 2/3 -> 0
2/3 x 2 = 4/3 -> 1
1/3 x 2 = 2/3 -> 0
2/3 x 2 = 4/3 -> 1
1/3 x 2 = 2/3 -> 0
thus, (2/3)10 = (0.10101010)2
Now (0.10101010)2 = [1*(1/2) + 0*(1/4) + 1*(1/8) + 0*(1/16) + 1*(1/32) + 0*(1/64) + 1*(1/128) + 0*(1/256)]10 = (0.6640625)10
Here, Answer is approx 0.002 less than 2/3's true value.
(c) (0.10101010)2 = (0000.10101010)2 = (0000. 1010 1010)2 = (0.AA)16
(0.AA)16 = (0.0)16 + (0.A)16 + (0.0A)16 = [0*(160) + 10*(1/16) + 10*(1/256)]10 = (0.6640625)10
Here, The Answer is Same as in b.