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

Write-Back Stage

Storing the result of an instruction back into a register or memory location.

Write-Back Stage

You'll learn: How the CPU stores the final result of an instruction into its destination register or memory location.

What Is the Write-Back Stage?

The write-back stage is the final step of the instruction cycle where the CPU takes the result produced during the execute or memory access stages and stores it in its proper destination—typically a register in the register file, or sometimes a memory location.

Think of it like completing a calculation on paper: you've done the math (execute), maybe looked up a value in a table (memory access), and now you need to write your answer in the designated spot so you can use it later.

How Write-Back Works

After the CPU has:

  • Fetched an instruction (Fetch Stage)
  • Decoded what operation to perform (Decode Stage)
  • Executed the operation in the ALU (Execute Stage)
  • Accessed memory if needed (Memory Access Stage)

...it must now finalize the instruction by storing the result. For example:

  • An ADD instruction might write the sum back to a general-purpose register
  • A LOAD instruction writes data retrieved from memory into a destination register
  • A SUBTRACT might update both the result register and status flags

The write-back stage updates the register file or memory, making the result available for future instructions. This is where the program counter also gets ready to move forward, since the current instruction is now complete.

Why Write-Back Matters

Without write-back, instructions would compute results but never save them—making all that work useless! It's the stage that ensures instruction results persist and become inputs for subsequent operations.

Key Takeaway: The write-back stage completes the instruction cycle by storing computed results into their destination registers or memory, making them available for future instructions.