Convert the following decimal numbers to equivalent binary and hexadecimal numbers:
(i) 4096
(ii) 0.4375
(iii) 2048.0625
Technique
Recognise the powers of two (4096=212, 2048=211, 0.0625=2−4) for instant binary; repeated ×2 for the 0.4375 fraction; group binary digits in nibbles of four to read hex directly.
Solution
Method. Integer part: repeated division by 2 (binary) / by 16 (hex), reading remainders bottom-up. Fractional part: repeated multiplication by 2 / by 16, reading the integer carries top-down. Each hex digit groups 4 binary digits.
(i) 4096
4096=212, so in binary it is a 1 followed by twelve 0s:
4096=21210000000000002.
Grouping in fours from the right: 00010000000000002=(1)(0)(0)(0)16, i.e. hex 1000:
4096=(100000000000)2=(1000)16.
(Check: 163=4096, so 100016=4096. ✓)
(ii) 0.4375
Multiply the fraction by 2 repeatedly, recording carries: