GCSE · Data representation

Binary, hexadecimal and overflow

Free worked examples, independent practice and self-check answers.

Binary place values

Computers represent data using bits. An unsigned 8-bit value has place values 128, 64, 32, 16, 8, 4, 2 and 1. Its highest value is 255.

1286432168421
01011010

01011010₂ = 64 + 16 + 8 + 2 = 90₁₀.

Why hexadecimal?

One hexadecimal digit represents exactly four binary bits. Group binary from the right into nibbles: 1010 1111₂ = AF₁₆. Hexadecimal uses 0–9 and A–F (10–15).

Overflow

If an unsigned 8-bit addition exceeds 255, the ninth carry bit cannot fit in 8 bits. For example, 250 + 10 = 260: stored in 8 bits, the lower eight bits encode 4, with an overflow carry.

Try it

1. Convert 11010110₂ to decimal. 2. Convert 157₁₀ to 8-bit binary. 3. Convert 1111 0010₂ to hexadecimal. 4. Explain why 200 + 100 overflows in 8 bits.

Check worked answers

1. 214. 2. 10011101. 3. F2. 4. 300 exceeds the maximum 8-bit unsigned value of 255.

Test your understanding

Represent 157 using eight binary digits, then convert that same value into hexadecimal. Add two unsigned 8-bit values whose total exceeds 255, and explain what overflow means for the stored result. Check your arithmetic using the binary and hexadecimal tools.

Common mistakes in number conversion

Do not confuse the number of possible 8-bit patterns (256) with the largest unsigned value (255). During conversions, write down place values and check that the number of bits is sufficient. For hexadecimal conversion, split from the right into four-bit nibbles, padding on the left only when necessary.

An overflow is not just a large answer. It occurs when the required result cannot be represented in the available fixed-width field. For an unsigned 8-bit result, 300 is not representable without more bits.

Try without notes: Why does 11111111₂ represent 255 rather than 256?

Check an example answer and feedback

All eight place values are set, so the total is 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1 = 255. Zero is also one of the 256 patterns.

Next: OCR Paper 1 revision or AQA Paper 2 revision.

ORIGINAL TUTORSYNTAX PRACTICE

GCSE exam practice: binary and hexadecimal

A computer stores an unsigned integer in eight bits. Explain why the value 259 cannot be stored exactly in this format. [3 marks]

Reveal indicative marking points and explanation
  1. Eight bits allow 2⁸ = 256 distinct bit patterns.
  2. The unsigned range is 0 to 255 inclusive.
  3. 259 exceeds this range, so extra bits or a different representation would be needed.

These are original teaching points for self-assessment, not an official exam-board mark scheme. Credit valid alternative explanations.

Take it further: Try converting 156 into binary and hexadecimal, then verify your answer with the Learning Lab number converter.