Course contentsShow
← Computer Science
Lesson 1087 of 2,87225. Computer Architecture FoundationsFree lesson

Memory Access Stage

Reading from or writing to memory when instructions involve load/store operations.

Memory Access Stage

What you'll learn: How the CPU reads from or writes to memory during instructions that need to access stored data.

What Happens During Memory Access?

Not every instruction needs to touch memory, but many do. When an instruction requires reading data from RAM (like loading a value into a register) or writing data to RAM (like storing a register's value), the Memory Access stage is where that happens.

Think of this stage as the CPU's "warehouse trip." The CPU has been working with its fast, local registers, but sometimes it needs to fetch something from the much larger (but slower) main memory warehouse, or store something there for safekeeping.

When Memory Access Occurs

This stage activates for:

  • Load instructions: Copying data from a memory address into a register
  • Store instructions: Copying data from a register to a memory address

For instructions that don't involve memory (like adding two register values), this stage simply passes through without doing anything—the CPU moves on to the next stage.

The Process

During this stage:

  1. The Memory Address Register (MAR) holds the target address calculated in the Execute stage
  2. For loads, the CPU reads from that memory location and places the data in the Memory Data Register (MDR)
  3. For stores, the CPU writes the data from the MDR to the memory location
  4. The memory system returns the data (for loads) or confirms the write (for stores)

This is often the slowest part of the instruction cycle because accessing RAM takes much longer than register operations.

Key Takeaway: The Memory Access stage handles all reading from and writing to main memory for load and store instructions, acting as the bridge between the CPU's fast registers and slower RAM.