[1.3.1] Units of storage (IEC)

Understanding Data Storage Measurement

Every piece of information stored on a computer - from a single character in a text message to a high-definition video - occupies a specific amount of storage space. Understanding how data storage is measured is fundamental to computer science, helping us comprehend file sizes, storage capacity, data transfer speeds, and system requirements. Just as we measure distance in metres and weight in kilograms, data storage has its own standardised units of measurement.

The measurement of data storage begins at the most fundamental level with the bit, the smallest unit of data a computer can process. From this basic building block, progressively larger units have been defined to measure increasingly substantial amounts of data. In this topic, we will explore the complete hierarchy of data storage units, from the tiny bit to the massive exbibyte, and understand how these units relate to one another through powers of two.

Fundamental Units of Data Storage

The Bit

A bit (binary digit) is the smallest unit of data in computing. It represents a single binary value: either 0 or 1. Every piece of digital information, no matter how complex, is ultimately composed of sequences of bits. The term "bit" combines "binary" and "digit" to reflect its fundamental nature as a binary unit of information.

Bits are the foundation of all digital computing. Inside a computer, bits are represented by electronic signals - typically high or low voltages, magnetic polarities, or reflective properties on optical media. When you see binary numbers like 10110101, each digit is a single bit. While one bit can only represent two possible values, combining multiple bits allows computers to represent any type of information imaginable.

The Nibble

A nibble (also spelled "nybble") consists of exactly 4 bits. This grouping is particularly useful because it can represent exactly one hexadecimal digit (values from 0-15 or 0x0 to 0xF). With 4 bits, a nibble can represent 24 = 16 different values, ranging from 0000 to 1111 in binary.

Although nibbles are less commonly discussed than bytes, they remain important in certain contexts, particularly when working with hexadecimal notation, colour codes in graphics, and low-level data manipulation. For example, the hexadecimal number 0xA7 consists of two nibbles: A (representing 1010) and 7 (representing 0111).

The Byte

A byte is the most commonly used basic unit of data storage, consisting of exactly 8 bits. The byte has become the standard unit for measuring data because it can represent 28 = 256 different values, which is sufficient to encode all standard characters, numbers, and symbols used in computing. A single byte can store one character of text (in ASCII encoding), a small integer (0-255), or part of a larger number or instruction.

The importance of the byte cannot be overstated - it forms the basis for all larger storage units and is the fundamental unit used to measure file sizes, memory capacity, and storage devices. When you see a file size of "2 MB" or "500 GB", these are measurements ultimately based on bytes. Everything from a simple text document to a feature-length film is measured in bytes and multiples of bytes.

Binary Prefixes: The IEC Standard

Why Binary Prefixes Matter

Computer memory and storage are organised around powers of 2 because computers operate in binary. When we refer to "1 kilobyte" in computing, we do not mean exactly 1,000 bytes as the prefix "kilo-" suggests in the metric system. Instead, because computers work in binary, we use 210 = 1,024 bytes. This distinction has led to the development of specific binary prefixes by the International Electrotechnical Commission (IEC) to avoid confusion with metric prefixes.

The IEC binary prefixes use the suffix "-bi-" (short for "binary") to clearly indicate that they represent powers of 1,024 (which is 210), not powers of 1,000. These standardised prefixes ensure precision and clarity when discussing computer storage and memory. While you may sometimes encounter the older convention of using "KB" or "MB" to mean binary multiples, the IEC standard provides unambiguous notation.

The Complete Hierarchy of Binary Units

Unit Name Symbol Size in Bytes Power of 2 Approximate Size
Bit b 1/8 of a byte Single binary digit
Nibble 1/2 of a byte 4 bits
Byte B 1 20 1 character
Kibibyte KiB 1,024 210 ~1 thousand bytes
Mebibyte MiB 1,048,576 220 ~1 million bytes
Gibibyte GiB 1,073,741,824 230 ~1 billion bytes
Tebibyte TiB 1,099,511,627,776 240 ~1 trillion bytes
Pebibyte PiB 1,125,899,906,842,624 250 ~1 quadrillion bytes
Exbibyte EiB 1,152,921,504,606,846,976 260 ~1 quintillion bytes

Converting Between Units

Converting to Larger Units

To convert from a smaller unit to a larger unit, divide by 1,024. This makes sense because you are grouping smaller units into larger ones. For example, if you have 5,120 bytes and want to know how many kibibytes that represents, you divide: 5,120 ÷ 1,024 = 5 KiB.

Examples of converting to larger units:

  • 2,048 bytes ÷ 1,024 = 2 KiB
  • 3,072 KiB ÷ 1,024 = 3 MiB
  • 5,120 MiB ÷ 1,024 = 5 GiB
  • 2,048 GiB ÷ 1,024 = 2 TiB

Converting to Smaller Units

To convert from a larger unit to a smaller unit, multiply by 1,024. This is because you are breaking down larger units into their constituent smaller units. For example, if you have 3 GiB and want to know how many mebibytes that represents, you multiply: 3 × 1,024 = 3,072 MiB.

Examples of converting to smaller units:

  • 4 KiB × 1,024 = 4,096 bytes
  • 2 MiB × 1,024 = 2,048 KiB
  • 6 GiB × 1,024 = 6,144 MiB
  • 1 TiB × 1,024 = 1,024 GiB

Converting Across Multiple Units

When converting across multiple unit levels, you can either multiply or divide repeatedly, or use powers of 1,024. For example, to convert 2 GiB to bytes, you could multiply by 1,024 three times (GiB → MiB → KiB → bytes), or simply multiply by 1,0243 = 1,073,741,824.

Example: Converting 2 GiB to bytes

  • Method 1 (step-by-step): 2 GiB × 1,024 = 2,048 MiB × 1,024 = 2,097,152 KiB × 1,024 = 2,147,483,648 bytes
  • Method 2 (using power): 2 × 230 = 2 × 1,073,741,824 = 2,147,483,648 bytes

Real-World Context and Applications

Storage Devices

Understanding storage units is essential when working with modern storage devices. A typical smartphone might have 128 GiB or 256 GiB of storage, a laptop hard drive might offer 512 GiB or 1 TiB, and enterprise servers may use storage measured in TiB or even PiB. Solid-state drives (SSDs) commonly range from 256 GiB to 2 TiB for consumer devices, while data centres use arrays of drives totalling many PiB of capacity.

When purchasing storage devices, understanding these units helps you make informed decisions. The difference between 512 GiB and 1 TiB is exactly 512 GiB - the latter offers twice the storage capacity. Similarly, knowing that 1 TiB equals 1,024 GiB helps you calculate how many files or applications you can store on a device.

File Sizes

Different types of files occupy vastly different amounts of storage space:

  • Text documents: A simple text file might be only a few KiB. A plain text document of 100 pages might occupy 100-200 KiB
  • Images: A compressed JPEG photograph typically ranges from 1-5 MiB, whilst high-resolution RAW images can be 25-50 MiB or more
  • Music: A 3-minute MP3 song at standard quality is approximately 3-5 MiB, whilst lossless formats might be 30-50 MiB
  • Videos: A 1-hour HD video might be 1-4 GiB, whilst 4K video can be 10-20 GiB or more per hour
  • Applications: Mobile apps range from a few MiB to several GiB, whilst modern PC games can be 50-100 GiB or even larger

Practical Calculations

Example 1: Available Storage

Problem: A computer has 512 GiB of storage. After the operating system and pre-installed software use 128 GiB, how many MiB are available for user files?

Solution:

  1. Calculate remaining space: 512 GiB - 128 GiB = 384 GiB
  2. Convert to MiB: 384 GiB × 1,024 = 393,216 MiB
  3. Answer: 393,216 MiB available

Example 2: File Storage Capacity

Problem: If a photograph is 4.5 MiB in size, approximately how many such photographs could be stored on a 32 GiB USB drive?

Solution:

  1. Convert 32 GiB to MiB: 32 × 1,024 = 32,768 MiB
  2. Divide total capacity by file size: 32,768 ÷ 4.5 ≈ 7,282 photographs
  3. Answer: Approximately 7,282 photographs

Example 3: Data Transfer Time

Problem: A 2.5 GiB file needs to be transferred over a network connection that operates at 100 Mbit/s. How long will the transfer take?

Solution:

  1. Convert 2.5 GiB to bits: 2.5 × 1,024 × 1,024 × 1,024 × 8 = 21,474,836,480 bits
  2. Divide by transfer rate: 21,474,836,480 ÷ 100,000,000 = 214.75 seconds
  3. Convert to minutes: 214.75 ÷ 60 ≈ 3.58 minutes
  4. Answer: Approximately 3 minutes 35 seconds

 Key Takeaways

  • A bit is the smallest unit of data (0 or 1), a nibble is 4 bits, and a byte is 8 bits, forming the fundamental building blocks of data storage
  • The IEC binary prefixes (KiB, MiB, GiB, TiB, PiB, EiB) are based on powers of 2, where each unit is exactly 1,024 times the previous unit (210), not 1,000
  • To convert to larger units, divide by 1,024; to convert to smaller units, multiply by 1,024, maintaining the binary progression throughout
  • 1 KiB = 210 bytes, 1 MiB = 220 bytes, 1 GiB = 230 bytes, 1 TiB = 240 bytes, 1 PiB = 250 bytes, and 1 EiB = 260 bytes
  • IEC binary prefixes (KiB, MiB, GiB) differ from SI decimal prefixes (KB, MB, GB), which can cause confusion - binary prefixes use 1,024 whilst decimal prefixes use 1,000 as the multiplier
  • Understanding data storage units is essential for evaluating storage capacity, file sizes, memory requirements, and data transfer rates in practical computing applications