Giving the answer in the unit asked

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

Giving the answer in the unit asked

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. A question asks for the file size in MiB. You have calculated 8 388 608 bytes. What is the next step?
A Divide by 1024 twice to convert to MiB
B Write 8 388 608 as the answer, because bytes are fine
2. When should you convert the result to the unit the question asks for?
A After finishing the calculation
B Before starting, by converting every value first
3. Which final answer is complete for a question that asks for the size in KiB?
A 64
B 64 KiB
4. An image file is 3 145 728 bytes. The question asks for the size in MiB. What is the correct answer?
A 3 MiB
B 3072 MiB
5. A sound file is 24 000 bits. The question asks for the size in bytes. Which is correct?
A 192 000 bytes
B 3000 bytes

Match the Pairs

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

Left columnRight column
1bits ÷ 8 ÷ 1024 = KiB AThe answer is written with the unit that the question asked for
2Answer: 3 MiB BThe unit is missing. The answer should be written with the unit, such as 12 KiB.
3Work out the file size first, then convert it to the unit asked C2 MiB = 2048 KiB, so 2048 KiB > 1500 KiB
4To compare two file sizes fairly, convert both to the same unit Dsize_bits = 1000 * 8 * 16 size_KiB = size_bits / 8 / 1024
5The question asks for MiB. Answer: 4096 KiB EConvert a size in bits to kibibytes by dividing by 8 and then by 1024
6Answer: 12 FThe answer is left in KiB, not in the MiB the question asked for. It should be converted: 4096 / 1024 = 4 MiB.

Definitions

unit asked

Fill in the Blanks

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

1.
sizeKiB ← sizeBytes / ____
2.
sizeMiB ← sizeKiB / 1024 OUTPUT _______
3.
sizeGiB ← sizeMiB / 1024 OUTPUT sizeGiB & " ___"
4.
sizeBytes ← pixels * depth / 8 sizeKiB ← sizeBytes _ 1024
5.
sizeAKiB ← sizeAMiB _ 1024 OUTPUT sizeAKiB > sizeBKiB

Spot the Error

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

Question 1
A bits = 8192
B bytes = bits * 8
C KiB = bytes / 1024
D OUTPUT KiB & " KiB"
Question 2
A bytes = 4 * 1024 * 1024
B MiB = bytes * 1024 * 1024
C OUTPUT MiB & " MiB"
Question 3
A asked = "KiB"
B size = bytes / 1048576
C OUTPUT size & " " & asked
Question 4
A fileA = 2048 // KiB
B fileB = 3 // MiB
C fileB = fileB / 1024 // KiB
D OUTPUT "B is larger"
Question 5
A a = 1500 // bytes
B b = 2 // KiB
C bB = b * 1024 // bytes
D IF b > a THEN
E OUTPUT "B is bigger"
F ENDIF

Answer Key

Giving the answer in the unit asked
Section A: Quick Questions
Q1
A — Divide by 1024 twice to convert to MiB
Q2
A — After finishing the calculation
Q3
B — 64 KiB
Q4
A — 3 MiB
Q5
B — 3000 bytes
Section B: Match the Pairs
Q1
bits ÷ 8 ÷ 1024 = KiB → Convert a size in bits to kibibytes by dividing by 8 and then by 1024
Q2
Answer: 3 MiB → The answer is written with the unit that the question asked for
Q3
Work out the file size first, then convert it to the unit asked → size_bits = 1000 * 8 * 16 size_KiB = size_bits / 8 / 1024
Q4
To compare two file sizes fairly, convert both to the same unit → 2 MiB = 2048 KiB, so 2048 KiB > 1500 KiB
Q5
The question asks for MiB. Answer: 4096 KiB → The answer is left in KiB, not in the MiB the question asked for. It should be converted: 4096 / 1024 = 4 MiB.
Q6
Answer: 12 → The unit is missing. The answer should be written with the unit, such as 12 KiB.
Section C: Definitions
Q1
unit asked — Finish a storage calculation by converting the result into the unit the question asks for, then write that unit with your answer, for example 2 MiB.
Section D: Fill in the Blanks
Q1
sizeKiB ← sizeBytes / 1024
Q2
sizeMiB ← sizeKiB / 1024 OUTPUT sizeMiB
Q3
sizeGiB ← sizeMiB / 1024 OUTPUT sizeGiB & " GiB"
Q4
sizeBytes ← pixels * depth / 8 sizeKiB ← sizeBytes / 1024
Q5
sizeAKiB ← sizeAMiB * 1024 OUTPUT sizeAKiB > sizeBKiB
Section E: Spot the Error
Q1
B — To change bits into bytes you divide by 8, not multiply. It should be bytes = bits / 8, so the later conversion to KiB gives 1 KiB.
Q2
B — Going from bytes to a larger unit (MiB) means dividing by 1024 for each step up the ladder. It should be MiB = bytes / 1024 / 1024, which gives 4 MiB.
Q3
B — The question asks for KiB, so bytes are divided by 1024 once. Dividing by 1048576 gives MiB, the wrong unit. It should be size = bytes / 1024.
Q4
C — Converting MiB to the smaller unit KiB means multiplying by 1024, not dividing. It should be fileB = fileB * 1024, giving 3072 KiB, so B is larger than 2048 KiB.
Q5
D — b is in KiB but a is in bytes, so they cannot be compared directly. Compare the converted value: IF bB > a THEN (2048 bytes against 1500 bytes).