The Fetch-Execute cycle and the role of registers within it — AQA A-Level Computer Science
The Fetch-Execute (F-E) cycle is the fundamental operational process through which a central processing unit retrieves, decodes, and carries out program instructions stored in main memory. Dedicated internal registers—including the Program Counter, MAR, MDR, CIR, and Accumulator—coordinate with system buses to control the sequential flow of data and instructions at hardware level.
The Fetch-Execute cycle and the role of registers within it explained
The Fetch-Execute cycle is the repeating process by which a processor runs a machine code program.
Read the full explanation
It has three named stages: fetch, decode and execute. During fetch, the address held in the program counter (PC) is copied to the memory address register (MAR), the instruction at that address is read from memory into the memory data register (MDR), and the PC is incremented so it points to the next instruction. During decode, the control unit works out what the instruction means, identifying the operation and any operands. During execute, the arithmetic logic unit (ALU) or another part of the processor carries out the operation, which may involve reading or writing data in registers or memory, and the cycle then starts again with the next fetch. Because the PC is updated automatically, instructions run in sequence unless a jump or branch changes its value.
Your focus
- Explain how the Fetch-Execute cycle is used to execute machine code programs including the stages in the cycle (fetch, decode, execute) and
Which command word is this?
Provide a detailed, sequential account of the process without needing to justify why; order and correct technical terminology (e.g., register names and buses) are essential.
The Fetch-Execute cycle and the role of registers within it exam tips
Topic Overview
The Fetch-Execute cycle is the heartbeat of the Von Neumann architecture, detailing the step-by-step mechanism by which the CPU continuously retrieves, interprets, and acts upon machine-code instructions. Understanding this cycle exposes how abstract software commands translate into precise, physical data movements across micro-architectural components.
Central to this process is a set of special-purpose high-speed storage locations known as registers, which coordinate with the control unit, arithmetic logic unit, and system buses. Mastering this topic provides the conceptual bedrock for computer systems in A-Level Computer Science, directly underpinning processor performance, assembly language, and interrupt handling.
Key Concepts
- →Program Counter (PC): Holds the memory address of the next instruction to be fetched and executed, incrementing after each fetch unless altered by a branch instruction.
- →Memory Address Register (MAR) & Memory Data Register (MDR): The MAR holds any memory address currently being read from or written to via the address bus, while the MDR temporarily buffers the actual data or instruction transferred via the data bus.
- →Current Instruction Register (CIR): Holds the instruction currently being decoded into opcode (what operation to perform) and operand (the data or address to perform it on).
- →Accumulator (ACC) & ALU: The Accumulator stores temporary intermediate arithmetic and logic results generated by the Arithmetic Logic Unit (ALU) during execution.
- →Interrupt Handling: At the end of every F-E cycle, the CPU checks for interrupt signals; if present, the current register state is pushed onto a stack and an Interrupt Service Routine (ISR) is initiated.
Marking Points
- Describes fetch as copying the address from the program counter into the memory address register and reading the instruction into the memory data register
- States that the program counter is incremented during fetch so it points to the next instruction
- Explains that decode identifies the operation and operands held in the instruction
- Explains that execute carries out the operation, often using the ALU, and may read or write registers or memory
- Shows that the cycle repeats for each instruction in the machine code program
Examiner Tips
- 💡For each stage, name the register or unit involved and state what moves or changes in it
- 💡Use the register names MAR, MDR, PC and the ALU accurately rather than general terms
- 💡Remember that the cycle repeats continuously for each instruction, not just once per program
- 💡Write your cycle descriptions using formal register transfer notation (e.g., MAR <- [PC]) alongside prose to prevent ambiguity and guarantee technical marks.
- 💡Explicitly mention system buses (address bus, data bus, control bus) when discussing the interaction between registers and main memory.
- 💡Remember that the PC increments during the fetch stage, not at the end of the entire execute cycle.
Common Mistakes
- Treats the program counter as holding the instruction rather than the address of the next instruction; correct it by stating that the PC holds an address and the instruction is copied into the MDR
- Places the increment of the program counter in the execute stage; correct it by placing the increment during fetch
- Describes decode as executing the instruction; correct it by stating that decode only interprets the instruction before execute carries it out
- Believing data travels along the address bus: The address bus is strictly unidirectional (CPU to memory), carrying memory addresses only; actual instructions and data travel along the bidirectional data bus.
- Assuming the PC holds the instruction itself: The PC exclusively stores the memory address of an instruction, never the instruction code or data values.
- Thinking execution happens inside the CIR: The CIR only stores the instruction during decoding; the execution is handled by the ALU, Control Unit, or through read/write operations with the ACC and main memory.
Revision Plan
- 1Day 1-3: Memorise the exact responsibilities of PC, MAR, MDR, CIR, and ACC using flashcards and register transfer notation.
- 2Day 4-6: Practice writing out the full Fetch stage step-by-step under timed conditions, ensuring all bus interactions and the PC increment are included.
- 3Day 7-9: Work through trace tables showing how register values change when simple assembly instructions (like LDR, ADD, STR, and B) execute.
- 4Day 10-12: Complete AQA past-paper questions covering interrupts and their impact on the register state at the end of the execution phase.
Exam Question Types
- 📋Step-by-step description questions (4-6 marks): Demanding an ordered prose walkthrough of register operations during the Fetch, Decode, or Execute stages.
- 📋Trace and register state questions (2-4 marks): Requiring students to write the hexadecimal or decimal contents of specific registers after an instruction executes.
- 📋Comparison/scenario questions (3-5 marks): Analyzing how an interrupt alters the normal cycle or how clock speed/bus width impacts execution efficiency.
Command Word Expectations (AQA)
Provide a detailed, sequential account of the process without needing to justify why; order and correct technical terminology (e.g., register names and buses) are essential.
Give reasons for each stage or register action, linking cause and effect (e.g., explain *why* the PC must be copied to the MAR before the address bus is asserted).
Provide a brief summary of the key points or stages without exhaustive micro-step detail, highlighting main roles such as fetching, decoding, and executing.
How Students Lose Marks (Examiner Pitfalls)
Step-by-Step Worked Solutions
Question: Describe the sequence of register transfers that occurs during the fetch phase of the Fetch-Execute cycle. You must state the registers and system buses involved. [4 marks]
- 1.Step 1: Identify starting register and initial transfer: The contents of the Program Counter (PC), which holds the memory address of the next instruction, are copied to the Memory Address Register (MAR).
- 2.Step 2: Identify PC increment: The Program Counter (PC) is incremented by 1 to point to the subsequent instruction.
- 3.Step 3: Detail bus transmission and memory retrieval: The address stored in the MAR is sent across the address bus to main memory; the instruction held at that address is transferred across the data bus into the Memory Data Register (MDR).
- 4.Step 4: Final transfer within the CPU: The instruction stored in the MDR is copied to the Current Instruction Register (CIR) to await decoding.
Question: An assembly language instruction 'ADD 45' is executed. Explain how the CIR, MAR, MDR, and Accumulator (ACC) are utilised during the decode and execute stages. [4 marks]
- 1.Step 1: CIR decode: The instruction in the CIR is split into opcode ('ADD') and operand ('45') by the Control Unit.
- 2.Step 2: Memory addressing: The operand '45' represents a memory address; this address is loaded into the MAR.
- 3.Step 3: Data fetch: The data stored at address 45 is fetched from main memory via the data bus into the MDR.
- 4.Step 4: Execution via ALU/ACC: The Arithmetic Logic Unit (ALU) adds the value in the MDR to the existing value in the Accumulator (ACC), storing the result back in the Accumulator.