Performance, the fetch-execute cycle and interrupts
Speed, ports and the cycle
- What makes one CPU faster than another?
- How does it actually run an instruction?
- And how does it drop everything for an urgent event — an interrupt?
What affects performance
- Clock speed — more cycles per second.
- Number of cores — a multi-core CPU runs several threads at once (great for parallel work).
- Word size — a 64-bit CPU handles 64-bit chunks and addresses far more memory than 32-bit.
- Amount of RAM, cache size, secondary storage type (SSD vs HDD), and bus width/speed all matter too.
- Match the spec to the workload: more cores for parallel jobs, higher per-core speed for single-threaded ones.
Select all the factors that affect CPU performance.
Clock speed, cores and cache (plus word size, RAM, storage and bus width) all affect performance. The case colour does not.
A multi-core CPU is especially helpful for:
Extra cores run tasks in parallel. A purely single-threaded job benefits more from higher per-core speed.
Ports
- A port is a physical socket for a peripheral:
- USB — general-purpose (keyboards, drives, phones); HDMI — digital video + audio to a screen.
- Ethernet (RJ-45) — wired LAN; audio jacks — headphones/microphone.
- USB-C is unusual in carrying video, data and power.
The fetch-execute cycle
- The CPU repeats this once per instruction:
- Fetch — copy PC → MAR; increment the PC; send a read signal; memory puts the instruction on the data bus → MDR → CIR.
- Decode — the CU works out the operation and operands.
- Execute — the CU carries it out (ALU for maths, load/store for memory, branch changes the PC). Then repeat.
Put the fetch steps in the correct order.
PC → MAR, increment PC, read signal, then the instruction travels MDR → CIR ready to decode.
Interrupts
- An interrupt is a signal that pauses the cycle so the CPU can handle an urgent event (a key press, a packet, a fault, the OS timer).
- Handling one: finish the current instruction → save the state (PC + registers) → run the interrupt service routine (ISR) → restore the state → carry on.
- Interrupts let the system respond promptly and are how the OS multitasks.
An interrupt is:
An interrupt temporarily pauses the fetch-execute cycle so the CPU can service an urgent event, then resumes.
When an interrupt occurs, the CPU first finishes the current instruction, then:
It saves the PC and registers, runs the interrupt service routine, then restores the state and continues where it left off.
You've got it
- performance depends on clock speed, cores, word size, RAM, cache, storage, bus width
- a port is a socket for a peripheral (USB, HDMI, Ethernet)
- fetch (PC→MAR, increment PC, read → MDR → CIR) → decode → execute, repeat
- an interrupt pauses the cycle: save state → run ISR → restore state