Checkpoint 4.6.1.
What decimal number does the two’s complement number 0010 represent?
Solution.
+2
A leading 0 means everything is normal.
0110
+1110
111 (Carries)
0110 (6)
+1110 (-2)
10100
111 (Carries)
1110 (-2)
+1110 (-2)
11100
0101 (+5)
1010 (flip bits)
1010 (now add one)
+ 1
1011 (-5)
1011 (-5)
0100 (flip bits)
0100 (now add one)
+ 1
0101 (+5)
1 1 (Carries)
0101 (5)
+0101 (5)
1010 (-6 in two's complement)