Cambridge IGCSE · Topic 1.3
IGCSE Computer Science 0478 / Topic 1 / IGCSE

Bits, bytes and beyond.

Storage is measured in bits and bytes, and in units that each hold 1024 of the one before. Once you can move between the units, you can work out exactly how much space an image or a sound file needs.

The key idea

The smallest unit is the bit. There are 4 bits in a nibble and 8 bits in a byte. After that, each unit holds 1024 of the one before: kibibyte (KiB), mebibyte (MiB), gibibyte (GiB), tebibyte (TiB), pebibyte (PiB), exbibyte (EiB). Calculations must use 1024, not 1000, and answers must be in the unit the question asks for. Image size = width × height × colour depth; sound size = sample rate × resolution × seconds (both in bits).

units of data storage, smallest to largest bitnibblebyte KiBMiBGiB TiBPiBEiB × 4× 2× 1024 × 1024× 1024× 1024 × 1024× 1024
Fig. 1: from the byte upwards, each unit is 1024 times the one before
Section 01

The units.

In the lab, type a value, pick its unit and step it up or down the ladder. Each step shows the multiplication or division by 1024.

UnitEqual to
1 nibble4 bits
1 byte8 bits
1 kibibyte (KiB)1024 bytes
1 mebibyte (MiB)1024 KiB
1 gibibyte (GiB)1024 MiB
1 tebibyte (TiB)1024 GiB
1 pebibyte (PiB)1024 TiB
1 exbibyte (EiB)1024 PiB
Examiner trap

The question decides the unit. If it asks for MiB and you stop at KiB, you lose the final mark even if the working is right.

Section 02

Converting units.

Going to a bigger unit, divide; going to a smaller unit, multiply. From bits to bytes the factor is 8; above bytes it is 1024 each step.

Worked example Bigger to smaller
Convert 3 GiB to MiB.
  1. 1 GiB = 1024 MiB, and MiB is the smaller unit, so multiply.
  2. 3 × 1024 = 3072.
Answer: 3072 MiB
Worked example Two steps
Convert 5 242 880 bytes to MiB.
  1. Bytes to KiB: 5 242 880 ÷ 1024 = 5120 KiB.
  2. KiB to MiB: 5120 ÷ 1024 = 5 MiB.
Answer: 5 MiB
Your turn
How many bits are there in 3 KiB?
Stage 1 · Learn

Check what the sim just showed you

Four quick checks. Each correct answer earns XP and records this skill on your profile.

Quick check+10 XP

How many bits are there in a nibble?

Quick check+10 XP

How many bytes are there in 1 KiB?

Quick check+10 XP

Which list is in order from smallest to largest?

Quick check+10 XP

In the lab, 1 GiB is converted to KiB. What is the result?

Section 03

Calculating file sizes.

Both formulas give the answer in bits. Divide by 8 for bytes, then by 1024 as many times as the unit needs. The lab's image and sound tabs show the same working.

Worked example Image file in MiB
An image is 2048 × 1536 pixels with a colour depth of 24 bits. Calculate its size in MiB.
  1. Bits = 2048 × 1536 × 24 = 75 497 472 bits.
  2. Bytes = 75 497 472 ÷ 8 = 9 437 184 bytes.
  3. KiB = 9 437 184 ÷ 1024 = 9216 KiB.
  4. MiB = 9216 ÷ 1024 = 9 MiB.
Answer: 9 MiB
Worked example Sound file in KiB
A 2-minute sound track has a sample rate of 16 000 Hz and a sample resolution of 16 bits. Calculate its size in KiB.
  1. Length = 2 × 60 = 120 seconds.
  2. Bits = 16 000 × 16 × 120 = 30 720 000 bits.
  3. Bytes = 30 720 000 ÷ 8 = 3 840 000 bytes.
  4. KiB = 3 840 000 ÷ 1024 = 3750 KiB.
Answer: 3750 KiB
Examiner trap

Convert minutes to seconds before multiplying for a sound file. Forgetting this makes the answer 60 times too small.

Stage 2 · Exam

Exam-style questions

Unlocks once the four checks above are done. Worth more XP, written to IGCSE Paper 1 standard.

Finish the four checks above to unlock the exam questions
Exam style+20 XP

How many bytes are there in 4 MiB?

Exam style+20 XP

An image is 512 × 512 pixels with a colour depth of 8 bits. What is its size in KiB?

Exam style+20 XP

How many TiB are there in 1 PiB?

Exam style+20 XP

Why are storage units based on 1024 rather than 1000?

Skill unlocked

Measuring storage, mastered.

This skill is now recorded on your profile. Keep the chain going.

-Rank -Level -Score -Topics
Go deeper · practice
Six original Cambridge-style questions
Units from bit to exbibyte, converting with 1024, and calculating image and sound file sizes in the unit asked.