Converting a positive denary number to two's complement
A denary number from 0 to 127 is written as ordinary binary, padded with zeros to 8 bits so the leftmost sign bit is 0. Numbers above 127 cannot be stored.
Understanding Converting a positive denary number to two's complement in IGCSE Computer Science Paper 1
What it does: Padding with five zeros on the left makes 8 bits. The leftmost sign bit is 0, so the number stays positive. 65 = 64 + 1 is 1000001 in binary, which is only 7 bits. Pad with a leading 0 to make 8 bits: 01000001. Positive numbers need no inverting. 18 = 10010 in binary, which pads to 00010010. Invert and add 1 is for making negative numbers. The sign bit must be 0, so the other 7 bits give at most 127. 11111111 in two's complement is -1, not 255. In 8-bit two's complement the sign bit is 1 for negatives. Positive numbers only go up to 127, so 130 cannot be stored.
Common mistakes: A positive number must have a leading sign bit of 0. 45 in 8 bits is 00101101. Starting with 1 would make it a negative number. Padding adds 0s on the left, not 1s. The padded 8-bit value must be 01100100, so the sign bit stays 0 and the value is still 100.
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.
Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.
Over 100 of them, across seven natural biomes.
Turns their work into revision material ready for Flash Cards and Exam study.
Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.
Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.
Quick Questions
Match the Pairs
Key Term
positive two's complementFill in the Blanks
Spot the Error
Student with a class code? Join your class →