Lesson 8 45 min

Memory: RAM, ROM and Cache

AI Explain — Ask anything
AI Illustrate — Make it visual

Why This Matters

This lesson explores the fundamental types of memory within a computer system: RAM, ROM, and Cache. We will differentiate their characteristics, functions, and roles in enabling efficient data processing and program execution. Understanding these memory types is crucial for comprehending how a computer stores and accesses information.

Key Words to Know

01
RAM (Random Access Memory) — Volatile memory used for temporary storage of data and program instructions currently being used by the CPU.
02
ROM (Read Only Memory) — Non-volatile memory containing essential boot-up instructions and firmware that cannot be easily altered.
03
Cache Memory — Small, very fast memory located close to the CPU, used to store frequently accessed data and instructions for quicker retrieval.
04
Volatile Memory — Memory that loses its contents when power is removed.
05
Non-Volatile Memory — Memory that retains its contents even when power is removed.
06
Memory Hierarchy — The arrangement of different types of memory in a computer system based on speed, cost, and capacity, from fastest/smallest to slowest/largest.
07
Latency — The time delay between the initiation of a request and the beginning of the data transfer.

Random Access Memory (RAM)

RAM is the primary working memory of a computer system. It is a volatile memory, meaning its contents are lost when the power is turned off. RAM is used to temporarily store data and program instructions that the Central Processing Unit (CPU) is actively using or is likely to use soon. When you open an application or a file, it is loaded from secondary storage (like an SSD or HDD) into RAM so the CPU can access it quickly.

There are two main types of RAM:

  • SRAM (Static RAM): Faster and more expensive, often used for cache memory due to its speed. It holds data as long as power is supplied without needing to be refreshed.
  • DRAM (Dynamic RAM): Slower and cheaper, used for main system memory. It needs to be constantly refreshed (recharged) to maintain the data, which is why it's called 'dynamic'. Most modern computers use Synchronous DRAM (SDRAM) or its derivatives like DDR (Double Data Rate) SDRAM.

The amount of RAM directly impacts a computer's multitasking capabilities and performance with demanding applications. More RAM allows more programs and data to be held in memory simultaneously, reducing the need to access slower secondary storage.

Read Only Memory (ROM)

ROM is a non-volatile memory, meaning its contents are retained even when the power is switched off. As its name suggests, data stored in ROM is typically 'read-only' and cannot be easily modified or overwritten. Its primary purpose is to store essential system instructions that are required for the computer to start up, known as firmware.

Key functions of ROM include:

  • BIOS (Basic Input/Output System) / UEFI (Unified Extensible Firmware Interface): These programs are stored in ROM and are the first to run when a computer is powered on. They perform a Power-On Self-Test (POST) to check hardware components, initialize the system, and then load the operating system from secondary storage into RAM.
  • Firmware for embedded systems: ROM is also used in various embedded systems (e.g., washing machines, smart TVs) to store their operating instructions.

While traditionally 'read-only', modern ROM variations like EEPROM (Electrically Erasable Programmable Read-Only Memory) and Flash Memory allow for electrical erasure and reprogramming, albeit much slower than RAM. This allows for firmware updates, but the core characteristic of non-volatility remains.

Cache Memory

Cache memory is a small, extremely fast type of volatile memory that acts as a buffer between the CPU and main RAM. Its purpose is to reduce the average time to access data from main memory. The CPU often requests the same data or instructions repeatedly. Instead of fetching them from slower RAM every time, the cache stores copies of frequently used data, allowing the CPU to retrieve them much faster.

Cache memory is typically organised in multiple levels:

  • L1 Cache: The smallest and fastest cache, built directly into the CPU chip. It's often split into instruction cache and data cache.
  • L2 Cache: Larger and slightly slower than L1, but still much faster than RAM. It can be on the CPU chip or a separate chip with a high-speed bus to the CPU.
  • L3 Cache: The largest and slowest of the cache levels, often shared among multiple CPU cores. It acts as a common pool for L1 and L2 caches.

When the CPU needs data, it first checks L1 cache, then L2, then L3. If the data is found (a 'cache hit'), it's retrieved quickly. If not (a 'cache miss'), the CPU has to access the slower main RAM, and a copy of the data is then placed into the cache for future use.

Memory Hierarchy and Performance

Computer systems employ a memory hierarchy to balance speed, cost, and capacity. This hierarchy arranges memory type...

This section is locked

1 more section locked

Upgrade to Starter to unlock all study notes, audio listening, and more.

Exam Tips

  • 1.Clearly differentiate between **volatile** and **non-volatile** memory, providing examples for each (RAM is volatile, ROM is non-volatile).
  • 2.Explain the **purpose and function** of each memory type (RAM for active data, ROM for boot-up, Cache for speed optimisation).
  • 3.Be able to describe the **memory hierarchy** and explain *why* it is implemented (balancing speed, cost, capacity, and exploiting locality of reference).
  • 4.When asked about cache, mention its **levels (L1, L2, L3)** and how they contribute to performance by reducing access time to main memory.
  • 5.Understand the role of **BIOS/UEFI** and how ROM is essential for the computer's initial startup process.
👋 Ask Aria anything!