Exam-style question
Try this first
Perform 12 - 19 using 6-bit two’s complement. Show the binary calculation and explain how the final result is interpreted.
Model answer
What a good answer should say
- 12 is 001100 and 19 is 010011.
- Invert 010011 to obtain 101100 and add 1 to obtain the two’s complement representation of -19, 101101.
- Add the values: 001100 + 101101 = 111001.
- The leading bit is 1, so the result is negative.
Explanation
Why this works
Subtraction is performed by adding the two’s complement of the number being subtracted. The result 111001 is a valid 6-bit representation of -7 because it has a leading 1 and its magnitude is found by inverting the bits and adding 1.
Common mistake
No common mistake is linked to this question yet.
