💻 Paper 1 · 1.3 Processor Fundamentals
1.3.5 Memory Types — RAM, ROM and Cache
Cambridge 9618 · International A Level Computer Science · ~14 min read
Notes
Video
Slides
Quiz
Worksheet

The Memory Hierarchy

Computer systems use a hierarchy of memory types, trading off speed, cost, and capacity. As you move up the hierarchy, memory becomes faster but smaller and more expensive per byte.

CPU Registers
Fastest · Bytes · Built into CPU
↓ slower, cheaper, larger ↓
L1 Cache (SRAM)
~1-4 ns · KB · Per core
L2 Cache (SRAM)
~4-12 ns · MB · Per core or shared
Main Memory RAM (DRAM)
~50-100 ns · GB · Volatile
Secondary Storage
ms range · TB · Non-volatile

RAM (Random Access Memory)

RAM is volatile — data is lost when power is removed. It is read/write memory used to hold the currently running programs and their data.

DRAM (Dynamic RAM)

  • Stores each bit as a charge in a tiny capacitor
  • Capacitors discharge over time → must be refreshed thousands of times per second
  • Slower than SRAM but much cheaper and denser (more storage per area)
  • Used for main memory (the GB of RAM in your computer)

SRAM (Static RAM)

  • Stores each bit using a set of transistors (flip-flop) — no capacitor, no refresh needed
  • Much faster than DRAM; retains data as long as power is supplied
  • More complex circuit → more expensive and less dense than DRAM
  • Used for cache memory (L1, L2, L3)
PropertyDRAMSRAM
TechnologyCapacitor + transistor (1T1C)Flip-flop (6 transistors)
Refresh needed?Yes — frequent refresh requiredNo
SpeedSlower (~50-100 ns)Much faster (~1-4 ns)
Cost per bitCheaperMore expensive
DensityHigher (more storage per chip area)Lower
UseMain memory (RAM sticks)CPU cache (L1, L2, L3)

ROM (Read Only Memory)

ROM is non-volatile — data is retained without power. Traditional ROM is read-only and is programmed during manufacture. It stores firmware — software permanently embedded in hardware, such as the BIOS/UEFI that starts a computer.

  • PROM (Programmable ROM): can be written once by the user; permanent after that
  • EPROM (Erasable Programmable ROM): can be erased with UV light; reprogrammable
  • EEPROM (Electrically Erasable Programmable ROM): erased and reprogrammed using electrical signals without removing from circuit — the basis of flash memory

Cache Memory

Cache is a small, very fast type of memory (SRAM) located between the CPU and main RAM. Its purpose is to reduce the time the CPU spends waiting for data from the slower main RAM.

Cache works by storing recently used or frequently used instructions and data. When the CPU needs data, it checks the cache first:

  • Cache hit — data is found in cache → fast access, no RAM access needed
  • Cache miss — data not in cache → CPU must fetch from RAM, data copied to cache for future use

Cache Levels

LevelSizeSpeedLocation
L1 CacheSmallest (KB)FastestDirectly on each CPU core
L2 CacheMedium (MB)Slightly slower than L1On each core or shared
L3 CacheLargest (MB)Slower than L2, but faster than RAMShared between all cores on the chip

Why Cache Works — Locality of Reference

  • Temporal locality: recently accessed data is likely to be accessed again soon (e.g. loop variables)
  • Spatial locality: data near recently accessed data is likely to be needed soon (e.g. next instruction in sequence, adjacent array elements)

A larger cache generally reduces the miss rate — more data can be stored near the CPU. However, larger cache is more expensive and physically harder to fit close to the processor.

Exam tip: Cambridge questions on cache frequently ask you to explain why cache improves performance. Always mention: (1) cache is faster than RAM; (2) frequently used data is stored closer to the CPU; (3) this reduces the number of slow RAM accesses (fewer cache misses). Also know the SRAM vs DRAM distinction — SRAM is used for cache, DRAM for main memory.
⚠️ Common Mistakes
  • Saying ROM is volatile — ROM is non-volatile (data persists without power). RAM is volatile.
  • Saying cache is a type of secondary storage — cache is primary memory (fast, close to CPU) not secondary storage
  • Confusing DRAM and SRAM — DRAM needs refreshing and is used for main memory; SRAM doesn't need refreshing and is used for cache
  • Saying a larger cache always means better performance — a larger cache reduces miss rate but there are diminishing returns; cache size alone doesn't determine performance
✅ Notes completed!
Video coming soon
Click slide or press arrow keys to navigate

Worksheet — 1.3.5 Memory Types

8 questions · instantly marked · Cambridge 9618 standard

Q1Compare DRAM and SRAM in terms of their technology, refresh requirement, speed, and typical use.[6]
✅ Mark scheme
Mark scheme
DRAM: stores bits as charge in capacitors [1]; requires frequent refreshing [1]; slower access [1]; used for main memory [1]. SRAM: uses flip-flops (transistors) [1]; no refresh needed [1]; faster access [1]; used for cache memory [1]. Award max 6.
Q2Explain what is meant by a cache hit and a cache miss, and describe what happens in each case.[4]
✅ Mark scheme
Mark scheme
Cache hit: the required data/instruction is found in cache [1]; CPU accesses it directly from cache — no need to access slower main RAM [1]; Cache miss: required data is not in cache [1]; CPU must fetch the data from main RAM (slower); data is then copied into cache for future use [1].
Q3Explain how cache memory improves the performance of the CPU.[3]
✅ Mark scheme
Mark scheme
Cache stores frequently used instructions and data [1]; cache is faster than main RAM so accessing data from cache takes less time [1]; this reduces the number of slow accesses to main RAM, allowing the CPU to spend less time waiting for data [1].
Q4Explain the concept of temporal locality and spatial locality in the context of cache memory.[4]
✅ Mark scheme
Mark scheme
Temporal locality: if data/instruction has been recently accessed, it is likely to be accessed again soon [1]; e.g. a loop variable accessed repeatedly [1]; Spatial locality: if data at one address is accessed, data at nearby addresses is likely to be needed soon [1]; e.g. the next sequential instruction, or adjacent array elements [1].
Q5Explain the difference between RAM and ROM, giving one use of each.[4]
✅ Mark scheme
Mark scheme
RAM is volatile (data lost when power removed) and read/write [1]; used to store currently running programs and their data [1]; ROM is non-volatile (data retained without power) and originally read-only [1]; used to store firmware/BIOS — instructions needed to boot the computer [1].
Q6A multi-core processor has L1, L2, and L3 cache. Describe how these cache levels differ and why multiple levels are used.[4]
✅ Mark scheme
Mark scheme
L1: smallest and fastest, private to each core [1]; L2: larger and slightly slower, per core or shared [1]; L3: largest and slowest of the three, shared between all cores [1]; multiple levels balance cost (SRAM is expensive) with the need to reduce miss rates — if not in L1, check L2, then L3, then RAM [1].
Q7Explain what EEPROM is and why it is useful compared to traditional ROM.[3]
✅ Mark scheme
Mark scheme
EEPROM is Electrically Erasable Programmable ROM [1]; unlike traditional ROM it can be erased and reprogrammed using electrical signals without being physically removed from the circuit [1]; useful because firmware/settings can be updated while the device is in use — e.g. BIOS updates, USB configuration [1].
Q8Explain why a computer cannot rely entirely on cache memory instead of main RAM.[3]
✅ Mark scheme
Mark scheme
Cache uses SRAM which is very expensive per byte [1]; cache has a very small capacity (KB to MB) while programs and data require GB of storage [1]; it would be prohibitively expensive and physically impractical to manufacture a CPU with GB of SRAM cache [1].
Topic Quiz
Question 1 of 15
You scored
out of 15
Card 1 of 10
Click to reveal definition
🎉
All cards reviewed!
TermDefinition
🎯

Mini Test — 1.3.5 Memory Types

10 questions · 10 marks · 10 minutes

← 1.3.4 I/O & Storage
22 of 82 · Cambridge 9618
1.3.6 Virtual Memory →
🔒
Pro lesson
Upgrade to CSZone Pro to access all Cambridge 9618 A Level lessons.
Upgrade to Pro →