Where does a computer keep data while it works?
Understand the difference between RAM and ROM, the purpose of each, and the need for virtual memory and cache.
A focused answer to AQA GCSE Computer Science 3.4.4, covering the difference between RAM and ROM, the purpose of each, and the need for virtual memory and cache.
Reviewed by: AI editorial process; not yet individually human-reviewed
Have a quick question? Jump to the Q&A page
Jump to a section
What this dot point is asking
AQA wants you to explain the difference between RAM and ROM, the purpose of each, and why cache and virtual memory are needed.
RAM
When you open a program, it is copied from secondary storage into RAM because RAM is much faster to access than a hard disk or SSD. More RAM lets more programs and larger data sets stay loaded at once, reducing the need to fall back on slower virtual memory.
ROM
ROM is essential because when a computer is first switched on, RAM is empty and the CPU needs instructions immediately. ROM provides those fixed start-up instructions, which load the operating system from secondary storage into RAM.
RAM versus ROM
Cache and virtual memory
Cache works because programs tend to reuse the same instructions and data repeatedly (for example inside a loop). Keeping those in fast cache means the CPU does not have to wait for the slower trip to RAM each time. There is a hierarchy of speed and size: registers (fastest, smallest), then cache, then RAM, then secondary storage (slowest, largest).
The memory hierarchy
The different stores form a hierarchy that trades speed against size and cost. At the top are the CPU registers and cache: tiny but extremely fast, holding the data the processor is using right now. Below them is RAM: larger and still fast, holding the running programs. Below that is secondary storage (hard disk or SSD): far larger and cheaper per gigabyte, but much slower, holding everything permanently. Virtual memory sits at the bottom of the "main memory" idea, borrowing slow secondary storage when RAM runs out. The general rule is that as you move down the hierarchy storage gets bigger and cheaper but slower, which is why frequently used data is kept as high up as possible.
Why both volatile and non-volatile memory are needed
A computer needs both kinds. Non-volatile ROM is needed at switch-on, because RAM is empty and the CPU must be told how to start; ROM holds those fixed boot instructions. Volatile RAM is needed while working, because it is fast and can be written and rewritten as programs run, even though it forgets everything at power-off. Non-volatile secondary storage is needed to keep the user's files and installed programs between sessions. No single type does all three jobs, which is why a real computer combines ROM, RAM, cache and secondary storage.
Try this
Q1. State one difference between RAM and ROM. [2 marks]
- Cue. RAM is volatile and loses contents without power; ROM is non-volatile and keeps its contents.
Q2. State the purpose of cache memory. [1 mark]
- Cue. To store frequently used data close to the CPU so it can be accessed quickly, reducing waiting.
Exam-style practice questions
Practice questions written in the style of AQA exam questions on this dot point, with worked answer explainers. The year tag is the paper they imitate, not the source.
AQA 20194 marksExplain the difference between RAM and ROM, referring to volatility, what each stores, and whether each can be written to.Show worked answer →
RAM is volatile: it loses its contents when the power is switched off. It can be both read and written, and it holds the operating system, programs and data currently in use so the CPU can access them quickly.
ROM is non-volatile: it keeps its contents when the power is off. It is normally read-only (its contents cannot easily be changed), and it stores the start-up instructions (the boot program or BIOS) that the computer needs to start.
Markers reward the volatile-versus-non-volatile contrast, the read/write versus read-only contrast, and the correct purpose of each (current programs versus boot instructions).
AQA 20224 marksA computer with limited RAM runs slowly when many programs are open. Explain how virtual memory allows the programs to keep running, and explain one drawback of relying on it.Show worked answer →
When the RAM is full, virtual memory uses part of the secondary storage (such as the hard disk or SSD) as if it were extra RAM. Data and pages that are not currently being used are moved from RAM to this storage to free space, and moved back when needed, so more programs can stay open than the RAM alone would allow.
The drawback is speed: secondary storage is far slower than RAM, so constantly moving data in and out (paging or "disk thrashing") slows the computer noticeably.
Markers reward the mechanism (using storage as extra RAM, swapping pages) and the speed drawback with its cause.
Related dot points
- Understand the purpose and components of the CPU, the fetch-execute cycle, and the factors that affect CPU performance.
A focused answer to AQA GCSE Computer Science 3.4.3, covering the purpose and components of the CPU, the fetch-execute cycle, and the factors that affect CPU performance.
- Understand the need for secondary storage and compare the three types: magnetic, optical and solid state.
A focused answer to AQA GCSE Computer Science 3.4.5, covering the need for secondary storage and comparing magnetic, optical and solid-state storage.
- Understand the difference between hardware and software, and the relationship between them in a computer system.
A focused answer to AQA GCSE Computer Science 3.4.1, covering the difference between hardware and software and the relationship between them in a computer system.
- Understand the role of the operating system and its functions, and the purpose of common utility software.
A focused answer to AQA GCSE Computer Science 3.4.6, covering the role and functions of the operating system and the purpose of common utility software.
Sources & how we know this
- AQA GCSE Computer Science (8525) specification — AQA (2020)