Converting across several units

Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.

Converting across several units

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. Convert 3 145 728 bytes to MiB. Which method is correct?
A Divide by 1024 twice (answer: 3 MiB)
B Divide by 1024 once
2. Convert 2 GiB to KiB. Which method is correct?
A Multiply by 1024 once
B Multiply by 1024 twice (answer: 2 097 152 KiB)
3. How many steps are there between KiB and TiB on the ladder?
A 4 steps
B 3 steps (KiB, MiB, GiB, TiB)
4. Convert 5 MiB to bytes. Which calculation is correct?
A 5 × 1024 × 1024
B 5 ÷ 1024 ÷ 1024
5. To convert TiB to MiB, how many times do you multiply by 1024?
A Twice (TiB to GiB, GiB to MiB)
B Three times

Match the Pairs

Draw a line connecting each item on the left to its match on the right.

Left columnRight column
1bytes / 1024 / 1024 AConverts bytes to MiB by dividing by 1024 twice, once for each step up the ladder (byte to KiB, then KiB to MiB).
2GiB * 1024 * 1024 BMiB = GiB / 1024
3Going up several units makes the number smaller, so divide by 1024 once per step. TiB to GiB is one step, so TiB to MiB is two steps. Cbytes = MiB * 1024 * 1024
4Going down several units makes the number bigger, so multiply by 1024 once per step. MiB to bytes is two steps. DGiB to KiB goes down the ladder, so the number should get bigger. It should multiply by 1024 twice, not divide: GiB * 1024 * 1024.
5MiB = bytes / 1024 EConverts GiB to KiB by multiplying by 1024 twice, once for each step down the ladder (GiB to MiB, then MiB to KiB).
6KiB = GiB / 1024 / 1024 FBytes to MiB is two steps up the ladder (byte, KiB, MiB), but this divides by 1024 only once. It gives KiB, not MiB. It should be bytes / 1024 / 1024.

Definitions

1024 per step

Fill in the Blanks

Complete each line of code by filling in the missing parts.

1.
MiB = bytes / 1024 / ____
2.
KiB = GiB _ 1024 * 1024
3.
GiB = bytes / 1024 ** _
4.
KiB = bytes / 1024 MiB = ___ / 1024
5.
MiB = bytes _ 1024 / 1024

Spot the Error

Shade in the letter of the line that contains an error.

Question 1
A bytes = 5242880
B kib = bytes / 1024
C mib = kib / 1024
D print(kib, "MiB")
Question 2
A gib = 2
B mib = gib * 1024
C kib = mib / 1024
D print(kib, "KiB")
Question 3
A gib = 2
B mib = gib * 1024
C kib = mib * 1024
D b = kib * 1000
E print(b, "bytes")
Question 4
A tib = 3
B gib = tib / 1024
C print(gib, "GiB")
Question 5
A kib = 8388608
B gib = kib / 1024
C print(gib, "GiB")

Answer Key

Converting across several units
Section A: Quick Questions
Q1
A — Divide by 1024 twice (answer: 3 MiB)
Q2
B — Multiply by 1024 twice (answer: 2 097 152 KiB)
Q3
B — 3 steps (KiB, MiB, GiB, TiB)
Q4
A — 5 × 1024 × 1024
Q5
A — Twice (TiB to GiB, GiB to MiB)
Section B: Match the Pairs
Q1
bytes / 1024 / 1024 → Converts bytes to MiB by dividing by 1024 twice, once for each step up the ladder (byte to KiB, then KiB to MiB).
Q2
GiB * 1024 * 1024 → Converts GiB to KiB by multiplying by 1024 twice, once for each step down the ladder (GiB to MiB, then MiB to KiB).
Q3
Going up several units makes the number smaller, so divide by 1024 once per step. TiB to GiB is one step, so TiB to MiB is two steps. → MiB = GiB / 1024
Q4
Going down several units makes the number bigger, so multiply by 1024 once per step. MiB to bytes is two steps. → bytes = MiB * 1024 * 1024
Q5
MiB = bytes / 1024 → Bytes to MiB is two steps up the ladder (byte, KiB, MiB), but this divides by 1024 only once. It gives KiB, not MiB. It should be bytes / 1024 / 1024.
Q6
KiB = GiB / 1024 / 1024 → GiB to KiB goes down the ladder, so the number should get bigger. It should multiply by 1024 twice, not divide: GiB * 1024 * 1024.
Section C: Definitions
Q1
1024 per step — To convert across several units, divide by 1024 for each step up the ladder or multiply by 1024 for each step down. Bytes to MiB is two steps, so divide by 1024 twice.
Section D: Fill in the Blanks
Q1
MiB = bytes / 1024 / 1024
Q2
KiB = GiB * 1024 * 1024
Q3
GiB = bytes / 1024 ** 3
Q4
KiB = bytes / 1024 MiB = KiB / 1024
Q5
MiB = bytes / 1024 / 1024
Section E: Spot the Error
Q1
D — The answer in MiB is stored in mib, not kib. kib is only the middle step (KiB). It should be print(mib, "MiB").
Q2
C — Going from MiB down to KiB means moving to a smaller unit, so you multiply by 1024. It should be kib = mib * 1024.
Q3
D — Every step on the storage ladder uses 1024, not 1000. It should be b = kib * 1024.
Q4
B — TiB to GiB is one step down to a smaller unit, so multiply by 1024. It should be gib = tib * 1024.
Q5
B — KiB to GiB is two steps up (KiB, MiB, GiB), so you divide by 1024 twice. It should be gib = kib / 1024 / 1024.