CIE AS & A Level Computer Science, section 3.1 (Computers and their components)
RAM and ROM
| RAM (Random Access Memory) | ROM (Read Only Memory) | |
|---|---|---|
| Contents | programs and data currently in use | permanent instructions such as the start-up program (BIOS/bootstrap) |
| Volatile? | volatile (loses data when power is off) | non-volatile |
| Read and write | both | read only (normally) |
| Size | larger | smaller |
SRAM and DRAM
Static RAM (SRAM) uses circuits called flip-flops to hold each bit.
- Faster, needs no refreshing, but more expensive and uses more space per bit.
- Used for cache memory in the processor.
Dynamic RAM (DRAM) stores each bit as a charge in a capacitor, which leaks away.
- Must be refreshed thousands of times per second, so it is slower, but cheaper and holds more per chip.
- Used for main memory (the RAM in a computer).
| SRAM | DRAM | |
|---|---|---|
| Speed | faster | slower |
| Refreshed | no | yes |
| Cost | higher | lower |
| Use | cache | main memory |
Types of ROM
- PROM (Programmable ROM): can be programmed once after manufacture.
- EPROM (Erasable PROM): can be erased with ultraviolet light and reprogrammed.
- EEPROM (Electrically Erasable PROM): can be erased and rewritten electrically, without removing it. Used for BIOS settings and flash storage.
Choosing the memory
A device needing fast access for a small amount of data (cache) uses SRAM. A computer needing lots of main memory cheaply uses DRAM. A microwave oven stores its fixed program in ROM.
Common mistake: saying DRAM is faster than SRAM, or that ROM is "read only so can never change". EEPROM can be rewritten electrically. Also, volatile is about losing data when power is off: RAM is volatile and ROM is not.
Exam tip: when comparing memory types, give speed, cost and use for each. For RAM and ROM, always mention volatile versus non-volatile.
Check yourself
Why is DRAM used for main memory rather than SRAM?
DRAM is cheaper and holds more data per chip, even though it is slower and must be refreshed.
What does volatile mean?
The memory loses its contents when the power is switched off.
What is the difference between PROM and EPROM?
PROM can be programmed only once, while EPROM can be erased (with ultraviolet light) and reprogrammed.