ExamShortcut

Hardware, Memory & Number Systems

🔒 Log in to track
high importance7 formulas⚡ 14 shortcuts6 subtopics

Memory hierarchy, RAM/ROM and cache

🔒 Log in to track

Storage is arranged by speed vs cost vs size. Going up the ladder: faster, costlier, smaller.

LevelExampleVolatile?Typical size
RegistersInside CPUYesBytes
Cache (L1/L2/L3)SRAM on/near CPUYesKB - MB
Main memoryRAM (DRAM)YesGB
Solid-state storageSSD, pen driveNoGB - TB
Magnetic/opticalHDD, DVDNoGB - TB
ArchivalMagnetic tape, cloud cold storageNoTB - PB

RAM (volatile - contents vanish at power-off): SRAM - fast, costly, no refresh, used for cache; DRAM - slower, cheap, needs constant refreshing, used for main memory.

ROM (non-volatile, firmware): PROM (programmed once) -> EPROM (erased by UV light) -> EEPROM (erased electrically; the BIOS chip is EEPROM/flash). Flash memory (pen drives, SSDs) is electrically erasable like EEPROM but block-wise.

Cache memory sits between CPU and RAM and keeps copies of frequently used data (L1 smallest/fastest, L3 largest/slowest of the three). Virtual memory uses a disk area (page file) as an overflow extension of RAM - slow but lets big programs run.

Detailed notes

The memory ladder

Computer memory is a trade-off: the faster a memory is, the smaller and costlier it is. So machines stack several kinds, from tiny-fast to huge-slow:

LevelTechnologyVolatile?Typical size
RegistersInside the CPUYesBytes
Cache (L1/L2/L3)SRAM, on/near the CPUYesKB to MB
Main memoryRAM (DRAM)YesGB
SSDFlash chipsNo100s of GB
Hard disk / tapeMagneticNoTB

Climbing up = faster, costlier, smaller. The CPU keeps its most-wanted data as high on this ladder as possible.

Volatile vs non-volatile

  • Volatile memory loses its content when power goes off: registers, cache, RAM. The Vol Vanishes rule.
  • Non-volatile keeps data without power: ROM, flash (SSD, pen drive, memory card), hard disk, DVD.

RAM — the working desk

RAM holds the programs and data currently in use; it is read and written freely but wiped at power-off. Two flavours:

TypeFull formTrait
SRAMStatic RAMFlip-flop cells, no refresh needed, fast, costly → used for cache
DRAMDynamic RAMOne transistor + capacitor per bit; the capacitor leaks, so it needs constant refreshing; cheaper, denser → used for main memory

ROM family — the printed pages

ROM (Read Only Memory) is non-volatile; ordinary programs can only read it. Its family differs only in how it can be written/erased:

TypeWrittenErased
PROMOnce, by the user/manufacturerNever
EPROMReprogrammableUltraviolet (UV) light
EEPROMReprogrammableElectrically, in circuit
FlashReprogrammable in blocksElectrically (fast) — SSDs and pen drives are flash

The PC's start-up firmware (BIOS/UEFI) lives in ROM/flash — that is why it survives every power cut.

Two bridge concepts

  • Cache — a small SRAM buffer between CPU and RAM (L1 inside the core is fastest and smallest, then L2, then L3). It keeps copies of recently used data so the CPU rarely waits for slow RAM.
  • Virtual memory — when RAM is full, the OS uses disk space as extra RAM (page file). It saves the machine from crashing but is far slower than real RAM. It is not physical memory.

Quick revision

  • Ladder (fast→slow): Registers → Cache (SRAM) → RAM (DRAM) → SSD → HDD → Tape.
  • Volatile = vanishes: registers, cache, RAM. Non-volatile: ROM, flash, disk.
  • SRAM = cache (fast, no refresh); DRAM = main RAM (cheap, needs refresh).
  • PROM once → EPROM (UV erase) → EEPROM (electrical erase) → flash (blocks).
  • Virtual memory = disk acting as RAM overflow, not real RAM.

Types of questions asked

Every way this subtopic shows up in exams — how to recognise it, the formula or logic to use, and a solved example.

Type 1: Volatile vs non-volatile identificationvery common2 practice Q
How to spot it:

'Which of these is volatile?', 'content of which memory is lost on power failure?', statement lists mixing RAM, ROM, cache, disk.

  1. Volatile = vanishes with power: registers, cache, RAM (SRAM and DRAM both).
  2. Non-volatile: ROM and its family, flash (SSD, pen drive), magnetic disk, DVD.
  3. In statement questions, test each memory against this split — ROM is never volatile.

Example: Which of the following is non-volatile?

ROM — it keeps its content without power. RAM, cache and registers are all volatile.

Type 2: Hierarchy ordering and cache positionvery common3 practice Q
How to spot it:

Arrange memories by speed or size, or identify the memory between CPU and RAM, or the levels L1/L2/L3.

  1. Speed order: Registers > Cache > RAM > SSD > HDD > Tape; size order is the exact reverse.
  2. Cache = small SRAM buffer between CPU and RAM; L1 smallest-fastest, then L2, L3.
  3. 'Smallest but fastest' always points to registers, not cache.

Example: Arrange by access speed (fastest first): RAM, Registers, Hard disk, Cache

Registers → Cache → RAM → Hard disk. Each step down trades speed for size and cheapness.

Type 3: SRAM vs DRAMcommon2 practice Q
How to spot it:

'Why does DRAM need refreshing?', 'which RAM is used in cache?', 'SRAM vs DRAM statements'.

  1. DRAM stores each bit in a capacitor that leaks charge → needs constant refreshing; cheaper, denser → main memory.
  2. SRAM uses flip-flops, no refresh, faster, costlier → cache.
  3. S = Static (stands still), D = Dynamic (must be refreshed).

Example: DRAM needs to be refreshed periodically because —

Each DRAM bit sits in a tiny capacitor that gradually loses its charge, so the cells are re-read and re-written thousands of times a second to keep the data alive.

Type 4: ROM family: PROM / EPROM / EEPROM / firmwarecommon2 practice Q
How to spot it:

'EPROM is erased by…', 'EEPROM differs from EPROM because…', 'where is the BIOS stored?', 'which ROM can be programmed only once?'

  1. Erasing ladder: PROM (never) → EPROM (UV light) → EEPROM (electrically) → flash (electrically, in blocks).
  2. BIOS/firmware lives in ROM/flash — non-volatile by definition.
  3. 'Programmed only once' = PROM; 'electrically erasable' = EEPROM.

Example: Which memory is used to store the BIOS firmware of a PC?

A ROM/flash (EEPROM-type) chip on the motherboard — the firmware must survive every power cut, so volatile RAM is impossible.

Type 5: Cache and virtual memory conceptscommon3 practice Q
How to spot it:

'Virtual memory is…', 'cache memory is placed…', 'which is faster, L1 or L3?', 'cache is made of which RAM?'.

  1. Cache = SRAM buffer between CPU and RAM; L1 (inside the core) fastest-smallest, then L2, L3.
  2. Virtual memory = disk space used as RAM overflow — big but slow, not physical RAM.
  3. Trap: 'virtual memory is part of RAM' — false; it lives on the storage disk.

Example: Virtual memory is best described as —

Disk space managed by the OS as an overflow area when RAM fills up (the page file) — it prevents crashes but works far slower than real RAM.

Shortcut tricks

⚡ Volatile = Vanishes

Volatile memories Vanish when power goes: registers, cache, RAM. Everything you keep files on (ROM, SSD, HDD, pen drive) is non-volatile.

Example: Which is volatile - ROM or DRAM?

DRAM. ROM = Read Only Memory 'Remembers' even without power.

⚡ ROM family eraser

PROM (once) -> EPROM (Erase with Photons = UV) -> EEPROM (Electrically Erasable). The more E's, the more Electrical.

Example: How is EPROM erased?

Exposure to ultraviolet light through the quartz window.

⚡ Cache position

Cache is the CPU's personal notepad between CPU and RAM: L1 inside the core (fastest), then L2, then L3 shared. Any question 'memory between CPU and main memory' = cache.

Example: Memory placed between CPU and RAM?

Cache memory (SRAM).

Where students lose marks

  • Calling ROM volatile - RAM is volatile, ROM is not.

  • Saying cache is bigger than RAM - cache is tiny but fast.

  • Believing virtual memory is physical RAM - it is disk space acting as RAM overflow.

Practice sets — 15 questions

Sets of 10, mixed across the question types above. Each answer comes with a step-by-step explanation.

Topic test · 10 questions

Suggested time 5 min · wrong answers go to your mistake notebook automatically.