Two's complement Cambridge IGCSE Computer Science revision
Not started
Learn it
In plain words
Ordinary binary can only count upwards from zero. Two's complement is the usual way to store negative whole numbers as well.
The trick is simple: the leftmost bit is given a negative place value. In 8 bits it is worth −128, not +128. Everything else stays the same.
6 things to know
- The place values of an 8-bit two's complement number are −128, 64, 32, 16, 8, 4, 2, 1.
- If the leftmost bit is 1 the number is negative. If it is 0 the number is positive.
- The range of an 8-bit two's complement number is −128 to +127.
- To read one: add up the place values under the 1s, remembering that the first is −128.
- To write a negative number: write the positive number in 8-bit binary, flip every bit, then add 1.
- The same steps turn a negative number back into its positive: flip every bit and add 1.
Worked example
Write −35 as an 8-bit two's complement number.
- Write +35 in binary: 00100011.
- Flip every bit: 11011100.
- Add 1: 11011101.
- Check with the place values: −128 + 64 + 16 + 8 + 4 + 1 = −35.
Worked example
What is the denary value of the two's complement number 10110100?
- Place values under the 1s: −128, 32, 16 and 4.
- −128 + 32 + 16 + 4 = −76.
Tips and tricks
- Always check a negative answer with the place values. If the leftmost bit is not 1, something has gone wrong.
- Flip, then add 1. Adding 1 first and then flipping gives the wrong number.
It lands in your notebook with its questions as flashcards.
Two's complement: 5 questions and answers
These are the quiz’s questions. Do the quiz first, then come back here for the ones that got you.
In 8-bit two's complement, what is the place value of the leftmost bit?
It is the same size as in ordinary binary but negative.
What is the 8-bit two's complement number 11111111 in denary?
−128 + 127 = −1.
What range of numbers can 8-bit two's complement store?
The smallest is 10000000 = −128. The largest is 01111111 = 127.
What is −6 in 8-bit two's complement?
+6 is 00000110. Flip to get 11111001, then add 1.
What is the 8-bit two's complement number 10000011 in denary?
−128 + 2 + 1 = −125.
Quiz
5 questions
Tap an answer and you’ll see straight away whether it’s right, and why.
Worksheet
3 questions, 5 marks. Write your answers on paper, then check them.
Two's complement
Cambridge IGCSE Computer Science 0478 · 5 marks · papermunch.org
Name ______________________________ Date ______________
Write the denary number −20 as an 8-bit two's complement number.[2]
Show answerHide answer
11101100. (+20 is 00010100. Flipped: 11101011. Add 1.)
Convert the 8-bit two's complement number 11010110 to denary.[2]
Show answerHide answer
−42. −128 + 64 + 16 + 4 + 2.
State how you can tell from its bits that a two's complement number is negative.[1]
Show answerHide answer
Its leftmost (most significant) bit is 1.
Answers: Two's complement
- 1. 11101100. (+20 is 00010100. Flipped: 11101011. Add 1.)
- 2. −42. −128 + 64 + 16 + 4 + 2.
- 3. Its leftmost (most significant) bit is 1.



