Hardware, Memory & Number Systems
🔒 Log in to trackMemory hierarchy, RAM/ROM and cache
🔒 Log in to trackA computer keeps data in several kinds of memory. The faster a memory is, the smaller and costlier it is. So the machine stacks them like a ladder: tiny and fast at the top, huge and slow at the bottom. Some memory forgets everything at power-off (volatile). The rest keeps its data.
The memory ladder
Fast memory costs more, so a computer has only a little of it. It stacks the types from fast and small to slow and large.
| Level | Technology | Volatile? | Typical size |
|---|---|---|---|
| Registers | Inside the CPU | Yes | Bytes |
| Cache (L1, L2, L3) | SRAM, on or near the CPU | Yes | KB to MB |
| Main memory | RAM (DRAM) | Yes | GB |
| SSD | Flash chips | No | 100s of GB |
| Hard disk, tape | Magnetic | No | TB |
Going up the ladder means faster, costlier and smaller.
Tip: Speed order is Registers, Cache, RAM, SSD, HDD, Tape. Size order is the exact reverse.
Volatile and non-volatile
Volatile memory loses its data when the power goes off. Registers, cache and RAM are volatile.
Non-volatile memory keeps data without power. ROM, flash (SSD, pen drive, memory card), hard disk and DVD are non-volatile.
Rule: ROM is never volatile. Both SRAM and DRAM are volatile.
RAM, the working desk
RAM holds the programs and data in use right now. You can read and write it freely. Power-off wipes it.
| Type | Full form | Main facts |
|---|---|---|
| SRAM | Static RAM | Flip-flop cells. No refresh needed. Fast and costly. Used for cache. |
| DRAM | Dynamic RAM | One transistor and one capacitor per bit. Cheaper and denser. Used for main memory. |
A DRAM capacitor leaks its charge. So DRAM needs constant refreshing. SRAM does not.
The ROM family
ROM means Read Only Memory. It is non-volatile, and ordinary programs can only read it. The family differs in how each chip is written and erased.
| Type | Written | Erased |
|---|---|---|
| PROM | Once | Never |
| EPROM | Reprogrammable | Ultraviolet (UV) light |
| EEPROM | Reprogrammable | Electrically, in the circuit |
| Flash | Reprogrammable in blocks | Electrically (fast) |
SSDs and pen drives are flash. The start-up firmware of a PC (BIOS or UEFI) sits in ROM or flash. That is why it survives every power cut.
Tip: More E's mean more electricity. EPROM is erased by UV light. EEPROM is erased electrically.
Cache and virtual memory
Cache is a small SRAM buffer between the CPU and RAM. It keeps copies of recently used data. So the CPU rarely waits for slow RAM. L1 is smallest and fastest. Then comes L2, then L3.
Virtual memory uses disk space as extra RAM when RAM is full. It is called the page file. It stops the machine from crashing. But it is far slower than real RAM.
Watch: Virtual memory is not physical memory. It lives on the storage disk, not inside RAM.
Question types you will see
Each type: how to recognise it, the method step by step, and one question to try.
Volatile vs non-volatile identification
The words 'volatile', 'non-volatile', 'loses data when power is off' or 'permanent'.
Sort each option into volatile or non-volatile.
Volatile: registers, cache, RAM (SRAM and DRAM).
Non-volatile: ROM family, flash, magnetic disk, DVD.
In statement questions, test each memory against this split.
Only memory that needs power to hold its data is volatile.
Which of the following is non-volatile?
Show solutionHide solution
RAM, cache and registers all lose data at power-off.
ROM keeps its content without power.
ROM
Hierarchy ordering and cache position
'Arrange in order of speed', 'fastest', 'smallest' or 'between CPU and RAM'.
Write the order: Registers, Cache, RAM, SSD, HDD, Tape.
Speed falls as you move right. Size grows.
Cache is the SRAM buffer between CPU and RAM.
'Smallest but fastest' means registers, not cache.
Cost limits how much fast memory a machine can have.
Arrange by access speed, fastest first: RAM, Registers, Hard disk, Cache.
Show solutionHide solution
Registers are inside the CPU, so they are fastest.
Cache comes next, then RAM, then the hard disk.
Registers, Cache, RAM, Hard disk
SRAM vs DRAM
'Refresh', 'flip-flop', 'capacitor', 'static', 'dynamic' or 'used for cache'.
DRAM stores each bit in a capacitor that leaks, so it needs refreshing.
DRAM is cheaper and denser. It is main memory.
SRAM uses flip-flops. It is faster and costlier. It is cache.
S is Static (stands still). D is Dynamic (must be refreshed).
The leaking capacitor is the reason DRAM needs refresh.
DRAM needs to be refreshed periodically because...
Show solutionHide solution
Each DRAM bit sits in a tiny capacitor.
The capacitor slowly loses its charge.
So the cells are re-read and re-written again and again.
Its capacitors leak charge
ROM family: PROM, EPROM, EEPROM, firmware
'Programmed only once', 'ultraviolet', 'electrically erasable', 'BIOS' or 'firmware'.
Match the erase method: PROM never, EPROM UV light, EEPROM electrically.
Flash is electrically erased, in blocks.
'Programmed only once' means PROM.
BIOS or firmware lives in ROM or flash, because it must survive power cuts.
Each ROM type is defined by how it is erased.
Which memory holds the BIOS firmware of a PC?
Show solutionHide solution
Firmware must survive every power cut.
So it cannot sit in volatile RAM.
A ROM or flash (EEPROM-type) chip
Cache and virtual memory concepts
'Page file', 'overflow of RAM', 'L1, L2, L3' or 'copies of frequently used data'.
Cache is a small SRAM buffer between CPU and RAM.
L1 is inside the core: fastest and smallest.
Virtual memory is disk space used as RAM overflow.
It is big but slow. It is not physical RAM.
Cache saves the CPU from waiting. Virtual memory saves the system from running out of RAM.
Virtual memory is best described as...
Show solutionHide solution
When RAM fills up, the OS uses disk space as an overflow area.
That area is the page file.
Disk space used as an extension of RAM
Fastest, costliest or largest memory
'Fastest memory', 'most expensive per byte' or 'largest capacity'.
Put the memories in ladder order.
Fastest and costliest per byte is at the top: registers.
Largest and cheapest per byte is at the bottom: tape and hard disk.
Read the stem's word: fastest, smallest or largest.
Speed and cost rise together. Size falls.
Which memory in a computer is the fastest?
Show solutionHide solution
Registers are inside the CPU.
They are the top rung of the ladder.
Registers
Shortcuts that save time
Volatile memories vanish when power goes: registers, cache, RAM. Everything you keep files on (ROM, SSD, HDD, pen drive) is non-volatile.
Which is volatile, ROM or DRAM?
Show solutionHide solution
ROM keeps data without power.
DRAM loses data at power-off.
DRAM
PROM is written once. EPROM is erased by UV light. EEPROM is erased electrically. More E's, more electricity.
How is EPROM erased?
Show solutionHide solution
EPROM is the UV member of the family.
By ultraviolet light
Any question that says 'memory between the CPU and main memory' points to cache. L1 is inside the core and fastest.
Which memory sits between the CPU and RAM?
Show solutionHide solution
It holds copies of frequently used data.
It is built from SRAM.
Cache memory
Mistakes to avoid
Where most students lose marks on this subtopic.
Calling ROM volatile.
ROM keeps its data without power. It is non-volatile.
Saying SRAM needs refreshing.
DRAM needs refreshing because its capacitors leak. SRAM does not.
Using SRAM for main memory and DRAM for cache.
Cache uses fast, costly SRAM. Main memory uses cheaper DRAM.
Treating virtual memory as part of RAM.
Virtual memory is disk space used as overflow. It is slower than RAM.
Picking cache for 'smallest and fastest'.
Registers are smaller and faster than cache.
Quick revision
Read this the night before the exam.
Speed order: Registers, Cache (SRAM), RAM (DRAM), SSD, HDD, Tape.
Volatile: registers, cache, RAM. Non-volatile: ROM, flash, disk.
SRAM is for cache (fast, no refresh). DRAM is for main memory (cheap, needs refresh).
PROM once, EPROM UV erase, EEPROM electrical erase, flash in blocks.
BIOS or UEFI firmware sits in ROM or flash.
Virtual memory is disk acting as RAM overflow, not real RAM.
Practice: 15 questions
Sets of 10, mixed across the question types above. Every answer has a step-by-step explanation.
Topic test · 10 questions
Suggested time 5 min · wrong answers go to your mistake notebook automatically.