AS · Practice questions · Two's complement and binary arithmetic

Invert and add one.

Six original Cambridge-style questions on signed binary integers and binary arithmetic, with worked solutions.

Original questions All questions on this page are original work, written in the Cambridge AS & A Level style. They are not from past papers. They test the same concepts and skills the syllabus rewards.
Keep these straight

The sign bit is negative.

01
Convert
[2 marks]

Convert the denary number −77 to 8-bit two's complement. Show your working.

  • +77 = 01001101, inverted 10110010. ✓
  • Add 1: 10110011. ✓
02
Convert
[1 marks]

The 8-bit two's complement integer 10101010 is stored. Give its denary value.

  • −128 + 32 + 8 + 2 = −86. ✓
03
Calculate
[3 marks]

Calculate 38 − 91 using 8-bit two's complement arithmetic. Show your working and give the answer in binary and denary.

  • 38 = 00100110; −91 = 10100101 (01011011 inverted is 10100100, plus 1). ✓
  • 00100110 + 10100101 = 11001011. ✓
  • 11001011 = −128 + 64 + 8 + 2 + 1 = −53. ✓
04
Explain
[3 marks]

The 8-bit two's complement integers 01011010 and 01000110 are added. Give the 8-bit result and explain what has happened.

  • Result 10100000. ✓
  • The true answer is 90 + 70 = 160, which is above the maximum of +127. ✓
  • Overflow: two positive numbers have given a negative result (−96). ✓
05
Explain
[3 marks]

State the range of integers that can be stored in 8 bits using (a) one's complement and (b) two's complement, and explain why the ranges differ.

  • (a) −127 to +127. ✓
  • (b) −128 to +127. ✓
  • One's complement has two representations of zero (00000000 and 11111111), wasting one pattern; two's complement has only one zero, so it can represent one extra negative number. ✓
06
Analysis
[2 marks]

A 16-bit register holds the hexadecimal value FF9C, which is a two's complement integer. Give its denary value and show how you found it.

  • FF9C = 1111 1111 1001 1100; it is negative because the leftmost bit is 1. ✓
  • Invert to 0000 0000 0110 0011 and add 1: 0000 0000 0110 0100 = 100, so the value is −100. ✓

Mark this once you have attempted all six and checked your working. It records a Practiced badge on the topic and adds a one-time bonus. Revealing the solutions alone does not count.