Computer Representation of Data
Storage Units: Bits, Bytes and Prefixes
Every file, photo and app on a device takes up space measured in storage units. You meet them when you compare phone plans, check whether a game fits on a drive, or estimate how long a download will take. This lesson builds the ladder of units from a single bit up to terabytes and shows how to convert between them without mixing up the two prefix systems.
Bits and bytes
A bit is the smallest unit of data: a single binary digit that holds either 0 or 1. One bit can only tell two states apart, so computers group bits together. Four bits make a nibble, and eight bits make a byte, the basic unit used to measure file sizes and memory. One byte has 28 = 256 possible patterns, enough to store a whole number from 0 to 255.
Example: A 12-byte message holds 12 × 8 = 96 bits, and a stream of 40 bits fills 40 ÷ 8 = 5 bytes.
Decimal and binary prefixes
Large quantities need prefixes, and two systems are in use. The SI prefixes kilo, mega, giga and tera are powers of 1000, just as in kilometre or megawatt. Because memory is addressed in binary, computers also count in powers of 2, and the IEC binary prefixes kibi, mebi, gibi and tebi are powers of 1024 = 210.
Decimal unit | Size in bytes | Binary unit | Size in bytes |
|---|---|---|---|
kilobyte (kB) | 103=1000 | kibibyte (KiB) | 210=1024 |
megabyte (MB) | 106=1000000 | mebibyte (MiB) | 220=1048576 |
gigabyte (GB) | 109 | gibibyte (GiB) | 230=1073741824 |
terabyte (TB) | 1012 | tebibyte (TiB) | 240≈1.10×1012 |
The two systems start close together and drift apart: a kibibyte is 2.4% larger than a kilobyte, a gibibyte is 7.4% larger than a gigabyte, and a tebibyte is about 10% larger than a terabyte. That gap is why a drive sold as 1 TB shows up as roughly 931 GiB on a computer that counts in binary units. No storage is missing; the same bytes are divided by a larger unit.
Converting between units
Every conversion is a multiplication or a division by a known factor.
- Moving to a smaller unit (GB to MB, bytes to bits): multiply, because you need more of the smaller units.
- Moving to a larger unit (MB to GB, bits to bytes): divide.
- Switching systems (GB to GiB): convert to bytes first, then divide by the size of the new unit in bytes.
Example: A 2 GB file holds 2 × 109 = 2,000,000,000 bytes. In gibibytes that is 2,000,000,000 ÷ 1,073,741,824 ≈ 1.86 GiB.
Going through bytes keeps each step to one factor, so you never multiply by 1000 at one level and by 1024 at another. The same habit handles download times. Network speeds are quoted in bits per second, so convert the file size to bits before dividing:
Example: Ignoring network overhead, a 250 MB file is 250 × 106 × 8 = 2 × 109 bits. At 25 Mbps, or 25 × 106 bits per second, it downloads in 2 × 109 ÷ (25 × 106) = 80 s.
What to remember
- A bit is one binary digit; 4 bits make a nibble and 8 bits make a byte.
- Lowercase b is bits, uppercase B is bytes; multiply bytes by 8 to get bits.
- kB, MB, GB and TB step by 1000; KiB, MiB, GiB and TiB step by 1024.
- To switch between systems, convert to bytes first, then divide by the new unit.
- Download time is file size in bits divided by rate in bits per second.
Example: Filling a New Phone
A phone is advertised with 128 GB of storage. Its owner wants to know what the phone will display and how quickly it can be filled. Use decimal prefixes for GB and MB, binary prefixes for GiB, treat Mbps as megabits per second, and ignore network overhead.
a) How many bytes does the advertised 128 GB represent?
Giga is the decimal prefix for 109, so 1 GB is ________.
The phone holds 128,000,000,000 bytes, or 1.28 × 1011 bytes.
b) The phone's settings screen counts in gibibytes. What capacity does it show, to one decimal place?
One gibibyte is 230 bytes, which is ________. Divide the byte count from part a) by this unit:
The screen shows about 119.2 GiB. The bytes are the same; the gibibyte is about 7.4% larger than the gigabyte, so the number is smaller.
c) The owner downloads a 2.4 GB movie over a connection that delivers a steady 80 Mbps. How long does the download take?
The rate is in bits per second, so convert the file size to bits. The file holds 2.4 × 109 bytes, which is ________ after multiplying by 8. The rate of 80 Mbps is ________.
The download takes 240 s, which is 4 minutes. Forgetting the factor of 8 would give 30 s, eight times too fast.
d) After installing apps and the movie, 30 GB remain free. How many 4.5 MB photos can still be stored?
Express both sizes in bytes: 30 GB is 30,000,000,000 bytes and one photo is ________. Dividing gives about ________ photos.
A fraction of a photo cannot be stored, so round down: the phone holds 6666 more photos. Rounding up to 6667 would need 30,001,500,000 bytes, more than is free.
Complete the conversion table. Use 1 byte = 8 bits, treat kB, MB and GB as powers of 1000, and treat KiB as a power of 1024. Enter each converted value as a whole number with no unit.
| Given quantity | Target unit | Converted value |
| 6 bytes | bits | |
| 72 bits | bytes | |
| 3 kB | bytes | |
| 3 KiB | bytes | |
| 7 MB | kB | |
| 0.25 GB | MB | |
| 2 KiB | bits |
A weather station stores each temperature reading as a fixed 12-bit pattern and records 2000 readings per day. Write each answer as a whole number without commas or units, using 1 kB = 1000 bytes.
Each reading can take one of distinct values. One day's readings occupy bits, which is bytes, or kB.