← IGCSE Computer Science Paper 1

Checking a two's complement conversion

Check a two's complement answer by converting it back to denary with these place values, then compare the result with your starting number. They must match.

Understanding Checking a two's complement conversion in IGCSE Computer Science Paper 1

What it does: Flipping 11111011 gives 00000100. Adding 1 gives 00000101, which is 5. So the original number was -5, which agrees with the starting number. Convert back using the place values -128 to 1. The leftmost bit is worth -128, so the total is -5, the same as the starting number. Flip the bits to get 11111010, then add 1 to get 11111011. A round-trip check on 11111010 gives -6, not -5, so it shows the missing +1. -128 + 1 = -127. The sign bit is worth -128, and the only other bit set is worth 1. The result of the check must match the starting number exactly. Any difference means a mistake, often a forgotten +1.

Common mistakes: The +1 step was forgotten. Flipping 00101101 gives 11010010, and adding 1 gives 11010011. The check would give -46, which does not match -45. The leftmost place value is -128, not +128. It should be -128+64+32+8+4, which gives -20.

Class: _____________________  ·  Name: _____________________  ·  Date: _________

Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.

This module's key terms are also in a printable crossword (Modules 28–41) and word search (Modules 28–58).

Take this worksheet further — free with Cloodit

Each concept is reinforced from every angle — learned, then applied, then tested.

Learning
Duo
Which check proves that 11111011 is the 8-bit two's complement of -5?
-128+64+32+16+8+2+1 = -5, which matches64+32+16+8+2+1 = 123, which matches
Matches
-3 in 8 bits: 00000011 -> flip -> 11111100
↓
The student forgot to add 1 after flipping the bits.
Applying
Meanings
Term
-128 64 32 16 8 4 2 1
Meaning
Check a two's complement answer by converting it back to denary with these place values, then compare the result with your starting number. They must match.
Practice
-128 64 32 16 8 4 2 1
Testing
Gaps
Place values: -128 64 32 16 8 4 2
Check Answer
Spots
1Start: -45
2Binary: 11010010

Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.

The 'Kraken' badge — Deep Sea Master, one of Cloodit's 106 collectible badges
Students earn collectable badges

Over 100 of them, across seven natural biomes.

Study Buddy
Students build a real study resource

Turns their work into revision material ready for Flash Cards and Exam study.

Diamond Dash — one of Cloodit's live, competitive Sprint games
Students lock in with Sprints

Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.

A Cloodit certificate of achievement, ready to personalise and print
Custom printable certificates

Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.

Quick Questions

1. Which check proves that 11111011 is the 8-bit two's complement of -5?
A. 64+32+16+8+2+1 = 123, which matches
B. -128+64+32+16+8+2+1 = -5, which matches ✓
Convert back using the place values -128 to 1. The leftmost bit is worth -128, so the total is -5, the same as the starting number.
2. You convert 5 to 8-bit two's complement by flipping 00000101. You write 11111010. What went wrong?
A. You forgot to add 1 after flipping ✓
B. You should have added 1 before flipping
Flip the bits to get 11111010, then add 1 to get 11111011. A round-trip check on 11111010 gives -6, not -5, so it shows the missing +1.
3. A round-trip check on 10000001 uses -128 + 1. What denary value does it give?
A. -127 ✓
B. -1
-128 + 1 = -127. The sign bit is worth -128, and the only other bit set is worth 1.
4. You convert -20 to binary, then convert your answer back and get -19. What should you do?
A. Treat it as an error and redo the conversion ✓
B. Accept it, because -19 is close enough
The result of the check must match the starting number exactly. Any difference means a mistake, often a forgotten +1.
5. The check on 11110100 gives a negative result. Flipping gives 00001011 and adding 1 gives 00001100 (12). What is the value?
A. 12
B. -12 ✓
When the sign bit is 1, flip and add 1 to find the positive size, then put a minus sign in front. This gives -12. The place values agree: -128+64+32+16+4 = -12.

Match the Pairs

-128 64 32 16 8 4 2 1 → The 8 place values used to convert an 8-bit two's complement number back to denary for checking
11111011 = -128+64+32+16+8+2+1 = -5 → A round-trip check: converting the binary back gives -5, which matches the starting number
If the checked result is negative, flip the bits and add 1 to get the positive value and confirm the size → 11111011 -> 00000100 -> 00000101 = 5
A 1 in the sign bit adds -128, so add the other place values to it to check a negative number → 10000011 = -128 + 2 + 1 = -125
-3 in 8 bits: 00000011 -> flip -> 11111100 → The student forgot to add 1 after flipping the bits.
-5 stored as 1011 → The student used only 4 bits instead of all 8 bits.

Key Term

-128 64 32 16 8 4 2 1
Check a two's complement answer by converting it back to denary with these place values, then compare the result with your starting number. They must match.

Fill in the Blanks

1. Place values: -128 64 32 16 8 4 2 1
Hint: Type the place value of the rightmost bit, the smallest column.
2. 11111011 = -128 + 64 + 32 + 16 + 8 + 2 + 1
Hint: Type the negative place value of the sign bit in the leftmost column.
3. -128 + 64 + 32 + 16 + 8 + 2 + 1 = -5
Hint: Add the place values and type the denary total that should match your starting number.
4. 11111011 flip = 00000100 00000100 + 1 = 00000101 So 11111011 is -5
Hint: Type the 8-bit result after adding one to the flipped bits.
5. Always write 8 bits: 00000101, not 101
Hint: Type how many bits the answer must contain, with leading zeros kept.

Spot the Error

Question 1
A Start: -45
B Binary: 11010010
C Check: -128+64+16+2+1
D Total: -45
Line B — The +1 step was forgotten. Flipping 00101101 gives 11010010, and adding 1 gives 11010011. The check would give -46, which does not match -45.
Question 2
A Start: -20
B Binary: 11101100
C Check: 128+64+32+8+4
D Total: -20
Line C — The leftmost place value is -128, not +128. It should be -128+64+32+8+4, which gives -20.
Question 3
A Start: -6
B Binary: 111010
C Check: -128+64+32+16+8+2
D Matches: yes
Line B — Only 6 bits were used. Two's complement needs all 8 bits, so -6 is 11111010. With fewer bits the sign bit is lost.
Question 4
A Binary: 1111000
B Check: -128+64+32+16
C Total: -16
Line A — This has only 7 bits. It needs 8 bits, 11110000, to match the place values -128 64 32 16 8 4 2 1 used in the check.
Question 5
A Binary: 11010011
B Sign bit is 1: negative
C Flip: 11010100
D Add 1: 00101101
E Value: -45
Line C — This line added 1 instead of flipping the bits. Flipping each bit of 11010011 gives 00101100. Then you add 1 on the next line.

Student with a class code? Join your class →