Skip to topic
    ← Back to course topics

    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

    1. 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
    1. 1Day 1-3: Memorise the exact responsibilities of PC, MAR, MDR, CIR, and ACC using flashcards and register transfer notation.
    2. 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.
    3. 3Day 7-9: Work through trace tables showing how register values change when simple assembly instructions (like LDR, ADD, STR, and B) execute.
    4. 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)
    Describe

    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.

    Explain

    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).

    Outline

    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)
    Pitfall: Confusing the distinct roles of the Memory Address Register (MAR) and Memory Data Register (MDR), or claiming the PC holds the instruction itself.
    ❌ Weak Answer (Loses Marks):The PC gets the instruction, sends it to the MDR, and then the CPU does the math.
    Example improved answer:The address held in the Program Counter (PC) is copied to the Memory Address Register (MAR). The PC is then incremented. The MAR places this address onto the address bus, and the instruction located at that memory location is returned via the data bus into the Memory Data Register (MDR). The contents of the MDR are then copied into the Current Instruction Register (CIR).
    Examiner Tip: Always specify what moves where and mention the specific bus involved when describing the fetch stage in full mark scheme questions.
    Pitfall: Omitting the incrementing of the Program Counter or stating it happens during the execute stage rather than concurrently during the fetch stage.
    ❌ Weak Answer (Loses Marks):The instruction is fetched and the PC counts to the next line at the end after the instruction runs.
    Example improved answer:During the fetch phase, immediately after the address in the PC is copied to the MAR, the Program Counter is incremented by one so that it points to the memory address of the next sequential instruction to be fetched.
    Examiner Tip: Explicitly state 'PC is incremented' immediately after 'PC copied to MAR' to ensure you do not drop sequencing marks in 4-to-6-mark descriptions.
    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. 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. 2.Step 2: Identify PC increment: The Program Counter (PC) is incremented by 1 to point to the subsequent instruction.
    3. 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. 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.
    Final Answer: 1. MAR <- [PC]; 2. PC <- [PC] + 1; 3. MDR <- [[MAR]] via address/data buses; 4. CIR <- [MDR].

    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. 1.Step 1: CIR decode: The instruction in the CIR is split into opcode ('ADD') and operand ('45') by the Control Unit.
    2. 2.Step 2: Memory addressing: The operand '45' represents a memory address; this address is loaded into the MAR.
    3. 3.Step 3: Data fetch: The data stored at address 45 is fetched from main memory via the data bus into the MDR.
    4. 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.
    Final Answer: The Control Unit decodes the opcode and operand in the CIR; address 45 is placed in the MAR; the contents of memory address 45 are fetched into the MDR; the ALU adds the MDR value to the Accumulator, and the result is written back to the Accumulator.
    Active Recall Memory Test
    Which register holds the memory location of the next instruction to be fetched?
    Key Fact: The Program Counter (PC).
    Which bus carries the contents of the memory location addressed by the MAR back into the MDR?
    Key Fact: The Data Bus.
    What two parts is an instruction split into inside the Current Instruction Register (CIR)?
    Key Fact: Opcode (operation code) and operand (data or memory address).
    At what exact point during the Fetch-Execute cycle does the CPU check for pending interrupts?
    Key Fact: At the very end of the execute stage (before the next fetch stage begins).
    Frequently Asked Questions
    Why does the CPU need both a MAR and an MDR instead of just one register?
    The CPU needs both because memory operations require separating 'where to look' from 'what is stored there'. The MAR connects strictly to the unidirectional address bus to point to a specific memory cell, whereas the MDR connects to the bidirectional data bus to buffer the actual value being read or written. Combining them into one register would cause hardware collisions and prevent simultaneous addressing and data transmission.
    What happens to the registers when a branch or jump instruction is executed?
    When a branch instruction executes, the operand component of the instruction (which contains the target branch destination) is copied directly into the Program Counter (PC). This overwrites the sequential increment that occurred during the fetch phase, ensuring that the next fetch stage pulls the instruction from the branch target address rather than the next sequential memory line.
    How does an interrupt affect the registers in the Fetch-Execute cycle?
    At the conclusion of the execute stage, the CPU checks the interrupt register. If an interrupt with higher priority than the current task is detected, the contents of key registers (including the PC, CIR, and ACC) are pushed onto the system stack in memory. The PC is then loaded with the start address of the relevant Interrupt Service Routine (ISR); once completed, the saved register values are popped off the stack back into their respective registers to resume normal execution.
    What is the difference between opcode and operand in the CIR?
    The opcode determines the specific operation that the processor hardware must perform, such as an addition (ADD), store (STR), or branch (BRZ). The operand represents the target of that operation, which can be an immediate value (literal data), a register identifier, or a reference to a memory address where the required operand is stored.