← OCR GCSE (J277) hub

1.2.1 Primary Storage (Memory)

OCR GCSE Computer Science (J277) · Why computers need memory, RAM vs ROM, virtual memory and cache — with simulators, activities and exam practice.

What you must learn

This is taken directly from the OCR specification. Tick each line when you can explain it without looking. Your ticks are saved in this browser.

Required by the specification

Your activity progress

Exam tip: this topic is usually tested with short "state", "describe" and "explain" questions worth 1–4 marks, plus occasional 6-mark questions on virtual memory. Learn the key words — volatile, non-volatile, bootstrap, temporary, swap, page — because mark schemes look for them.

1 · Why do computers need primary storage?

The CPU can only work on instructions and data that it can reach very quickly. Secondary storage (hard disk, SSD) keeps everything safe when the power is off, but it is far too slow for the CPU to fetch each instruction from it. So the computer has primary storage — memory the CPU can access directly — and the CPU's fetch–decode–execute cycle reads from there.

Definition: Primary storage (memory) is storage that the CPU can access directly. It holds the instructions and data the processor is currently using. It usually consists of RAM and ROM.

The memory hierarchy — click each layer

The closer to the CPU, the faster and smaller (and more expensive per byte) the storage is.

Registers Cache RAM (and ROM) Secondary storage (HDD / SSD) faster · smaller bigger · slower · cheaper Primary storage = the layers the CPU can access directly (green and above)
Click a layer of the pyramid to read about it.

Activity 1 — order the storage Activity

Use the arrows to put these in order from fastest (top) to slowest (bottom).

    What happens when you switch a computer on? — Activity 2 Activity

    This is where ROM and RAM work together. Put the boot sequence in the correct order.

      ROMbootstrap RAMoperating system SSD / HDDOS stored here CPU 1. runs bootstrap 2. OS copied into RAM 3. CPU runs OS

      2 · RAM and ROM

      Primary storage usually consists of two kinds of memory chip. They look similar but do opposite jobs.

      RAM — Random Access Memory

      • Purpose: holds the operating system, programs and data currently in use so the CPU can access them quickly.
      • Volatile — contents are lost when the power is off.
      • Read and write — the CPU constantly changes what is in it.
      • Large — typically 4–32 GB in a modern PC.
      • Can be upgraded — more RAM lets you run more programs at once before virtual memory is needed.

      ROM — Read Only Memory

      • Purpose: stores the bootstrap program (BIOS) — the instructions the CPU needs to start up the computer and load the operating system from secondary storage into RAM.
      • Non-volatile — contents are kept when the power is off.
      • Read only — cannot normally be changed by the user.
      • Small — a few megabytes.
      • Also found in embedded systems (washing machines, routers) to hold their firmware.
      Why both? When you switch on, RAM is empty (it is volatile) — so the CPU would have nothing to do. ROM gives it a permanent starting program. Once the OS is in RAM, the computer works from RAM because it is big and writable.

      Flash cards — click to flip

      Activity 3 — RAM or ROM? Activity

      Drag each statement into the correct box (or click a statement, then click a box). Then press Check.

      RAM

      ROM

      3 · Virtual memory

      Why it is needed: every program you open needs space in RAM. If you open more programs (or bigger ones) than the RAM can hold, the computer would have to refuse to open them — or crash. Virtual memory solves this by using part of secondary storage (the hard disk or SSD) as if it were extra RAM.

      How it works:

      1. RAM becomes full.
      2. The operating system picks data or programs in RAM that are not currently being used.
      3. It moves (swaps) them out of RAM to an area of secondary storage called the swap file / page file.
      4. The freed space in RAM is used by the program that needs it.
      5. When the swapped-out program is needed again, it is moved back into RAM (and something else may be moved out to make room).
      The drawback (this is the bit examiners love): secondary storage is much slower than RAM, so constantly swapping data back and forth makes the computer run slowly. This is sometimes called disk thrashing. The real fix is to add more RAM.

      Activity 4 — Virtual memory simulator Activity

      This computer has 4 pages of RAM. Click programs to open them, then click an open program to use it. Watch what happens once RAM is full.

      RAM (fast)0 / 4

      Secondary storage — swap file (slow)0

      Swaps so far0
      Time spent waiting0 ms

      Check your understanding

      Based on what you saw: open five programs, then use the one that was swapped out. In the box, explain what the operating system did and why the computer slowed down. Use the words RAM, full, secondary storage, swap, slower.

      4 · Cache

      Even RAM is slow compared with the CPU — a modern processor can execute billions of instructions a second and would spend most of its time waiting for RAM. Cache is a small amount of very fast memory inside or next to the CPU that keeps a copy of the most frequently or recently used instructions and data.

      • When the CPU needs something, it checks the cache first. If it is there — a cache hit — it gets it almost instantly.
      • If not — a cache miss — it fetches it from RAM (slower) and usually stores a copy in the cache for next time.
      • Cache is smaller than RAM (megabytes, not gigabytes) because it is expensive, and it is volatile like RAM.
      • More cache (or a higher hit rate) means the CPU waits less, so performance improves.
      CPU Cachesmall · very fast RAMlarge · slower hit? miss → fetch

      Activity 5 — Cache hit or miss? Activity

      The CPU is going to request a series of data items. The cache holds 4 items. Before each request, predict: will it be a hit or a miss? (When the cache is full, the oldest item is replaced.)

      Next request: —   Requests remaining: 0

      Correct predictions0
      Hits0
      Misses0
      Hit rate—

      5 · Quick quiz

      Ten multiple-choice questions covering the whole topic. Answer them all, then press Mark.

      6 · Exam-style questions

      Write your answer in the box, then reveal the mark scheme and mark yourself honestly — tick each marking point you made. Remember: in "explain" questions you need the point and the reason.

      Self-marked total: 0 / 0

      7 · Questions from real OCR papers

      These are the primary-storage questions that have actually appeared in OCR GCSE papers, reworded in brief. Each shows the paper, question number and marks. Answer first, then reveal the mark scheme — tick-box questions are marked automatically; written answers you mark yourself.

      Pattern to notice: OCR nearly always wraps this topic in a device — a Sat Nav, a smart TV, a car's "Follow Me" system. Your answer must refer back to that device ("the Sat Nav's RAM holds the current route") — generic answers lose marks. The originals are free to download from the OCR J277 assessment page.
      Past-paper total: 0 / 0