OCR H446 · A Level Computer Science · ~13 min read · PRO
Notes
—
Video
—
Slides
—
Worksheet
—
Quiz
Overview of the Fetch-Decode-Execute Cycle
The CPU continuously repeats the Fetch-Decode-Execute (FDE) cycle to carry out program instructions. Each iteration processes one instruction. The cycle involves several registers working in a precise sequence.
Stage 1: Fetch
The fetch stage retrieves the next instruction from main memory:
The contents of the Program Counter (PC) are copied to the Memory Address Register (MAR).
The address in the MAR is placed on the address bus; the Control Unit asserts a read signal on the control bus.
Main memory responds by placing the instruction at that address onto the data bus.
The instruction travels via the data bus to the Memory Data Register (MDR).
The contents of the MDR are copied to the Current Instruction Register (CIR).
The PC is incremented to point to the next instruction (this can happen concurrently with steps 2–5).
Stage 2: Decode
The Control Unit decodes the instruction held in the CIR:
The instruction is split into its opcode (operation code — the operation to be performed, e.g. ADD, LOAD, STORE) and operand (the data or address to operate on).
The CU interprets the opcode and generates the appropriate control signals to activate the correct components.
If the operand is a memory address, the address is loaded into the MAR so data can be fetched in the execute stage.
Stage 3: Execute
The decoded instruction is carried out:
If it is an arithmetic or logical instruction: the ALU performs the operation on the operands; the result is stored in the Accumulator (or a general purpose register); the status register flags are updated.
If it is a memory read: the address is placed on the address bus; data is read from memory into the MDR, then transferred to a register.
If it is a memory write: the data is transferred from a register to the MDR; the address is placed in the MAR; the data is written to memory via the data bus.
If it is a branch instruction: the PC is updated with the branch target address (overwriting the normal sequential increment), causing a jump in program execution.
Interrupt Handling (A Level)
At the end of each execute stage, the CU checks the interrupt register (or a dedicated interrupt flag) to see if an interrupt has been raised. Interrupts are signals from hardware or software requesting the CPU's attention (e.g. I/O completed, timer expired, error).
If an interrupt with sufficient priority is pending:
The CPU finishes the current instruction.
The current values of all registers (PC, CIR, ACC, GPRs, status register) are saved to a special area of memory called the stack — this is called the context save.
The PC is loaded with the address of the appropriate Interrupt Service Routine (ISR), obtained from the interrupt vector table.
The ISR executes (its own FDE cycle iterations).
At the end of the ISR, the saved register values are restored from the stack (context restore), and the PC is restored to where it was before the interrupt, allowing the original program to continue exactly where it left off.
FDE Stage
Registers involved
Buses used
Fetch
PC, MAR, MDR, CIR
Address bus (MAR → memory), Data bus (memory → MDR), Control bus (read signal)
Decode
CIR
None (internal to CU)
Execute (ALU)
ACC / GPR, Status register, ALU
None (internal), or Address+Data buses for memory operands
Execute (branch)
PC (overwritten with branch address)
None
Exam tip: At A Level you must know every register involved at each stage, not just the broad steps. The most common A Level question asks you to trace through the FDE cycle stating which register is used at each micro-operation.
Exam tip: For interrupts, know: (1) check occurs at the END of the execute stage; (2) context (all registers) is saved to the stack; (3) ISR address comes from the interrupt vector table; (4) context is restored when the ISR finishes.
⚠ Common Mistakes
Saying the PC is incremented during decode — it is incremented during the fetch stage.
Forgetting that the interrupt check occurs at the end of execute (not during fetch or decode).
Not mentioning the context save/restore when describing interrupt handling — this is essential at A Level.
Confusing the opcode and operand — the opcode is the operation; the operand is the data or address.
✓ Notes completed!
▶
Video coming soon
In production
Click to advance · Arrow keys also work
Click slide or press arrow keys to navigate
✍
Worksheet — 1.1.1c The Fetch-Execute Cycle
8 questions · 20 marks · instantly marked
Q1List, in order, the four registers used during the fetch stage of the FDE cycle.[2 marks]
✓ Mark scheme
Mark scheme
PC and MAR [1]; MDR and CIR [1]. (All four named, in the order: PC → MAR → MDR → CIR.)
Q2Describe what happens to the Program Counter during the fetch stage.[2 marks]
✓ Mark scheme
Mark scheme
The value of the PC is copied to the MAR [1]; the PC is then incremented to point to the address of the next instruction [1].
Q3Describe what happens during the decode stage of the FDE cycle.[3 marks]
✓ Mark scheme
Mark scheme
The instruction in the CIR is interpreted / split by the Control Unit [1]; it is split into the opcode (operation to be performed, e.g. ADD, LOAD) and the operand (data or address) [1]; the CU generates control signals to activate the appropriate components to carry out the instruction [1].
Q4Explain what happens during the execute stage for an instruction that adds two values and stores the result.[3 marks]
✓ Mark scheme
Mark scheme
The operands are sent to the ALU [1]; the ALU performs the addition and produces a result [1]; the result is stored in the Accumulator or a general purpose register, and the status register flags (e.g. carry, zero) are updated accordingly [1].
Q5When during the FDE cycle does the CPU check for interrupts? Explain why it checks at this point.[2 marks]
✓ Mark scheme
Mark scheme
The CPU checks for interrupts at the end of the execute stage [1]; this is because the current instruction must be completed before the CPU responds to an interrupt, ensuring data integrity and predictable program behaviour [1].
Q6Describe the process of handling an interrupt, including what happens to the current program.[4 marks]
✓ Mark scheme
Mark scheme
The current register values (PC, CIR, ACC, GPRs, status register) are saved to the stack — a context save [1]; the address of the appropriate Interrupt Service Routine (ISR) is fetched from the interrupt vector table [1]; the ISR is executed via its own FDE cycle iterations [1]; when the ISR finishes, the saved register values are restored from the stack (context restore) and the original program continues from where it left off [1].
Q7Explain how the execute stage of the FDE cycle differs for a branch instruction compared to an arithmetic instruction.[2 marks]
✓ Mark scheme
Mark scheme
For an arithmetic instruction, the ALU performs the operation and the result is stored in a register [1]; for a branch instruction, the PC is overwritten with the branch target address (rather than the normal sequential increment), causing program execution to jump to a different location [1].
Q8A student states: “The context save during interrupt handling only needs to save the Program Counter, as that is the only register that tells the CPU where to return.” Evaluate this statement.[2 marks]
✓ Mark scheme
Mark scheme
The statement is incorrect [1]; all registers must be saved (PC, CIR, ACC, GPRs, status register) because the ISR will use the same registers during its own execution, overwriting their current values. If only the PC were saved, the original program's data (in ACC, GPRs, status register) would be corrupted when the ISR runs [1].
Topic Quiz
1 of 15
You scored
out of 15
🎯
Mini Test — 1.1.1c Fetch-Execute Cycle
Timed exam conditions.
10 questions · 10 marks · 10 minutes
5 MCQ + 5 short answer
Mark schemes after submission
⏱10:00
10 marks
Section A — Multiple Choice
Q1Which register receives the instruction from memory during the fetch stage?
Q2The PC is incremented during which stage of the FDE cycle?
Q3What is an opcode?
Q4Where is the address of the Interrupt Service Routine (ISR) found?
Q5When handling an interrupt, all register values are saved to the:
Section B — Short Answer
Q6State the first two steps of the fetch stage of the FDE cycle.
Mark schemeThe PC value is copied to the MAR [step 1]; the address in the MAR is placed on the address bus and a read signal is sent on the control bus [step 2]. [1 mark]
Q7State what the Control Unit does during the decode stage.
Mark schemeThe CU decodes the instruction in the CIR, splitting it into opcode and operand, and generates control signals to activate the correct components. [1 mark]
Q8At what point in the FDE cycle is the interrupt checked?
Mark schemeAt the end of the execute stage (after the current instruction has been completed). [1 mark]
Q9What is meant by a context restore after an ISR has finished?
Mark schemeThe previously saved register values (PC, ACC, GPRs, status register) are retrieved from the stack and restored to the registers, allowing the original program to continue from where it was interrupted. [1 mark]
Q10Explain what happens to the PC during the execute stage when a branch instruction is executed.
Mark schemeThe PC is overwritten with the branch target address, causing the next fetch to retrieve the instruction at that new address rather than the sequential next instruction. [1 mark]