Computer Science
Convert the following decimal numbers to hexadecimal:
(a) 132
(b) 2352
(c) 122
(d) 0.675
Answer
(a) 132
16 | Quotient | Remainder |
---|---|---|
16 | 132 | 4 |
16 | 8 | 8 |
0 |
Therefore, (132)10 = (84)16
(b) 2352
16 | Quotient | Remainder |
---|---|---|
16 | 2352 | 0 |
16 | 147 | 3 |
16 | 9 | 9 |
0 |
Therefore, (2352)10 = (930)16
(c) 122
16 | Quotient | Remainder |
---|---|---|
16 | 122 | A (10) |
16 | 7 | 7 |
0 |
Therefore, (122)10 = (7A)16
(d) 0.675
Multiply | = | Resultant | Carry |
---|---|---|---|
0.675 x 16 | = | 0.8 | A (10) |
0.8 x 16 | = | 0.8 | C (12) |
0.8 x 16 | = | 0.8 | C (12) |
0.8 x 16 | = | 0.8 | C (12) |
0.8 x 16 | = | 0.8 | C (12) |
(We stop after 5 iterations if fractional part doesn't become 0)
Therefore, (0.675)10 = (0.ACCCC)16