📁 Topic 3 · 3.1 Number Representation
3.1d Representing negative numbers
Edexcel 4CP0 · iGCSE Computer Science · ~13 min read
Notes
──
Video
──
Slides
──
Worksheet
──
Quiz

Sign and Magnitude

In sign and magnitude representation, the most significant bit (MSB) is used as a sign bit:

  • 0 in the MSB = positive number
  • 1 in the MSB = negative number

The remaining 7 bits store the magnitude (absolute value) of the number.

Sign and Magnitude Examples (8-bit)

DenarySign and MagnitudeMSB meaning
+270 00110110 = positive
-271 00110111 = negative
+1000 11001000 = positive
-1001 11001001 = negative

Range using 8-bit sign and magnitude: −127 to +127. Note: there are two representations of zero (+0 = 00000000 and −0 = 10000000).

Two's Complement

Two's complement is the most widely used method for representing negative integers in real computer systems. It has the advantage of having only one representation of zero, and addition works naturally without special rules for negative numbers.

Converting Positive to Negative (Two's Complement)

To negate a number in two's complement:

  1. Write the positive number in binary
  2. Invert all bits (flip 0s and 1s — this is the one's complement)
  3. Add 1 to the result

Example: Represent −45 in 8-bit two's complement:

  • +45 in binary: 00101101
  • Invert all bits: 11010010
  • Add 1: 11010011
  • Result: 11010011 = −45 in two's complement

Reading a Two's Complement Number

If the MSB is 1 (negative number): invert all bits, add 1, then add a minus sign.

Example: What is 11100110 in denary (two's complement)?

  • MSB = 1 → negative
  • Invert: 00011001
  • Add 1: 00011010
  • 00011010 = 16+8+2 = 26
  • Result: −26

Two's Complement Range

In 8-bit two's complement: range is −128 to +127. The MSB has a weight of −128 (rather than +128).

RepresentationRange (8-bit)Zeros
Sign and Magnitude−127 to +127Two: +0 and −0
Two's Complement−128 to +127One: 00000000 only
📝 Exam Tip: In two's complement, a value of 1 in the MSB means the number is NEGATIVE. The MSB has a place value of −128 (note the minus sign). So 10000000 = −128, and 11111111 = −1.
⚠️ Common Mistakes
  • Forgetting to add 1 after inverting — invert alone gives one's complement, not two's complement
  • Confusing sign and magnitude with two's complement — they give different bit patterns for the same negative number
  • Thinking the range of 8-bit two's complement is −127 to +127 — it is −128 to +127 (an extra negative value)
← 3.1c Binary Arithmetic Topic 3 · 3.1 Number Representation Next: 3.2a Units of Data →
🔒
Pro Content
Subscribe to access all 47 Edexcel iGCSE lessons.
£7.99/month
or £59/year