AS Level · Topic 3.1
A-Level Computer Science 9618 / Topic 3 / AS

Memory that forgets, memory that stays.

Primary memory comes in two families. RAM is fast, volatile working memory, built either from capacitors that must be refreshed or from flip-flops that need no refresh. ROM keeps its contents without power, and the three programmable types differ in whether, and how, they can be erased.

The key idea

RAM (random access memory) is volatile, can be read and written, and holds the operating system, programs and data currently in use. ROM (read only memory) is non-volatile and holds data that must survive power-off, such as the bootstrap program and firmware. DRAM stores each bit as charge on a capacitor, which leaks, so it must be refreshed constantly; it is cheaper and denser, so it is used for main memory. SRAM stores each bit in a flip-flop, needs no refresh and has a faster access time, so it is used for cache. PROM is programmed once; EPROM is erased with ultraviolet light; EEPROM is erased electrically without removing it from the circuit.

DRAM leaks, so every cell is refreshed; SRAM holds its bit full limit refreshrefreshrefreshrefresh SRAM (flip-flop) DRAM capacitor charge time → PROMEPROMEEPROM programmed once:fuses are blown erased by UV light,chip removed erased electrically,left in the circuit
Fig. 1: a DRAM cell's charge leaks away and is topped up by a refresh before it falls below the limit; the three programmable ROMs differ in how they are erased
Section 01

RAM against ROM.

Both are primary memory: the CPU can address them directly. The differences are about volatility, whether the contents can be changed, and what each is used for.

RAMROM
VolatilityVolatile: contents lost when the power is offNon-volatile: contents kept without power
AccessRead and writeRead only in normal use
Typical contentsParts of the operating system, programs running now and the data they useBootstrap (start-up) program, BIOS/firmware, fixed data for an embedded device
Size in a PCLarge (many GiB)Small
Your turn
A washing machine has a microprocessor with both RAM and ROM. State what each is used for.
Examiner trap

"Random access" does not mean the data is random. It means any location can be accessed directly, in the same time, without reading through the others.

Section 02

Static RAM and dynamic RAM.

Both types of RAM are volatile. They differ in how a single bit is held, and that one difference explains their speed, cost, density and use.

DRAM (dynamic)SRAM (static)
How a bit is storedAs charge on a capacitor, with one transistor per cellIn a flip-flop made of several transistors (often six) per cell
RefreshingThe charge leaks, so every cell must be refreshed many times a secondNo refresh needed while the power is on
Access timeSlowerFaster
Cost and densityCheaper per bit; more bits per chip (higher capacity)More expensive per bit; fewer bits per chip
PowerUses power for the constant refreshingUses less power, as there is no refresh
Typical useMain memory in PCs, laptops, phones and games consoles, where large capacity at low cost mattersCache memory in the CPU, where speed matters more than size; small fast memory in some embedded devices and routers
Worked example Choosing the right RAM
Explain why a processor's cache is made from SRAM but the computer's 16 GiB main memory is made from DRAM.
  1. Cache must keep up with the processor, so the deciding factor is access time: SRAM is faster and needs no refresh cycles.
  2. Cache is small, so the high cost per bit of SRAM is affordable.
  3. Main memory needs a large capacity at a sensible price: DRAM is cheaper per bit and fits more bits on each chip.
Answer: SRAM for speed where little is needed; DRAM for capacity at low cost
Examiner trap

Both SRAM and DRAM are volatile. "Static" means no refresh is needed while powered, not that data is kept when the power is off.

Stage 1 · Learn

Check what the sim just showed you

Four quick checks. Each correct answer earns XP and records this skill on your profile.

Quick check+10 XP

Why must DRAM be refreshed?

Quick check+10 XP

Which type of memory is normally used for a CPU's cache?

Quick check+10 XP

Which statement about RAM and ROM is correct?

Quick check+10 XP

How is an EPROM erased?

Section 03

PROM, EPROM and EEPROM.

Plain ROM has its contents fixed when the chip is manufactured. The programmable types let the contents be written after manufacture, and the last two let them be erased and written again.

TypeHow it is programmed and erasedTypical use
PROM (programmable ROM)Supplied blank and written once with a special PROM writer, which blows fuses in the chip. It can never be erased or rewritten.Firmware in a finished product that will never need changing, made in quantities too small for a custom ROM
EPROM (erasable PROM)Erased by shining ultraviolet light through a quartz window, which wipes the whole chip; the chip has to be removed from the device. It can then be reprogrammed.Developing and testing firmware, where the program is changed several times
EEPROM (electrically erasable PROM)Erased and rewritten electrically while still in the circuit, so the chip does not need to be removed; individual bytes can be changed. Flash memory is a type of EEPROM that is erased in blocks.BIOS/firmware that can be updated by the user, and settings that must be saved when a device is switched off
Your turn
A router's manufacturer wants customers to be able to download and install firmware updates. Which type of ROM should hold the firmware? Give a reason.
Examiner trap

EPROM and EEPROM are both reprogrammable. The mark is for how they are erased: UV light, whole chip, removed against electrically, in place, byte by byte.

Stage 2 · Exam

Exam-style questions

Unlocks once the four checks above are done. Worth more XP, written to AS Paper 1 and Paper 2 standard.

Finish the four checks above to unlock the exam questions
Exam style+20 XP

Which is a reason for using DRAM rather than SRAM for main memory?

Exam style+20 XP

Which describes an SRAM memory cell?

Exam style+20 XP

Which feature belongs to EEPROM but not to EPROM?

Exam style+20 XP

A small batch of a device needs firmware that will never change after it is written. Which type of memory is most suitable?

Skill unlocked

RAM and ROM, mastered.

This skill is now recorded on your profile. Keep the chain going.

-Rank -Level -Score -Topics
Go deeper · practice
Six original Cambridge-style questions
RAM against ROM, static against dynamic RAM, and the three programmable ROMs.