AQA 7517, section 4.5.6.1
Everything a computer stores is a pattern of bits: 0s and 1s. A bit pattern has no meaning by itself. What it means depends on how the computer is told to interpret it.
The same bits, different meanings
Take the 8-bit pattern 01000001:
| Interpreted as | Meaning |
|---|---|
| Unsigned binary number | 65 |
| Two's complement number | 65 |
| ASCII character | A |
| The brightness of a pixel (0 to 255) | A dark grey |
| A sound sample | A low amplitude |
| A machine code instruction | Depends on the processor |
The pattern 11111111 is 255 as unsigned, in two's complement, and the colour white in an 8-bit greyscale image.
So the computer needs to know what type of data each group of bits holds. Programs track this, and files carry metadata (such as a header) that says how to read the bits.
How different data is represented
| Type of data | How it is turned into bits |
|---|---|
| Whole numbers | Binary place values or two's complement |
| Real numbers | Fixed point or floating point |
| Text | Each character as a code (ASCII or Unicode) |
| Images | A grid of pixels, each as a colour value (bitmap), or a list of shapes (vector) |
| Sound | The wave height measured at regular intervals (samples) |
| Video | A series of images, plus sound |
| Programs | Machine code instructions, stored as binary |
Images
A bitmap image is divided into tiny squares called pixels, and each pixel's colour is stored as a number. Together, the bit patterns make up the picture (4.5.6.4).
Sound
Sound is a continuous wave. A computer measures its height at regular intervals and stores each measurement as a binary number (4.5.6.7).
Other data
Anything that can be described by numbers can be stored in bits: a map, a spreadsheet, a 3D model, a medical scan, or a game save.
Why use bits for everything?
Computers are built from electronic switches that have two states: on and off. Two states are simple, cheap and reliable. Small electrical variations don't change whether a signal counts as 0 or 1. Everything is built from this one idea.
The role of file types
Files have a format that defines how the bits are organised. A .png, .mp3 or .txt file has a header of metadata, then the data itself. If you open a file with the wrong program, the bits are interpreted the wrong way and you see nonsense.
Worked example
Task: the bits 00110101 00110010 appear in memory. Give two possible interpretations.
- As ASCII text:
00110101is 53 ('5') and00110010is 50 ('2'), so the characters are52. - As a 16-bit unsigned number: .
It is the same data, but a different meaning. Nothing in the bits tells you which is right, and the program or file format has to say.
Exam tip: give two or more different interpretations of the same bit pattern, to show that meaning comes from context, not from the bits. Link it to the type of data: number, character, pixel or sound sample.
Check yourself
Why can the same bit pattern represent a number, a letter or a colour?
A bit pattern has no meaning on its own. The program (or file format) decides how it is interpreted, so the same bits can mean different things.
How is an image stored as bits?
It is divided into pixels, and the colour of each pixel is stored as a binary number.
Why do computers use bits to store all data?
Electronic circuits have two reliable states (on and off), which makes two-valued bits simple, cheap and robust.