KS41CP2 2.3 26 min read 10 question quiz 12 exam marks

Data Storage and Compression

Edexcel's binary storage units, the three types of secondary storage and how to choose between them, and lossy against lossless compression with the reasoning that earns the marks.

Units of storage

A bit is one binary digit. A nibble is 4 bits. A byte is 8 bits.

Edexcel uses binary prefixes, in which each unit is 1024 of the one below:

UnitSize
kibibyte (KiB)1024 bytes
mebibyte (MiB)1024 KiB
gibibyte (GiB)1024 MiB
tebibyte (TiB)1024 GiB
1024, not 1000

This is a genuine board difference and it changes every answer. Divide by 1024 at every step and label the unit with the correct name.

Why 1024 and not 1000

Memory is addressed in binary, so its natural sizes are powers of two. 1024 is 2 to the power 10, which is the nearest power of two to a thousand, and that is why it became the unit.

Number base converter

Convert between denary, binary and hexadecimal, with every step of the working written out. This tool needs JavaScript, so turn it on to use it. Everything you need to answer the exam question is explained in the text above.

The units of data storage, each step a thousand times the lastThe units of data storage drawn as a staircase, each step sitting on the one below it. A bit is a single binary digit, one 0 or one 1, and it is the smallest thing a computer can store. A nibble is four bits. Eight bits make a byte, which is enough to hold one character of text. A thousand bytes make a kilobyte, roughly a page of plain text. A thousand kilobytes make a megabyte, about the size of a photograph or a minute of music. A thousand megabytes make a gigabyte, about a film, and a thousand gigabytes make a terabyte, about the capacity of a hard disk. Each step up from the byte is a thousand times the last.bit1byte8 bitsAKB1,000 bytesa page of textMB1,000 KBa photographGB1,000 MBa filmTB1,000 GBa hard diskeach step up is × 100012345
  1. A bit is one binary digit: a single 0 or a single 1.
  2. Eight bits make a byte, which is enough for one character.
  3. A thousand bytes make a kilobyte. A page of plain text.
  4. A thousand kilobytes make a megabyte. A photograph, or a minute of music.
  5. A thousand megabytes make a gigabyte, and a thousand of those a terabyte.
Each step up is a thousand times the last. That is why a film does not fit on a floppy disk and a text file always will.
File size formulas for an image, a sound and a piece of text, each worked through to a size in bytesThe file size of three kinds of data, each worked through from the formula to a size. For an image, multiply the width by the height by the colour depth: 1,000 times 800 times 24 is 19,200,000 bits, which divided by 8 is 2,400,000 bytes, or 2.4 megabytes. For a sound, multiply the sample rate by the bit depth by the number of seconds: 44,100 times 16 times 10 is 7,056,000 bits, which divided by 8 is 882,000 bytes, or 0.88 megabytes. For text, multiply the number of characters by the bits per character: 2,000 times 8 is 16,000 bits, which divided by 8 is 2,000 bytes, or 2 kilobytes. To move up the units, divide bits by 8 for bytes, then by 1,000 for kilobytes, megabytes and gigabytes. OCR, AQA and Key Stage 3 use 1,000. Edexcel uses 1,024 and the names kibibyte, mebibyte and gibibyte.Image1width1,000× height800× colour depth24= 19,200,000 bits÷ 8 = 2,400,000 bytes2.4 MBSound2sample rate44,100× bit depth16× seconds10= 7,056,000 bits÷ 8 = 882,000 bytes0.88 MBText3characters2,000× bits each8= 16,000 bits÷ 8 = 2,000 bytes2 KBFrom bits to bigger units4bits÷ 8bytes÷ 1000KB÷ 1000MB÷ 1000GBOCR, AQA and Key Stage 3 divide by 1000. Edexcel divides by 1024 and writes KiB, MiB and GiB.
  1. Image: width × height × colour depth. Every pixel costs the colour depth in bits.
  2. Sound: sample rate × bit depth × seconds, and × 2 for stereo.
  3. Text: number of characters × bits per character. ASCII uses 8.
  4. Divide by 8 to turn bits into bytes, then by 1,000 for each step up.
Every file size question is the same three steps: multiply, divide by 8, then change the unit. Show each step.

Secondary storage

Primary storage is memory the processor can address directly, chiefly RAM, and it is volatile: its contents are lost when power is removed. Secondary storage is non volatile and holds programs and data permanently.

Magnetic

A hard disk drive stores data as magnetised regions on spinning platters, read by a moving head.

  • Very large capacities at a low cost per gigabyte.
  • Slower than solid state, because the head must physically move to the data.
  • Fragile when moved, since it contains moving parts.
  • Suits desktop machines, servers and backups where capacity matters more than speed.

Solid state

A solid state drive stores data in flash memory cells with no moving parts.

  • Much faster access, and the same speed wherever the data is stored.
  • Silent, durable and low power, which matters in a laptop.
  • More expensive per gigabyte.
  • A finite number of write cycles per cell, though modern drives outlast most machines.

Optical

CDs, DVDs and Blu-ray discs store data as pits and lands read by a laser.

  • Very cheap per disc and easy to distribute or post.
  • Low capacity and slow.
  • Read only formats cannot be altered, which suits distributing software or films.

Choosing between them

The right answer to a "which should they use" question always comes from the situation given. Ask four questions: how much capacity is needed, how fast must access be, will the device be carried around, and what is the budget. A laptop for a travelling salesperson wants solid state for durability and speed. An archive of ten years of CCTV wants magnetic for cost per terabyte.

The memory hierarchyA four level pyramid. Registers sit at the top holding a few bytes and are the fastest and most expensive storage. Below them cache holds kilobytes to megabytes and is very fast. Below that RAM holds gigabytes, is fast and is volatile. At the base secondary storage holds gigabytes to terabytes, is slow and is non volatile. Moving up the pyramid storage gets faster, smaller and more expensive per byte. Moving down it gets larger and cheaper.Registersa few bytesfastest, most expensiveCacheKB to MBvery fastRAMGBfast, volatileSecondary storageGB to TBslow, non volatilefasterbigger and cheaper
The pattern is consistent: the closer to the processor, the faster, the smaller and the more expensive per byte.
Three kinds of secondary storage: magnetic, solid state and opticalThe three kinds of secondary storage, as the three different physical things they are. A magnetic hard disk drive is a stack of spinning platters coated in magnetic material, with a read write head floating just above the surface and moving in and out to reach different tracks. It is the cheapest per gigabyte and comes in the largest capacities, but it is slow, noisy, uses more power, and because it has moving parts it is damaged by knocks. A solid state drive is a circuit board of flash memory chips with no moving parts, so it is fast, silent and tough, but costs more per gigabyte. An optical disc has one spiral track of tiny pits and flat lands that a laser reads: it is cheap and portable but holds little and scratches easily. Which one to choose depends on capacity, speed, durability and cost per gigabyte.MagneticSolid stateOpticalplattersread-write headCTRLflash memory chipsa laser reads the pitsCheapest per gigabyteHuge capacityMoving parts, slowNo moving partsFast, quiet, toughDearer per gigabyteCheap and portableSmall capacityScratches easilyChoose by:capacityspeeddurabilitycost per gigabyte1234
  1. Magnetic: spinning platters with a head floating over the surface.
  2. Solid state: a grid of cells holding charge, with no moving parts.
  3. Optical: one spiral track of pits and lands, read by a laser.
  4. Which one depends on capacity, speed, durability and cost per gigabyte.
Exam answers need the reason, not the name: no moving parts is why an SSD survives being dropped and starts up faster.
A hard disk drive with the lid removedA hard disk drive with the lid removed, showing the mirrored circular platter, the pivoting actuator arm reaching across it and the read write head at the tip of the arm.plattera mirror disc that stores the dataread-write headfloats above the platterspindle motorspins the platter at 7,200 rpmactuator armswings the head across
The head never touches the platter. It floats a few nanometres above a surface spinning at 7,200 revolutions a minute, which is why a knock while it is running destroys the drive.Drawn illustration
A solid state drive with its case openA solid state drive with its case opened, showing a circuit board carrying several flash memory chips and a controller chip, with no moving parts.flash memory chipsthis is where the data iscontrollermanages the chipsconnectorplugs into the computerno moving parts
Nothing in here moves. That single fact explains the speed, the silence, the power saving and the durability all at once.Drawn illustration

Compression

Compression reduces the number of bits needed to store a file, which saves storage, reduces transmission time and uses less bandwidth.

Lossy

Lossy compression permanently removes data judged to be less important. The reduction is large and the original cannot be recovered exactly.

JPEG discards fine colour detail the eye barely registers. MP3 removes frequencies most people cannot hear and sounds masked by louder ones.

Appropriate for photographs, music and video, where human perception does not notice what has gone.

Lossless

Lossless compression stores exactly the same information more efficiently, so the original file is reconstructed perfectly. The reduction is more modest.

Used by PNG, ZIP and FLAC, and essential for text, program code, spreadsheets and databases, where every character matters and removing any of it would corrupt the file.

Run length encoding

A simple lossless method that replaces a run of repeated values with the value and a count.

W W W W B B W W W W W W becomes 4W 2B 6W.

Twelve values become six, and nothing is lost. It works well on simple graphics with blocks of flat colour, and badly on photographs, where almost every run has length one and the result is larger than the original.

Justify the choice from the file type

"Lossless, because it is a spreadsheet and losing any value would make the figures wrong" is the full answer. Simply naming a method is half of it.

Lossless and lossy compression compared with the original fileCompression, with the length of each bar at the bottom standing for the size of the file. The original holds every byte of the data. Lossless compression finds repetition and records it more briefly: run length encoding replaces a run of identical values with the value and a count, so six As followed by three Bs becomes 6A 3B, and Huffman coding gives the most common symbols the shortest codes. Nothing is discarded, so unpacking returns exactly the original file, bit for bit, though the saving is modest. Lossy compression throws data away permanently, such as detail the eye is unlikely to miss, and so the file becomes much smaller but the original can never be recovered. Text and program code must be lossless because one wrong byte breaks them. Photos and music can usually be lossy.OriginalLosslessLossy12 MBevery byte of the data,nothing thrown awayfinds repetition and says it shorterAAAAAABBB6A3B6 MBunpack it: identical1 MBdetail thrown awayand never coming backOriginal12 MBLossless6 MBLossy1 MB1234
  1. The original file: every byte of the data, nothing thrown away.
  2. Lossless finds repetition and records it more briefly.
  3. Unpack it and you get back exactly what you started with.
  4. Lossy throws data away permanently, and gets much smaller.
Ask what happens if one byte changes. If the answer is that it breaks, the compression has to be lossless.
Lossless against lossy compression: a picture before and after, and when to use eachTwo ways to compress a file. With lossless compression a 5 megabyte picture is compressed to 3.2 megabytes using something like ZIP, PNG or FLAC, and when it is restored it is identical to the original, because nothing is lost. With lossy compression the same picture is compressed to 0.5 megabytes using something like JPEG, MP3 or MP4, and when it is restored it is not identical, because detail has been thrown away for good. Lossless suits text, programs, spreadsheets and medical scans, anything that must be exact. Lossy suits photos, music and video, where small losses go unnoticed and the files shrink a lot.Lossless1original5.0 MBcompressed3.2 MBrestoredidenticalZIP, PNG, FLACnothing is lost: every bit comesbackLossy2original5.0 MBcompressed0.5 MBrestorednot identicalJPEG, MP3, MP4detail is thrown away for goodWhich to use?3Losslesstext, programs, spreadsheets, medicalscans: anything that must be exactLossyphotos, music, video: small losses gounnoticed and the files shrink a lot
  1. Lossless: the file gets smaller, and decompressing gives back exactly the original.
  2. Lossy: the file gets much smaller, but detail is thrown away for good, so it cannot be restored exactly.
  3. Choose lossless when the data must be exact, and lossy when small losses do not matter.
Lossy files can never be restored to the original. That is the trade for a much smaller file.

Key terms you must be able to define

Bit
A single binary digit, either 0 or 1.
Byte
Eight bits.
Kibibyte
1024 bytes.
Mebibyte
1024 kibibytes.
Volatile
Losing its contents when power is removed, as RAM does.
Secondary storage
Non volatile storage holding programs and data permanently.
Magnetic storage
Storage using magnetised regions on spinning platters, read by a moving head.
Solid state storage
Storage using flash memory cells with no moving parts.
Optical storage
Storage using pits and lands on a disc, read by a laser.
Lossy compression
Compression that permanently removes data, so the original cannot be recovered exactly.
Lossless compression
Compression that stores the same information more efficiently, so the original is recovered exactly.
Run length encoding
A lossless method replacing a run of repeated values with the value and a count.

Flashcards

Say the definition out loud before you flip the card. Retrieving it from memory is what builds recall, reading it again is not.

DefineBit
AnswerA single binary digit, either 0 or 1.
DefineByte
AnswerEight bits.
DefineKibibyte
Answer1024 bytes.
DefineMebibyte
Answer1024 kibibytes.
DefineVolatile
AnswerLosing its contents when power is removed, as RAM does.
DefineSecondary storage
AnswerNon volatile storage holding programs and data permanently.
DefineMagnetic storage
AnswerStorage using magnetised regions on spinning platters, read by a moving head.
DefineSolid state storage
AnswerStorage using flash memory cells with no moving parts.

Reach the top grade on this topic

Storage questions are almost always scenario questions, and the marks are for matching the choice to the situation.

Quote the situation back. "The drive will be carried between sites, so solid state is the better choice because it has no moving parts to be damaged by being knocked" uses the question rather than reciting a table.

Give capacity and cost together. Magnetic wins on cost per terabyte, which only matters when the capacity required is large. Saying both makes the argument complete.

Justify compression from what the file is. Photographs and music tolerate loss because perception does not register it. Text and code cannot, because every character carries meaning.

Use the right units. Kibibyte, mebibyte, gibibyte, and divide by 1024.

Mistakes that cost marks here

Avoid these
  • Dividing by 1000 rather than 1024.
  • Saying lossless compression removes data. It removes redundancy in how data is stored.
  • Recommending optical storage for anything needing speed or large capacity.
  • Claiming solid state is always the right choice. Cost per gigabyte still favours magnetic for large archives.
  • Assuming run length encoding always reduces size. On data without runs it makes the file larger.
Fun fact

A solid state drive has no moving parts at all, but each memory cell can only be rewritten a finite number of times. Drives spread writes evenly across every cell precisely so that no single one wears out first.

Knowledge check

0 of 10 answered
1How many bytes are in one mebibyte?
2Which storage type has no moving parts?
3Why is magnetic storage often chosen for large backups?
4What is the defining feature of lossless compression?
5How would B B B W W B be written using run length encoding?
6Why would run length encoding be a poor choice for a photograph?
7Which is the correct term for storage whose contents are lost when power is removed?
8Which compression method would be appropriate for a spreadsheet of financial figures?
9A file is 4 GiB. How many mebibytes is that?
10Why does a solid state drive have a limited lifetime?
Score 0 / 10

Exam-style questions

Five written questions in the style of the real paper. Write a full answer, then let the marker check it against the mark scheme.

12 marks
1State one advantage of solid state storage over magnetic storage.1 mark
State

Mark scheme0 / 1
  • LFaster access, or no moving parts so more durable, or lower power use
Model answer

Solid state storage has no moving parts, so it is far more durable when the device is carried around, and data is accessed considerably faster because there is no read head that must physically move to the right place.

The marker looks for key phrases. If you said it another way and it is still right, give yourself the mark.
2A film company needs to store 40 TiB of raw footage that will be archived and rarely accessed. Recommend a type of secondary storage and justify your choice.4 marks
Recommend

Mark scheme0 / 4
  • LRecommends magnetic storage
  • LJustifies it on the very large capacity required
  • LJustifies it on cost per gigabyte or terabyte
  • LNotes that the slower access speed does not matter for an archive
Model answer

The company should use magnetic hard disk storage. The volume involved is very large, and magnetic drives offer by far the lowest cost per terabyte at that scale, so the whole archive can be held for a fraction of what solid state would cost. The main drawback of magnetic storage is that access is slower, because the read head has to move physically to the data, but that is close to irrelevant here since the footage is being archived and will rarely be read. Optical storage is unsuitable because a single disc holds only a few gigabytes, so 40 tebibytes would need thousands of them.

The marker looks for key phrases. If you said it another way and it is still right, give yourself the mark.
3Explain the difference between lossy and lossless compression.4 marks
Explain

Mark scheme0 / 4
  • LLossy compression permanently removes data
  • LSo the original file cannot be recovered exactly
  • LLossless compression stores the same data more efficiently
  • LSo the original file can be reconstructed exactly
Model answer

Lossy compression achieves a large reduction in size by permanently discarding data that is judged to be less important, such as colour detail in an image that the eye barely registers or frequencies in audio that most people cannot hear. Because that data is gone, the original file can never be reconstructed exactly. Lossless compression instead finds a more efficient way of storing exactly the same information, for example by replacing runs of repeated values with a value and a count. Nothing is discarded, so decompressing gives back a file identical to the original, but the reduction achieved is more modest than lossy compression can manage.

The marker looks for key phrases. If you said it another way and it is still right, give yourself the mark.
4A row of pixels contains B B B B B W W B B B. Show how it would be stored using run length encoding, and state how many values are saved.3 marks
Show

Mark scheme0 / 3
  • LIdentifies the runs as five B, two W, three B
  • LWrites them as value and count pairs
  • LStates that six values replace ten, saving four
Model answer

The row contains five B, then two W, then three B, so under run length encoding it is stored as the pairs 5B, 2W, 3B. That is three pairs, which is six values in total, in place of the ten values in the original row, so four values are saved. Nothing has been lost, since the original row can be written out again exactly from the pairs.

The marker looks for key phrases. If you said it another way and it is still right, give yourself the mark.
Machine mark 0 / 12