Skip to main content
EnglandComputer ScienceSyllabus dot point

Why do computers use binary, and how many different states can a binary pattern of a given length represent?

Understand that computers use binary to represent data (numbers, text, sound, graphics) and program instructions, and determine the maximum number of states that can be represented by a binary pattern of a given length.

A focused answer to Edexcel GCSE Computer Science 2.1.1, covering why computers use binary to represent all data and instructions, and how to calculate the maximum number of states a binary pattern of a given length can represent.

Generated by Claude Opus 4.88 min answer

Reviewed by: AI editorial process; not yet individually human-reviewed

Have a quick question? Jump to the Q&A page

Jump to a section
  1. What this dot point is asking
  2. Why computers use binary
  3. Bits and patterns
  4. Calculating the number of states
  5. States versus largest value
  6. Try this

What this dot point is asking

Edexcel wants you to explain why computers represent everything (numbers, text, sound, graphics and the program instructions themselves) in binary, and to calculate how many different states, or values, a binary pattern of a given number of bits can represent.

Why computers use binary

The deeper reason is reliability. A circuit only has to distinguish "voltage present" from "voltage absent", which is far more robust against noise and small errors than trying to distinguish ten different voltage levels for the ten decimal digits would be. This is why binary, rather than denary, is the natural language of digital hardware.

Crucially, everything is binary inside the machine: whole numbers, text (via character codes), images (via pixel colour values), sound (via samples) and even the program instructions the CPU runs are all stored as patterns of bits. The meaning of a pattern depends on how the program interprets it; the same bits could be a number or a character depending on context.

Bits and patterns

With one bit there are two possible patterns (0 and 1), so two states. Add a second bit and each of those can be followed by a 0 or a 1, giving four patterns (00, 01, 10, 11). Every extra bit doubles the number of patterns, which is why the count grows as a power of 2.

Calculating the number of states

This single rule answers a whole family of exam questions. "How many colours can 4 bits per pixel represent?" is 24=162^4 = 16. "How many characters can a 7-bit code represent?" is 27=1282^7 = 128. "How many bits are needed for at least 100 states?" needs the smallest nn with 2n1002^n \geq 100, which is n=7n = 7 because 26=642^6 = 64 (too few) and 27=1282^7 = 128 (enough).

States versus largest value

A frequent source of lost marks is mixing up the number of states with the largest value. For an 8-bit unsigned number there are 28=2562^8 = 256 states, but the values run from 0 to 255, so the largest value is 255, one less than the number of states. Read each question carefully: "how many different values" or "how many states" wants 2n2^n, while "the largest value that can be stored" wants 2n12^n - 1.

Try this

Q1. Calculate the number of states a 7-bit pattern can represent. [1 mark]

  • Cue. 27=1282^7 = 128.

Q2. State the largest unsigned value that can be stored in 8 bits. [1 mark]

  • Cue. 255, because 281=2552^8 - 1 = 255.

Exam-style practice questions

Practice questions written in the style of Pearson Edexcel exam questions on this dot point, with worked answer explainers. The year tag is the paper they imitate, not the source.

Edexcel 20222 marksA binary pattern is 5 bits long. Calculate the maximum number of different states it can represent. Show your working.
Show worked answer →

The number of states for an nn-bit pattern is 2n2^n.

For 5 bits this is 25=322^5 = 32. So a 5-bit pattern can represent 32 different states (for example the values 0 to 31).

Markers reward the use of 2n2^n, the correct power (252^5) and the answer 32. A common error is to give 31 by confusing the number of states with the largest value; there are 32 states because 0 is one of them.

Edexcel 20212 marksState why computers represent all data and instructions in binary.
Show worked answer →

Computers use electronic components, such as transistors and switches, that have two stable states (on or off, or a high or low voltage). These two states map directly onto the two binary digits 1 and 0.

Because there are only two states to tell apart, binary is reliable and easy to build and process with electronics, so all data (numbers, text, sound, graphics) and program instructions are stored as patterns of bits.

Markers reward stating that components have two states (on/off or high/low voltage) that map to 1 and 0, making binary reliable to build and use.

Related dot points

Sources & how we know this