Unable to open this exercise
In digital computing, data capacity and memory size are quantified using a hierarchy of units. Understanding these units and calculating conversions accurately is an essential computer science skill.
Learning Objectives
- Order and define the hierarchy of digital storage units from bit to tebibyte.
- Distinguish between IEC binary prefixes (multiples of $1,024$) and SI decimal prefixes (multiples of $1,000$).
- Accurately convert values between bits, bytes, and binary storage units.
- Calculate data transmission and file transfer durations.
The Fundamental Building Blocks
- Bit (b): The smallest atomic unit of digital data. A binary digit with a value of either
0or1. - Nibble: A group of 4 bits (e.g.,
1011). Conveniently corresponds to exactly one hexadecimal digit. - Byte (B): A group of 8 bits (e.g.,
10110010). Standard unit used to measure character storage and memory addressing.
IEC Binary Prefixes vs SI Decimal Prefixes
Historically, the terms "kilobyte" or "megabyte" were loosely used for both 1,000 and 1,024 bytes, creating widespread ambiguity between hard drive manufacturers and operating systems.
To resolve this, international standards organizations (IEC and IEEE) established binary prefixes to represent exact powers of 2 ($2^{10} = 1,024$):
Unit Name | Abbreviation | Binary Calculation (IEC) | Equivalent in Bytes | Equivalent in Previous Unit |
|---|---|---|---|---|
Byte | $\text{B}$ | $2^0$ | $1\text{ byte}$ | $8\text{ bits}$ |
Kibibyte | $\text{KiB}$ | $2^{10}$ | $1,024\text{ bytes}$ | $1,024\text{ B}$ |
Mebibyte | $\text{MiB}$ | $2^{20} = 1,024^2$ | $1,048,576\text{ bytes}$ | $1,024\text{ KiB}$ |
Gibibyte | $\text{GiB}$ | $2^{30} = 1,024^3$ | $1,073,741,824\text{ bytes}$ | $1,024\text{ MiB}$ |
Tebibyte | $\text{TiB}$ | $2^{40} = 1,024^4$ | $1,099,511,627,776\text{ bytes}$ | $1,024\text{ GiB}$ |
Pebibyte | $\text{PiB}$ | $2^{50} = 1,024^5$ | $\approx 1.126 \times 10^{15}\text{ bytes}$ | $1,024\text{ TiB}$ |
Exbibyte | $\text{EiB}$ | $2^{60} = 1,024^6$ | $\approx 1.153 \times 10^{18}\text{ bytes}$ | $1,024\text{ PiB}$ |
Contrast with SI Decimal Units:
- SI Prefixes (Base 10):
- $1\text{ kB (kilobyte)} = 10^3 = 1,000\text{ bytes}$
- $1\text{ MB (megabyte)} = 10^6 = 1,000,000\text{ bytes}$
- $1\text{ GB (gigabyte)} = 10^9 = 1,000,000,000\text{ bytes}$
- $1\text{ TB (terabyte)} = 10^{12} = 1,000,000,000,000\text{ bytes}$
Note: Why Computers Use Binary Prefixes: Computer memory (RAM) is organized in physical rows and columns driven by binary address lines ($k$ address lines can address exactly $2^k$ distinct bytes). Thus, internal computer architectures inherently double and scale in powers of 2, making $1,024$ the natural multiplier.
Unit Conversion Rules
When converting between binary storage units:
- Going from Larger unit $\to$ Smaller unit: Multiply by $1,024$ for each step down.
- Going from Smaller unit $\to$ Larger unit: Divide by $1,024$ for each step up.
- Bytes $\leftrightarrow$ Bits: Multiply by 8 to get bits; divide by 8 to get bytes.
+-----+ *1024 +-----+ *1024 +-----+ *1024 +-------+ *8 +------+
| GiB | -----> | MiB | -----> | KiB | -----> | Bytes | ---> | Bits |
| | <----- | | <----- | | <----- | | <--- | |
+-----+ /1024 +-----+ /1024 +-----+ /1024 +-------+ /8 +------+
Conversion Examples:
- Convert $4\text{ MiB}$ to bytes:
- Convert $16,384\text{ KiB}$ to $\text{MiB}$:
Data Transfer Time Calculations
Network speeds and internet bandwidth are typically rated in bits per second (e.g., $100\text{ Mbps} = 100\text{ megabits per second}$), while files are measured in bytes or binary units ($\text{MiB}$).
To calculate how long it takes to transfer or download a file:
Worked Example:
Problem: How long will it take to download a $25\text{ MiB}$ software patch over a $40\text{ Mbps}$ broadband internet connection?
- Convert File Size to bits:
- Express Transmission Speed in bits per second:
- Calculate Transfer Duration:
Written practice and self-review
A user purchases a hard drive advertised as 2 GB (Gigabytes) and notes that an operating system reports its capacity as approximately 1.86 GiB (Gibibytes).
- Explain the mathematical difference between 1 GB and 1 GiB.
- Calculate the exact number of bytes in 2 GiB.
- Explain why computer memory (such as RAM) is engineered and measured using binary prefixes rather than decimal units.
Write an explanation before checking the theory. Check that each claim answers the question, uses the correct concept and explains why it applies. Discuss uncertain points with a teacher. The structured exercise below checks specific facts; it does not automatically mark this explanation.
AI Socratic Tutor
Need guidance? Ask a question or use the hint below.
AI Socratic Tutor is an All-Access Benefit
Unlock step-by-step Socratic hints, algorithm trace table walkthroughs, and error diagnostics for every Cambridge exercise.
You're chatting with an AI tutor, not a person. AI can make mistakes, so double-check its answers.
Application: Check the reasoning
Application: Check the reasoning
- Bytes in 3 KiB: [Space 1]
- Bits in 256 bytes: [Space 2]
- KiB in 2 MiB: [Space 3]
Sign in or create a free account to test your solution and track XP.