The Fetch
The Fetch
carries out instructions. This cycle is fundamental to how a computer operates and is covered in Cambridge
Lower Secondary Computing (Book 8 or 9) under computer architecture and the role of the CPU.
1️⃣Fetch
The CPU retrieves (fetches) an instruction from main memory (RAM).
The instruction's location is stored in the Program Counter (PC).
The Memory Address Register (MAR) holds the address of the instruction.
The instruction is then placed into the Memory Data Register (MDR) before being transferred to the Instruction
Register (IR).
2️⃣Decode
The CPU’s Control Unit (CU) reads the instruction and determines what needs to be done.
It translates (decodes) the instruction into a format that the computer can understand.
If necessary, the CPU fetches additional data needed to execute the instruction.
3️⃣Execute
The Arithmetic Logic Unit (ALU) or Control Unit processes the decoded instruction.
The instruction is carried out, which may involve calculations, data transfer, or logic operations.
The Program Counter (PC) is updated to point to the next instruction.
Component Function
Keeps track of the next instruction's memory
Program Counter (PC)
address.
Memory Address Register
Holds the address of the instruction or data.
(MAR)
Memory Data Register
Stores data fetched from memory.
(MDR)
Instruction Register (IR) Stores the current instruction being processed.
Control Unit (CU) Decodes and directs the execution of instructions.
Arithmetic Logic Unit
Performs calculations and logical operations.
(ALU)
📌 Real-Life Example
┌───────────────────────────┐
│ FETCH │
│ 1. Program Counter (PC) │
│ → MAR │
│ 2. MAR sends address │
│ to RAM │
│ 3. Data from RAM → MDR │
│ 4. MDR → Instruction Register │
└───────────▼────────────────┘
│
▼
┌───────────────────────────┐
│ DECODE │
│ 1. Control Unit reads IR │
│ 2. Instruction analyzed │
│ 3. CU determines action │
└───────────▼────────────────┘
│
▼
┌───────────────────────────┐
│ EXECUTE │
│ 1. ALU processes data │
│ 2. Control Unit directs │
│ memory operations │
│ 3. Results stored in RAM │
│ 4. PC updates to next │
│ instruction │
└───────────────────────────┘