TutorChase logo
Login
AQA A-Level Computer Science

16.1.2 The Processor (CPU)

The processor (CPU) is the brain of the computer, responsible for executing instructions, performing calculations, and coordinating hardware activities within the system.

The structure of the CPU

The Central Processing Unit (CPU) is the part of a computer responsible for carrying out instructions from software by performing basic arithmetic, logic, control, and input/output (I/O) operations. It is the main component that interprets and processes instructions from the system’s memory. The CPU consists of three primary components:

  • Control Unit (CU)

  • Arithmetic Logic Unit (ALU)

  • Registers (general-purpose and special-purpose)

Each of these components has a unique and essential role in ensuring the proper functioning of the CPU during the execution of a program.

Control unit (CU)

The control unit is the part of the CPU that directs its operations. It acts as a manager, interpreting instructions from memory and initiating the correct actions to execute them. The control unit does not perform data processing tasks itself. Instead, it coordinates how data moves around the CPU and ensures the correct operation of the ALU and registers.

Functions of the control unit:

  • Fetching instructions from memory by sending signals to memory and buses.

  • Decoding the instruction to identify what operation is needed and what data or memory location is involved.

  • Issuing control signals to coordinate the execution of the instruction, directing the ALU, registers, memory, and I/O devices.

Take your grades to the next level!

UPGRADING TO PREMIUM UNLOCKS
AI Tutor
AI-powered study assistant
instant feedback and guidance
Predicted Papers
Examiner-style predicted papers
based on recent exam trends
Practice Questions
All exam practice questions
by topic for each subject
Study Notes
All detailed revision notes
written by expert teachers
Cheat Sheets
Quick revision summaries
perfect for last-minute review
Past Papers
Complete collection
of practice and past exam papers
Email
Password
Confirm Password
Already have an account?

Practice Questions

FAQ

Registers are faster than other forms of memory because they are located directly within the CPU and built using high-speed, low-capacitance circuitry. Unlike RAM, which requires accessing memory chips across buses, register access does not involve travel outside the processor. This minimises latency and allows data to be read or written in a single clock cycle. Their proximity to the execution units like the ALU enables the CPU to process data more efficiently without delays. This speed is essential during the fetch–decode–execute cycle, as instructions and data need to be readily available to maintain high throughput. If the CPU had to use main memory for every small operation, the bottleneck would drastically reduce overall performance. Registers reduce this bottleneck, enabling faster instruction execution and improved system responsiveness. They are crucial for performance in tasks that require repetitive calculations, branching, or data manipulation, as they reduce the time spent on memory access operations.

Dedicated registers, also known as special-purpose registers, have predefined functions that assist in the execution of instructions, such as managing instruction flow or memory access. Examples include the program counter (PC), which keeps track of instruction order; the memory address register (MAR), which identifies where data should be read from or written to in memory; and the current instruction register (CIR), which holds the instruction currently being processed. These registers serve specific control-related roles and are not freely usable by programmers or compilers for arbitrary data storage. In contrast, general-purpose registers can be used to temporarily hold operands, intermediate values, or addresses. They provide flexibility for operations within the CPU, especially during arithmetic or logic tasks. The distinction is important because it separates the control logic of the processor from its data manipulation capability. By clearly defining roles, the CPU maintains efficient and predictable execution flow while offering enough flexibility for complex instruction handling and performance optimisation.

The status register, sometimes referred to as the flags register, plays a key role in allowing the CPU to make decisions based on the outcomes of operations. It contains individual bits (flags) that reflect specific conditions resulting from the last executed instruction. Common flags include the zero flag, which is set if an operation results in a zero; the carry flag, which indicates an overflow in unsigned arithmetic; the sign or negative flag, which signals a negative result; and the overflow flag, which is set when a signed arithmetic operation exceeds the representable range. These flags are essential for conditional branching and decision-making. For instance, in a conditional jump instruction such as “jump if zero,” the CPU checks the zero flag to decide whether to change the flow of execution. The status register enables the processor to adapt its behaviour dynamically based on outcomes, which is crucial for implementing control structures like loops, if-statements, and exception handling.

When the CPU is interrupted, it temporarily halts the execution of the current program to respond to an interrupt request—this could be from hardware (e.g. I/O devices) or software (e.g. exceptions). To ensure the interrupted program can resume correctly afterward, the CPU must save the current state. This involves storing the contents of all relevant registers, including the program counter, accumulator, status register, and others, onto the system stack or a reserved memory area. This process is typically handled automatically by the CPU or the operating system’s interrupt service routine. Once the interrupt has been processed, the CPU restores the saved values from the stack back into the registers. This process is known as context saving and restoring. It ensures that the CPU continues execution exactly where it left off without data corruption or loss. This mechanism allows multitasking, asynchronous events, and real-time processing to occur without disrupting program correctness.

Although a traditional CPU can only execute one instruction at a time using a single set of registers, modern CPUs use a variety of techniques to manage simultaneous instruction handling efficiently. One common approach is instruction pipelining, where different stages of multiple instructions (fetch, decode, execute) are overlapped. This means while one instruction is being decoded, another is being fetched, and a third is being executed. Even though there is only one physical set of registers, the CPU manages temporary results and instruction data through internal buffers and register renaming. Register renaming prevents conflicts when instructions use the same registers by dynamically allocating temporary storage. Additionally, in multi-core CPUs, each core has its own set of registers, allowing true parallel execution of separate instruction streams. Some CPUs also support simultaneous multithreading (SMT), where multiple threads share a single core and register file, with the processor rapidly switching context to maintain high utilisation. These strategies optimise throughput while preserving correctness.

Hire a tutor

Please fill out the form and we'll find a tutor for you.

1/2
Your details
Alternatively contact us via
WhatsApp, Phone Call, or Email