Edexcel 1CP2 · 2.3.1
Units of data storage
Data storage is measured in binary multiples. Each step up from a byte is 1024 times bigger.
- A bit is a single binary digit: 1 or 0. It is the smallest unit.
- A nibble is 4 bits. A byte is 8 bits (two nibbles).
- Then: kibibyte (KiB), mebibyte (MiB), gibibyte (GiB), tebibyte (TiB). Each is 1024 of the one before.
- In size order: bit, nibble, byte, kibibyte, mebibyte, gibibyte, tebibyte.
- You may see kilobyte (kB), megabyte (MB) and so on, which are 1000s. Pearson doesn’t accept 1000 for storage. Write KiB, MiB, GiB, TiB and use 1024.
Divide to move to a larger unit; multiply to move to a smaller one.
Exam tipNetwork speeds are the exception: they use 1000s (1 megabit per second = 1 000 000 bits per second). For storage and file sizes it is always 1024.
- Bit
- A binary digit, 1 or 0. The smallest unit of data.
- Nibble
- 4 bits (half a byte).
- Byte
- 8 bits.
- Kibibyte (KiB)
- 1024 bytes.
- Mebibyte (MiB)
- 1024 kibibytes (1024² bytes).
- Gibibyte (GiB)
- 1024 mebibytes (1024³ bytes).
- Tebibyte (TiB)
- 1024 gibibytes (1024⁴ bytes).
Edexcel 1CP2 · 2.3.1
Converting between units
- Larger unit to smaller unit: multiply. GiB → MiB is × 1024. Bytes → bits is × 8.
- Smaller unit to larger unit: divide. Bits → bytes is ÷ 8. KiB → MiB is ÷ 1024.
- Jumping more than one step: multiply or divide by 1024 once per step. TiB → bytes is × 10244; bits → MiB is ÷ (8 × 10242).
- Why binary multiples? Computers address memory and storage in powers of 2, and 1024 = 210. Using 1024 gives exact sizes; using 1000 would be slightly wrong, and the error grows with each step (a TiB is about 10% more than 10004 bytes).
Worked exampleHow many bytes are in 5 KiB?
- 5 × 1024 = 5120KiB to bytes: one step down, so × 1024
5120 bytes
Worked exampleConvert 2.5 GiB to MiB.
- 2.5 × 1024 = 2560GiB to MiB: one step down
2560 MiB
Worked exampleWrite an expression for the number of bits in 6 MiB.
- 6 × 1024 × 1024MiB → KiB → bytes: two steps, × 1024 each
- 6 × 1024 × 1024 × 8bytes to bits: × 8
6 × 10242 × 8 (= 50 331 648 bits, but you don’t have to work it out)
Worked exampleA file is 786 432 bytes. Write its size in KiB.
- 786 432 ÷ 1024 = 768bytes to KiB: one step up, so ÷ 1024
768 KiB
Exam tipThe commonest slip is using 1000 or 1012 (terabytes) instead of 10244 (tebibytes). The second is using one 1024 too few: a TiB is four steps above a byte, so 10244, not 10243.
Edexcel 1CP2 · 2.3.1
Constructing expressions without a calculator
Paper 1 has no calculator. File-size questions usually say “Construct an expression… You do not have to do the calculation.”
- Marks go for each correct piece of the expression: the right values multiplied together, the ÷ 8, the right number of 1024s, and the right way up (what is on the top and bottom of a fraction).
- Equivalent forms all score: 1024 × 1024, 10242 and 220 are the same. So are ÷ 8 ÷ 1024 and ÷ (8 × 1024).
- Use brackets when you divide by more than one number:
x ÷ (8 × 1024), not x ÷ 8 × 1024, which would multiply by 1024. - Writing it as a fraction avoids bracket mistakes: put every multiplier on the top and every divider on the bottom.
- Fill in every box if the question gives a part-written expression. A blank box can’t score.
- If you do work out the answer, it can earn the marks, but a wrong answer with no expression shown earns nothing.
Worked exampleA drive holds 1 649 267 441 664 bytes. Construct an expression to give its capacity in TiB.
- 1 649 267 441 664 ÷ 10244bytes → KiB → MiB → GiB → TiB: four steps up
1 649 267 441 664 ÷ 10244 (it works out at 1.5 TiB)
Exam tipCheck your expression by its units: start with bits, ÷ 8 for bytes, then ÷ 1024 once for each step up. Say each unit as you go.
Edexcel 1CP2 · 2.3.1
Image file size
This builds on bitmaps, colour depth and pixels from the topic on representing text, images and sound.
- Image file size (bits) = width × height × colour depth, with width and height in pixels and colour depth in bits per pixel.
- ÷ 8 for bytes; then ÷ 1024 for KiB, again for MiB.
- Colour depth is a number of bits. Use 24, not 224 (that is the number of colours).
- The missing variable. If you know the file size and two of width, height and colour depth, rearrange: colour depth = size in bits ÷ (width × height). Turn the size into bits first.
- Real image files also hold metadata, so they are a little bigger than this. Questions tell you if it should be included.
Every file-size expression starts as a number of bits.
Worked exampleA photo is 1600 × 900 pixels with a colour depth of 24 bits. Construct an expression for its size in MiB.
- 1600 × 900 × 24bits
- 1600 × 900 × 24 ÷ (8 × 10242)÷ 8 for bytes, ÷ 1024 twice for MiB
1600 × 900 × 24 ÷ (8 × 1024 × 1024) (about 4.1 MiB)
Worked exampleAn image is 640 × 480 pixels and its file is exactly 900 KiB with no metadata. Construct an expression for its colour depth.
- 900 × 1024 × 8file size in bits: KiB → bytes → bits
- 900 × 1024 × 8 ÷ (640 × 480)divide by the number of pixels
900 × 1024 × 8 ÷ (640 × 480) = 24 bits per pixel
Exam tipRead whether the question asks for image size or file size. Image size is just width × height in pixels; file size also needs colour depth.
Edexcel 1CP2 · 2.3.1
Sound file size
- Sound file size (bits) = sample rate × bit depth × duration × number of channels.
- Sample rate is in hertz (samples per second); bit depth is bits per sample; duration must be in seconds (3 minutes = 3 × 60).
- Channels: mono = 1, stereo = 2. CD quality is 44 100 Hz, 16 bits, stereo.
- Then ÷ 8 for bytes and ÷ 1024 for each step up, exactly as for images.
- Missing variable: e.g. duration = size in bits ÷ (sample rate × bit depth × channels).
Worked exampleA 30-second mono clip is sampled at 22 050 Hz with a bit depth of 8. Construct an expression for its size in KiB.
- 22 050 × 8 × 30 × 1rate × depth × seconds × channels = bits
- 22 050 × 8 × 30 ÷ (8 × 1024)÷ 8 for bytes, ÷ 1024 for KiB
22 050 × 8 × 30 ÷ (8 × 1024) (about 646 KiB)
Worked exampleA mono recording at 16 000 Hz and 16 bits is 1875 KiB. Construct an expression for its length in seconds.
- 1875 × 1024 × 8size in bits
- 1875 × 1024 × 8 ÷ (16 000 × 16 × 1)divide by the bits used each second
1875 × 1024 × 8 ÷ (16 000 × 16) = 60 seconds
Exam tipTwo easy marks to lose: forgetting × 2 for stereo, and leaving the duration in minutes.
Edexcel 1CP2 · 2.3.1
Text files and storage capacity
- Text file size (bits) = number of characters × 7, because ASCII uses 7 bits per character. Spaces and punctuation are characters too.
- How many files fit? Number of files = capacity ÷ size of one file, with both in the same unit first.
- Round down: you can’t store part of a file.
- Capacity requirements: to find the storage needed, multiply the size of one file by the number of files, then convert to the unit asked for.
Worked exampleA text file holds 12 000 ASCII characters and nothing else. Construct an expression for its size in bytes.
- 12 000 × 77 bits per character
- 12 000 × 7 ÷ 8bits to bytes
12 000 × 7 ÷ 8 = 10 500 bytes
Worked exampleAn e-reader has 8 GiB free. Each book file is 2 MiB. Construct an expression for how many books fit.
- 8 × 1024turn the capacity into MiB, the same unit as one file
- 8 × 1024 ÷ 2capacity ÷ one file
8 × 1024 ÷ 2 = 4096 books
Edexcel 1CP2 · 2.3.2
Why data is compressed
Compression is a technique for reducing the size of a file.
- Smaller files take up less storage space, so more fit on a device or server.
- Smaller files take less time to transfer over a network: quicker to upload, download or send as an attachment.
- Streaming audio and video needs less data each second, so playback is less likely to pause to buffer, even on a slow connection.
- Less data sent also means less of a mobile data allowance is used, and it can fit under email size limits.
- Compression software is also a utility program: see operating systems and utility software.
Exam tip“To save space” is a start; say what it allows: more files on the device, or faster transfer because there are fewer bits to send.
- Compression
- A technique for reducing the size of a file.
Edexcel 1CP2 · 2.3.2
Lossless and lossy compression
- Lossless: the original file can be exactly reconstructed from the compressed data. Nothing is lost; the data is just stored more efficiently (for example, by recording patterns that repeat).
- Lossy: some data is permanently removed, so the original can’t be rebuilt. It removes data people are least likely to notice, such as sounds outside human hearing or tiny colour differences.
- Lossy usually gives a much smaller file than lossless (a higher compression ratio).
- Compressing a lossy file again, or editing and re-saving it, loses more data each time.
- You don’t need to know any particular compression algorithm or file format.
Lossless gives back every bit; lossy doesn’t.
Exam tip“Lossy reduces the quality” on its own doesn’t score. Say that data is permanently removed, and link the effect to what people see or hear, e.g. “fine detail in the background of the photo is lost, but the viewer is unlikely to notice”.
- Lossless compression
- Compression that lets the original file be exactly reconstructed from the compressed data.
- Lossy compression
- Compression that permanently removes some data, so the original file can’t be exactly reconstructed.