Registers and the FDE Cycle

1. CPU Registers

Registers are high-speed storage locations inside the CPU. They hold data that is being processed immediately.

Program Counter (PC)

Holds the address of the next instruction to be fetched.

Memory Address Register (MAR)

Holds the address of the current instruction or data being read from/written to memory.

Memory Data Register (MDR)

Holds the actual data or instruction fetched from memory (or waiting to be written).

Current Instruction Register (CIR)

Holds the instruction that is currently being decoded and executed.

Accumulator (ACC)

Holds the results of calculations performed by the ALU.

2. System Buses

Buses are the physical connections (wires) that move data between the CPU and Memory.

  • Address Bus: Carries addresses from CPU to Memory. (One-way / Simplex).
  • Data Bus: Carries actual data/instructions between CPU and Memory. (Two-way / Duplex).
  • Control Bus: Carries signals (e.g., Read/Write) from the Control Unit. (Two-way).

3. The Fetch-Decode-Execute (FDE) Cycle

This is the continuous process the CPU performs to run programs.

Step 1: Fetch
  • The PC contains the address of the next instruction.
  • This address is copied to the MAR via the Address Bus.
  • The instruction at that address is moved to the MDR via the Data Bus.
  • The PC is incremented by 1 (pointing to the next instruction).
  • The instruction is copied from the MDR to the CIR.
Step 2: Decode

The Control Unit (CU) decodes the instruction in the CIR to see what needs to be done (e.g., is it an ADD, a STORE, or a LOAD?).

Step 3: Execute

The CPU carries out the instruction. If a calculation is needed, the ALU handles it and stores the result in the Accumulator (ACC).

⚠️ Exam Warning: A common mistake is saying the "Data Bus carries addresses." Remember: Addresses go on the Address Bus; Data goes on the Data Bus. Only the Address Bus is strictly unidirectional (CPU → Memory).