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.
Reviewed by: AI editorial process; not yet individually human-reviewed
Have a quick question? Jump to the Q&A page
Jump to a section
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 . "How many characters can a 7-bit code represent?" is . "How many bits are needed for at least 100 states?" needs the smallest with , which is because (too few) and (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 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 , while "the largest value that can be stored" wants .
Try this
Q1. Calculate the number of states a 7-bit pattern can represent. [1 mark]
- Cue. .
Q2. State the largest unsigned value that can be stored in 8 bits. [1 mark]
- Cue. 255, because .
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 -bit pattern is .
For 5 bits this is . So a 5-bit pattern can represent 32 different states (for example the values 0 to 31).
Markers reward the use of , the correct power () 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
- Understand how computers represent and manipulate unsigned integers and two's complement signed integers, and convert between denary and 8-bit binary numbers (0 to 255, and -128 to +127).
A focused answer to Edexcel GCSE Computer Science 2.1.2 and 2.1.3, covering unsigned and two's complement signed integers and converting between denary and 8-bit binary (0 to 255 and -128 to +127).
- Add together two positive binary patterns, apply logical and arithmetic binary shifts, and understand the concept of overflow in relation to the number of bits available to store a value.
A focused answer to Edexcel GCSE Computer Science 2.1.4 and 2.1.5, covering binary addition of two positive patterns, logical and arithmetic binary shifts, and the concept of overflow when a result needs more bits than are available.
- Understand why hexadecimal notation is used and convert between hexadecimal and binary.
A focused answer to Edexcel GCSE Computer Science 2.1.6, covering why hexadecimal notation is used as a shorthand for binary and how to convert between hexadecimal, binary and denary.
- Understand how computers encode characters using 7-bit ASCII.
A focused answer to Edexcel GCSE Computer Science 2.2.1, covering how computers encode characters using a character set, the 7-bit ASCII system, its 128 codes, and the ordering of letters and digits.
- Understand that data storage is measured in binary multiples (bit, nibble, byte, kibibyte, mebibyte, gibibyte, tebibyte), construct expressions to calculate file sizes and data capacity, and understand the need for and methods of compression (lossless, lossy).
A focused answer to Edexcel GCSE Computer Science 2.3.1 and 2.3.2, covering the binary storage multiples (bit, nibble, byte, kibibyte up to tebibyte), file-size and capacity calculations, and lossy and lossless compression.
Sources & how we know this
- Pearson Edexcel GCSE (9-1) Computer Science (1CP2) specification — Pearson (2020)