Units of data
Why computers use binary
A computer is built from billions of tiny electronic switches (transistors). Each switch is either on or off, which we write as 1 or 0. So everything a computer processes or stores, whether numbers, text, images, sound or the instructions of a program, must first be converted into binary: patterns of 1s and 0s.
The smallest unit of data is a single 1 or 0: a bit (short for binary digit).
Key terms
Units of data
| Unit | Size |
|---|---|
| Bit | a single 0 or 1 |
| Nibble | 4 bits |
| Byte | 8 bits |
| Kilobyte (KB) | 1,000 bytes |
| Megabyte (MB) | 1,000 KB |
| Gigabyte (GB) | 1,000 MB |
| Terabyte (TB) | 1,000 GB |
| Petabyte (PB) | 1,000 TB |
To convert to a bigger unit, divide (by 1,000, or by 8 from bits to bytes). To convert to a smaller unit, multiply.
Remember
You can use 1,000 or 1,024 for each step: the exam accepts either. Computers address memory in powers of 2, and 1,024 is 2¹⁰, which is why you'll also see it.
Key terms
Converting units
Example 1: how many megabytes are in 3 GB?
- GB to MB is a smaller unit, so multiply: 3 × 1,000
- = 3,000 MB (or 3 × 1,024 = 3,072 MB)
Example 2: a file is 24,000 bits. How big is it in kilobytes?
- Bits to bytes: 24,000 ÷ 8 = 3,000 bytes
- Bytes to KB: 3,000 ÷ 1,000 = 3 KB
Example 3: how many bits are in 2 KB, using 1,024?
- 2 × 1,024 = 2,048 bytes
- 2,048 × 8 = 16,384 bits
How much storage do you need?
Storage devices have a fixed capacity, such as a 32 GB memory stick or a 2 TB hard drive. To check that some files will fit, convert them all to the same unit, then add them up.
Example: will 400 photos of 4 MB each and 50 songs of 6 MB each fit on a 2 GB memory stick?
- Photos: 400 × 4 = 1,600 MB
- Songs: 50 × 6 = 300 MB
- Total: 1,600 + 300 = 1,900 MB = 1.9 GB
- 1.9 GB is less than 2 GB, so yes, just.
Real files are a little bigger, as they also store metadata (information about the file), and the exam may let you allow for this.
To work out the size of a sound, image or text file, see those sub-topics.
Exam tip
Show each step and give the unit with your answer.