Teachers' Portal  /  IGCSE Computer Science 0478  /  Data representation  /  Measuring data storage and calculating file sizes
Lesson pack · IGCSE Computer Science 0478 · 1.3 · IGCSE

Measuring data storage and calculating file sizes

Bits, bytes and beyond. Storage is measured in bits and bytes, and in units that each hold 1024 of the one before.

Student lesson Lab, full screen
At a glance

The shape of the lesson

Topic
Data representation
Syllabus reference
Cambridge IGCSE Computer Science 0478, 1.3
Level
IGCSE
Duration
45 minutes, lab-led; stretches to a 60 minute block (see the contingency notes)
Position in topic
Lesson 9 of 10 in Data representation; follows Representing images: resolution and colour depth; leads into Lossy and lossless compression
Central model
Fig. 1: from the byte upwards, each unit is 1024 times the one before
Cooperative structure
Assessment
Stage 1 check and the exam-style plenary from the student lesson, plus the worksheet as the exit task
Learning objectives

By the end of the lesson, learners can

Section by section
  • The units: In the lab, type a value, pick its unit and step it up or down the ladder.
  • Converting units: Going to a bigger unit, divide; going to a smaller unit, multiply.
  • Calculating file sizes: Both formulas give the answer in bits.
Key points to leave on the board
  • Ladder: bit, nibble (4 bits), byte (8 bits), then KiB, MiB, GiB, TiB, PiB, EiB, each × 1024.
  • Image: width × height × colour depth = bits.
  • Sound: sample rate × resolution × seconds = bits.
  • Finish: ÷ 8 for bytes, ÷ 1024 per step, and give the unit asked for.
The core visual model

One picture every idea returns to

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
Lesson sequence

Forty-five minutes, phase by phase

TimePhaseWhat happens in the roomGrouping
0 to 5 minHook: predictOpen with the question in the title, Bits, bytes and beyond.. Storage is measured in bits and bytes, and in units that each hold 1024 of the one before. Put the figure on the board: it is the one picture every idea in the lesson returns to.Whole class, then pairs
5 to 13 minTeach and check: The unitsIn the lab, type a value, pick its unit and step it up or down the ladder. Project tab 4 of the lab (Storage units and conversions) and let a student drive it while the class predicts.Whole class, then pairs
13 to 21 minTeach and check: Converting unitsGoing to a bigger unit, divide; going to a smaller unit, multiply. Model the worked example Bigger to smaller on the board, one line at a time. Your turn: How many bits are there in 3 KiB?Pairs
21 to 30 minTeach and check: Calculating file sizesBoth formulas give the answer in bits. Model the worked example Image file in MiB on the board, one line at a time.Numbered Heads Together
30 to 36 minCheckThe four Stage 1 questions from the student lesson, answered on mini whiteboards or by show of fingers. Re-teach the one most get wrong.Individual, then whole class
36 to 43 minPlenaryThe exam-style questions from Stage 2, one at a time: thirty seconds alone, then a random call. The feedback lines in the key give the examiner's wording.Individual, random call
43 to 45 minExit and homeworkSet the worksheet below (6 questions, 14 marks). Learners self-assess against the objectives before they leave.Individual
Timing and contingency

Protect the parts that carry the learning

The sequence carries about fifty minutes of material, so the lab is driven by one student while the class predicts rather than explored freely. Times are a guide.

Protected: the check at 30 minutes. It is the only individual read on whether the key idea landed, and it is not cut.

Cut first if the build overruns: the last check in Calculating file sizes, never the check or the plenary.

In a 60 minute block: run worksheet questions 1 to 3 in class as a Rally Coach set and model both the hardest worked example and its check live.

Running the cooperative task

Numbered Heads Together

Teams of four number off. Put up a question, give the team time to make sure every member can answer, then call a number: that student answers for the team, so nobody can leave the thinking to someone else.

The full structure, with its variations and the other twelve, is on the cooperative-learning page.

Examiner traps to pre-empt

What to head off, and how

Trap learners fall intoTeaching move that pre-empts it
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.
Convert minutes to seconds before multiplying for a sound file.Forgetting this makes the answer 60 times too small.
Worksheet

Measuring data storage and calculating file sizes: worksheet

6 questions, 14 marks. Written in the style of the papers; no past paper question is reproduced.

NameClassDate
Q1 · recall[2 marks]

Put these units in order from smallest to largest: GiB, byte, TiB, nibble, KiB, bit, MiB.

Q2 · convert[2 marks]

Convert (a) 6 GiB to MiB and (b) 20 480 KiB to MiB.

Q3 · calculate[3 marks]

A photograph is 1600 pixels wide and 1200 pixels high with a colour depth of 24 bits. Calculate the file size in MiB, to 2 decimal places.

Q4 · calculate[3 marks]

A 20-second sound clip is recorded with a sample rate of 44 100 Hz and a sample resolution of 16 bits. Calculate the file size in KiB, to 2 decimal places.

Q5 · apply[2 marks]

A camera's memory card holds 32 GiB. Each photo is 4 MiB. Calculate how many photos the card can store.

Q6 · analysis[2 marks]

A student converts 3 145 728 bytes to MiB by dividing by 1 000 000 and gets 3.15 MiB. Explain the error and give the correct answer.

Answer key and marking notes
Q1 · 2 marks
  • bit, nibble, byte, KiB, MiB, GiB, TiB.
  • (1 mark for bit, nibble, byte; 1 mark for KiB, MiB, GiB, TiB)
Q2 · 2 marks
  • (a) 6 × 1024 = 6144 MiB.
  • (b) 20 480 ÷ 1024 = 20 MiB.
Q3 · 3 marks
  • 1600 × 1200 × 24 = 46 080 000 bits; ÷ 8 = 5 760 000 bytes.
  • 5 760 000 ÷ 1024 = 5625 KiB.
  • 5625 ÷ 1024 = 5.49 MiB.
Q4 · 3 marks
  • 44 100 × 16 × 20 = 14 112 000 bits.
  • 14 112 000 ÷ 8 = 1 764 000 bytes.
  • 1 764 000 ÷ 1024 = 1722.66 KiB.
Q5 · 2 marks
  • 32 GiB = 32 × 1024 = 32 768 MiB.
  • 32 768 ÷ 4 = 8192 photos.
Q6 · 2 marks
  • 1 MiB is 1024 × 1024 = 1 048 576 bytes, not 1 000 000; calculations must use 1024.
  • 3 145 728 ÷ 1 048 576 = 3 MiB.
Quiz

6 multiple-choice questions on this lesson

From the topic question bank. Assign them in the app for a marked score in your gradebook, or run the topic as a class game.

Q11 mark

Which of these units of storage is the largest?

  • A1 PiB
  • B1 TiB
  • C1 GiB
  • D1 MiB
Q21 mark

Convert 5 MiB to KiB.

  • A5120 KiB
  • B5000 KiB
  • C0.0049 KiB
  • D5 242 880 KiB
Q31 mark

How many bits are there in 2 KiB?

  • A16 384
  • B2048
  • C16 000
  • D256
Q41 mark

A memory stick has 16 GiB of free space. Each video file is 512 MiB. How many video files fit on the memory stick?

  • A32
  • B31
  • C8192
  • D2
Q51 mark

A file is 12 582 912 bytes. What is its size in MiB?

  • A12 MiB
  • B12.58 MiB
  • C12 288 MiB
  • D1.5 MiB
Q61 mark

Which expression gives the number of bytes in 1 TiB?

  • A10244
  • B10004
  • C10243
  • D8 × 10244
Quiz key
Q1: A

The ladder is KiB, MiB, GiB, TiB, PiB, EiB, each 1024 times the one before. So 1 PiB = 1024 TiB, which is larger than 1 GiB or 1 MiB.

Q2: A

1 MiB = 1024 KiB, and going to a smaller unit means multiplying: 5 × 1024 = 5120 KiB. 5000 uses 1000 instead of 1024. 0.0049 divides instead of multiplying. 5 242 880 is the number of bytes, not KiB.

Q3: A

2 KiB = 2 × 1024 = 2048 bytes, and 2048 × 8 = 16 384 bits. 2048 is the number of bytes. 16 000 uses 1000 bytes per KiB. 256 divides by 8 instead of multiplying.

Q4: A

16 GiB = 16 × 1024 = 16 384 MiB, and 16 384 ÷ 512 = 32 files. 31 (16 000 ÷ 512, rounded down) uses 1000 instead of 1024. 8192 multiplies 16 by 512 instead of dividing. 2 is the number of files that fit in just 1 GiB (1024 ÷ 512), forgetting to multiply by 16.

Q5: A

12 582 912 ÷ 1024 = 12 288 KiB, and 12 288 ÷ 1024 = 12 MiB. 12.58 divides by 1 000 000 instead of 1 048 576. 12 288 is the size in KiB with the wrong unit. 1.5 divides 12 by 8 as if converting bits to bytes, which is not needed here.

Q6: A

Bytes to TiB is four steps of 1024 (KiB, MiB, GiB, TiB), so 1 TiB = 10244 bytes. 10004 uses the denary factor, which this course does not use. 10243 is the number of bytes in 1 GiB. 8 × 10244 is the number of bits in 1 TiB.

Lab and demo

What to project

The student lesson embeds these tabs. Open them full screen on the projector; every slider has a drag handle on the stage.

Slides

Slides for this lesson

A projectable deck for every pack is on the way. Until then, present the student lesson full screen: its sections, figure and lab tabs follow the same order as the plan above.

Also for this topic

Everything else you can use

Original work by the TheLucidSTEM team. The worksheet items are written in the style of the papers; no past paper question is reproduced.
Previous lessonRepresenting images: resolution and colour depth