Primary Memory
Primary memory refers to the components that the CPU can access directly and quickly. It is essential for the immediate execution of instructions and the functioning of the OS.
RAM (Random Access Memory)
Temporary workspace for the computer. It stores the data and programs currently in use by the CPU.
- Function: Holds the OS, open applications, and GUI.
- Nature: Contents are lost when power is turned off.
- Speed: Extremely fast compared to secondary storage.
ROM (Read Only Memory)
Non-volatile memory holding the instructions the computer needs before any software has loaded. Some types are permanent; others can be reprogrammed, as the next section explains.
- Function: Stores the BIOS (Basic Input/Output System) or Bootstrap Loader.
- Nature: Retains data even without power.
- Access: Not written to during normal running — unlike RAM, which is written to constantly.
Types of RAM: SRAM and DRAM
RAM comes in two forms, and the difference between them is what each one is physically made of — which then explains every other difference.
| Feature | DRAM (Dynamic RAM) | SRAM (Static RAM) |
|---|---|---|
| Built from | A capacitor and a transistor per bit | Several transistors per bit (a flip-flop) |
| Refreshing | Must be constantly refreshed — the capacitor's charge leaks away | Never needs refreshing — holds its value while powered |
| Speed | Slower | Faster |
| Cost | Cheaper per bit | More expensive per bit |
| Density | Higher — more bits fit in the same space | Lower — each bit takes more room |
| Power use | Higher, because of the constant refreshing | Lower |
| Used for | Main memory (the RAM sticks in a computer) | Cache memory inside the CPU |
Types of ROM: PROM, EPROM and EEPROM
ROM also comes in several forms, and they form a ladder: each step up can be rewritten more easily than the one before.
| Type | Can it be written? | How |
|---|---|---|
| ROM | Never | Contents are fixed when the chip is manufactured. |
| PROM Programmable | Once only | Written once by the purchaser using a special device. After that it is permanent. |
| EPROM Erasable Programmable | Many times | Erased by exposing the chip to ultraviolet light through a window in its case, then rewritten. The whole chip is erased at once, and it must be removed from the circuit to do it. |
| EEPROM Electrically Erasable Programmable | Many times | Erased and rewritten electrically, in place, without removing the chip — and selected bytes can be changed rather than the whole chip. |
Memory vs. Storage: The Key Differences
In IGCSE Computer Science, it is crucial not to use the terms "memory" and "storage" interchangeably. They serve two distinct roles in the Von Neumann architecture.
| Feature | Primary Memory (RAM) | Secondary Storage (HDD/SSD) |
|---|---|---|
| Direct CPU Access | Yes. The CPU fetches instructions directly from here. | No. Data must be moved to RAM before the CPU can use it. |
| Volatility | Volatile (Temporary). | Non-volatile (Permanent). |
| Capacity | Lower (typically 8GB - 32GB). | Much higher (typically 256GB - 4TB+). |
| Relative Speed | Very High speed. | Relatively Slow speed. |
The Need for Each
Why we need Primary Memory (RAM):
The CPU is incredibly fast. If it had to wait for a mechanical Hard Drive or even a Solid State Drive to fetch every bit of data, the computer would crawl to a halt. RAM acts as a high-speed buffer that keeps the CPU supplied with data at the speeds it requires.
Why we need Secondary Storage:
Because RAM is volatile, we need a way to keep our files (documents, photos, games) when the computer is switched off. Secondary storage provides permanence and high-capacity space for data that isn't currently being processed.