Primary and Secondary Storage
Why Computers Need Storage
A computer needs somewhere to hold the programs it is running and the data those programs use. Different tasks require different types of storage — some must be fast and directly accessible by the CPU; others need to be large and permanent.
Storage is divided into two categories:
| Category | Purpose | Speed | Volatility |
|---|---|---|---|
| Primary storage | Directly accessible by the CPU; holds programs and data currently in use | Very fast | Usually volatile (lost when power off) |
| Secondary storage | Long-term storage of programs and data not currently in use | Slower | Non-volatile (persistent) |
RAM — Random Access Memory
RAM (Random Access Memory) is the main primary storage used by a running computer. It holds:
- The operating system (or the parts of it currently in use)
- Programs currently running
- Data those programs are working with
Key characteristics of RAM:
- Volatile — all contents are lost when the computer loses power
- Read/write — can be read from and written to freely
- Fast — much faster than secondary storage; the CPU can access RAM directly
- Temporary — holds whatever the computer is currently doing; cleared when the computer is switched off
ROM — Read-Only Memory
ROM (Read-Only Memory) is a small amount of primary storage whose contents are fixed at manufacture and cannot normally be changed by the user.
Key characteristics of ROM:
- Non-volatile — contents are retained when power is removed
- Read-only — cannot be written to under normal circumstances
- Contains the boot program — when a computer is switched on, the CPU executes code stored in ROM to start the boot process (loading the OS from secondary storage into RAM)
The difference between RAM and ROM in one sentence: RAM is fast, temporary working memory that is lost when power is removed; ROM is permanent, fixed memory that holds the startup program and retains its contents without power.
Cache (Primary Storage)
Cache is a small amount of extremely fast memory located on or close to the CPU chip. It acts as a buffer between the CPU and the slower RAM — holding copies of frequently accessed instructions and data so the CPU does not need to wait for RAM.
- Faster than RAM, but smaller and more expensive per byte
- Contents are volatile (lost when power off)
- Managed automatically by the CPU
Worth saving these ideas?
Turn what you've read into instant revision cards. Free to get started.
Virtual Memory
When RAM is full, the computer cannot load any more data for running programs. Virtual memory solves this by using part of secondary storage (usually the hard drive or SSD) as an extension of RAM.
How virtual memory works:
- RAM becomes full — all space is occupied by running programs
- The OS identifies parts of RAM that have not been used recently
- Those sections are swapped out — temporarily copied from RAM to a reserved area of secondary storage (the "page file" or "swap space")
- The freed RAM space is given to the program that needs it
- If the swapped-out data is needed again, it is swapped back from secondary storage into RAM
Consequence: When the OS must frequently swap data between RAM and secondary storage, performance drops noticeably — the computer becomes slow. This is called thrashing. Adding more RAM eliminates the need for virtual memory and solves the problem.
(Extra context — "paging" and "segmentation" are specific memory management techniques; not required by OCR J277 1.2.1.)
Secondary Storage — Types and Characteristics
Secondary storage holds data permanently — programs installed on a computer, saved files, the operating system itself. It does not lose its contents when power is removed.
OCR J277 requires knowledge of three types:
Magnetic storage
Uses magnetised regions on a spinning disc or tape to store bits.
Examples: Hard Disk Drives (HDDs), magnetic tape
Characteristics:
- Large capacity at low cost per GB
- Moving parts (spinning platters, read/write head) make it susceptible to damage from drops/vibration
- Relatively slow compared to solid state
- Good durability over time if not physically damaged
Optical storage
Uses a laser to read/write data as pits and lands on a reflective disc surface.
Examples: CDs, DVDs, Blu-ray discs
Characteristics:
- Portable and cheap per unit
- Lower capacity than magnetic/solid state
- Slow read speeds
- Prone to scratching; susceptible to environmental damage
- Good for distribution of fixed content (software, films, music)
Solid state storage
Uses flash memory (electrical charges in transistors) to store bits. No moving parts.
Examples: SSDs (Solid State Drives), USB flash drives, SD cards
Characteristics:
- Fast read/write speeds (fastest secondary storage type)
- No moving parts — highly durable, resistant to shock
- Silent, low power consumption
- More expensive per GB than magnetic
- Limited write cycles (though this rarely causes issues in practice)
Comparing Storage Devices
| Characteristic | Magnetic (HDD) | Optical (DVD) | Solid State (SSD) |
|---|---|---|---|
| Capacity | Very large (TBs) | Low (4.7 GB–50 GB) | Large (GBs–TBs) |
| Speed | Medium | Slow | Fast |
| Portability | Bulky | Very portable | Very portable |
| Durability | Low (moving parts) | Low (scratches) | High (no moving parts) |
| Reliability | Medium | Medium | High |
| Cost | Low per GB | Very low per disc | Higher per GB |
Choosing the right storage for a scenario — exam questions may describe a situation and ask which type is most suitable. Consider the scenario's priorities:
- Cloud backup server storing huge volumes of data → magnetic (cost at scale)
- Laptop user needing fast boot times → solid state (speed + portability)
- Distributing software to retail stores → optical (cheap per unit, read-only distribution)
- Camera memory card → solid state (small, no moving parts, shock resistant)
Common Exam Mistakes
1. Saying ROM is RAM that is "read-only"
ROM and RAM are different components serving different roles. ROM holds the boot program permanently; RAM holds the current working data and programs. RAM can be read and written to freely while the computer runs; ROM cannot be rewritten under normal circumstances.
2. Saying virtual memory is "extra RAM"
Virtual memory is secondary storage used temporarily as an overflow when RAM is full. It is much slower than RAM and its use causes performance problems (thrashing). It is not the same as having more RAM.
3. Confusing volatile and non-volatile
Volatile = lost when power removed (RAM, cache). Non-volatile = retained without power (ROM, secondary storage).
4. Saying optical storage is always best for portability
Optical discs are physically portable but have very low capacity and slow speeds. For portability with high capacity, solid state (USB drive, SSD) is more appropriate.
| Mistake | Correction |
|---|---|
| "ROM stores the programs I'm currently running" | RAM stores currently running programs; ROM stores the fixed boot program |
| "Virtual memory is as fast as RAM" | Virtual memory uses secondary storage which is much slower; heavy use causes thrashing |
| "HDDs are better than SSDs because they're cheaper" | HDDs are cheaper per GB but slower and less durable; choice depends on the application |
Generate revision on any topic you study
Type any topic you're studying and Aicademy generates a complete lesson, quiz, and flashcard set — personalised to your level.
Lessons on anything
Structured, level-matched lessons on any topic you study
Practice quizzes
Find out what you actually know before the exam does
Flashcard sets
Lock in key concepts with instant revision cards
Ask Aica
Stuck on something? Get a clear explanation, any time
CPU Performance and Embedded Systems
Number Systems and Data Units
Related lessons
6 Slides
7 Slides