CPU components
Inside the Computer: CPU and Main Memory
The central processing unit (CPU) is the component that executes program instructions. It works closely with main memory (RAM), which stores the instructions and data currently in use. Together, the CPU and main memory form the core of a computer system. Understanding each component inside the CPU - and how they communicate - explains how a computer can carry out millions of operations every second.
The CPU contains the Control Unit, ALU, registers, and clock. Buses carry data between the CPU and main memory.
Components in Detail
Inside the CPU
Arithmetic Logic Unit (ALU)
The arithmetic logic unit (ALU) performs all arithmetic calculations (addition, subtraction, multiplication, division) and all logical operations (comparisons such as greater than, equal to, AND, OR, NOT). Every time a program adds two numbers, compares a password, or evaluates a condition, it is the ALU carrying out that operation. The ALU receives data from registers, performs the operation, and places the result back into a register.
Control Unit (CU)
The control unit (CU) directs and coordinates all operations within the CPU. It does not perform calculations itself - instead, it sends control signals to every other component, telling them what to do and when. The CU reads instructions from memory, decodes them to determine what action is required, and then orchestrates the appropriate parts of the CPU to carry out that action.
Clock
The clock generates a regular electronic pulse that synchronises all operations inside the CPU. Every action the CPU takes happens on a clock pulse - fetching an instruction, performing a calculation, writing a result. The speed of this pulse is the clock speed, measured in gigahertz (GHz). A 3 GHz processor can complete up to 3 billion clock cycles per second. A faster clock means more operations per second and generally faster program execution.
Registers
Registers are extremely fast, small storage locations built directly into the CPU. They hold data, instructions, and addresses that the CPU is currently working with. Because registers are inside the CPU itself, the processor can access them in a single clock cycle - far faster than accessing main memory. Knowledge of specific register names is not required at GCSE level.
Main Memory (RAM)
Main memory, also called RAM (Random Access Memory), temporarily stores the programs and data that the CPU is currently using. When you open an application, it is loaded from long-term storage (e.g. a hard drive or SSD) into RAM so the CPU can access it quickly. RAM is much faster to access than storage devices, but its contents are lost when the computer is switched off - it is volatile.
Main memory holds:
- The instructions of currently running programs
- The data those programs are working with
- The operating system, which must always be in memory while the computer is running
The CPU fetches instructions and data from RAM via the buses. The more RAM a computer has, the more programs and data it can keep immediately accessible, reducing the need to read from slower storage.
Buses
A bus is a collection of parallel wires through which data or signals are transmitted between components. Buses connect the CPU to main memory and to other devices. There are three types of bus, each carrying different information:
- Data bus - carries the actual data being transferred between the CPU and memory (or other components). It is bidirectional: data travels in both directions.
- Address bus - carries the memory address of the data or instruction the CPU wants to read or write. It travels in one direction only: from the CPU to memory.
- Control bus - carries control signals that coordinate the activities of all components - for example, signalling whether a memory operation is a read or a write. It is bidirectional.
The width of a bus (the number of parallel wires) affects performance. A wider data bus can transfer more bits per clock cycle; a wider address bus allows the CPU to access a larger range of memory addresses.
Key Takeaways
- The ALU performs all arithmetic calculations and logical comparisons.
- The Control Unit directs all CPU operations by sending control signals - it does not perform calculations itself.
- The clock synchronises CPU operations; clock speed (in GHz) determines how many cycles occur per second.
- Registers are ultra-fast storage locations inside the CPU used to hold data currently being processed.
- Main memory (RAM) stores currently running programs and data; it is volatile (contents lost when power is off).
- The three buses connect components: the data bus carries data (bidirectional), the address bus carries memory addresses (one-way), and the control bus carries control signals (bidirectional).