3.3 Data storage

Show All Section Notes

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.

Volatile

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.
Non-Volatile

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.

FeatureDRAM (Dynamic RAM)SRAM (Static RAM)
Built fromA capacitor and a transistor per bitSeveral transistors per bit (a flip-flop)
RefreshingMust be constantly refreshed — the capacitor's charge leaks awayNever needs refreshing — holds its value while powered
SpeedSlowerFaster
CostCheaper per bitMore expensive per bit
DensityHigher — more bits fit in the same spaceLower — each bit takes more room
Power useHigher, because of the constant refreshingLower
Used forMain memory (the RAM sticks in a computer)Cache memory inside the CPU
Why each is used where it is. Main memory needs to be large and affordable, so DRAM's low cost and high density win even though it is slower. Cache needs to be as fast as possible and is only a few megabytes, so SRAM's speed is worth its cost and size. Both are volatile — the difference is refreshing, not permanence.

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.

TypeCan it be written?How
ROMNeverContents are fixed when the chip is manufactured.
PROM
Programmable
Once onlyWritten once by the purchaser using a special device. After that it is permanent.
EPROM
Erasable Programmable
Many timesErased 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 timesErased and rewritten electrically, in place, without removing the chip — and selected bytes can be changed rather than the whole chip.
The distinction examiners test is between EPROM and EEPROM, because the names are nearly identical. The extra E is electrically. EPROM needs ultraviolet light and the chip has to come out of the machine; EEPROM is rewritten by electrical signals with the chip still in place. That is why EEPROM is what modern computers use for the BIOS — it is what makes a firmware update possible without opening the case.

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.

Exam Tip: If you are asked why a computer needs both, remember: RAM provides speed and direct access, while Storage provides non-volatile capacity.