TopMyGrade

GCSE/Computer Science/OCR

1.2.1Primary storage (memory): RAM and ROM, the need for primary storage, virtual memory and the role of cache

Notes

Primary storage: RAM, ROM, virtual memory and cache

Primary storage is memory the CPU can access directly and immediately. OCR J277 Paper 1 regularly tests the differences between RAM and ROM, and the need for primary storage.

Why is primary storage needed?

The CPU can only directly access data and instructions held in primary storage (RAM). Secondary storage (hard disks, SSDs) is too slow for direct CPU access — data must be loaded into RAM first before the CPU can process it.

  • Programs run from RAM.
  • Currently open files are in RAM.
  • The operating system kernel runs from RAM (part of it may be in ROM on embedded devices).

RAM (Random Access Memory)

PropertyDetail
VolatileContents lost when power is removed
Read/writeCan be written to and read from repeatedly
SpeedFast (much faster than secondary storage)
CapacityTypically 4 GB – 64 GB in modern computers
PurposeHolds currently running programs and open data
  • If a computer has more RAM, more programs can run simultaneously without slowing down.
  • When RAM is full, the computer uses virtual memory (see below).

ROM (Read-Only Memory)

PropertyDetail
Non-volatileContents are retained when power is removed
Read-onlyCannot be written to under normal operation
SpeedFast
CapacityVery small (kilobytes to a few megabytes)
PurposeStores the BIOS/firmware — the startup instructions that run before the OS loads
  • ROM is important because the CPU needs instructions immediately on power-up, before any OS is loaded.
  • Modern devices may use Flash ROM (EEPROM) which can be updated via firmware updates.

Virtual memory

Virtual memory is a section of secondary storage (e.g. part of the hard disk or SSD) used as an extension of RAM when RAM is full.

How it works

  1. When RAM is full and a new program is needed, the OS moves the least-recently-used pages of RAM to a page file (swap file) on disk.
  2. This frees up space in RAM for the new program.
  3. When the swapped-out data is needed again, it is moved back into RAM (possibly swapping out something else).

Effect on performance

  • Virtual memory is much slower than RAM (disk access is ~100,000× slower).
  • Excessive use of virtual memory causes thrashing — the system spends most of its time swapping data in and out instead of processing.
  • Adding more RAM reduces reliance on virtual memory.

Cache (role in primary storage)

Cache is a very small, very fast type of primary memory built into or near the CPU.

  • Sits between the CPU and RAM in the memory hierarchy.
  • Stores copies of frequently accessed data/instructions.
  • Purpose: reduces the number of times the CPU must wait for RAM access.

Memory hierarchy summary

LevelSpeedCapacityCost per GB
RegistersFastestBytes— (in CPU)
Cache (L1/L2/L3)Very fastKB–MBVery high
RAMFastGBHigh
Virtual memorySlowGB (disk)Low
Secondary storageSlowestTBLow

Common OCR exam mistakes

  1. Saying ROM is "read-only because it stores programs" — RAM also stores programs. ROM is read-only because it retains data without power and stores startup instructions.
  2. Saying virtual memory is "extra RAM" — it is disk space used to simulate RAM; it is much slower.
  3. Forgetting that RAM is volatile — this is a key distinction often tested.
  4. Confusing cache with RAM — cache is faster and inside/close to the CPU; RAM is separate and slower.

AI-generated · claude-opus-4-7 · v3-ocr-computer-science

Practice questions

Try each before peeking at the worked solution.

  1. Question 14 marks

    RAM vs ROM

    State two differences between RAM and ROM. [4 marks]

    Ask AI about this

    AI-generated · claude-opus-4-7 · v3-ocr-computer-science

  2. Question 22 marks

    Why is RAM needed?

    Explain why programs need to be loaded into RAM before they can be run. [2 marks]

    Ask AI about this

    AI-generated · claude-opus-4-7 · v3-ocr-computer-science

  3. Question 33 marks

    Virtual memory

    Explain what virtual memory is and describe one disadvantage of using it. [3 marks]

    Ask AI about this

    AI-generated · claude-opus-4-7 · v3-ocr-computer-science

  4. Question 42 marks

    ROM and startup

    Explain why computers use ROM to store the BIOS (startup instructions). [2 marks]

    Ask AI about this

    AI-generated · claude-opus-4-7 · v3-ocr-computer-science

Flashcards

1.2.1 — Primary storage (memory): RAM and ROM, the need for primary storage, virtual memory and the role of cache

8-card SR deck for OCR Computer Science (J277) topic 1.2.1

8 cards · spaced repetition (SM-2)