The Central Processing Unit (CPU) is the main processing component of a computer. It carries out program instructions, performs calculations and coordinates the activities of other components. The CPU is often described as the brain of the computer because many of the computer's operations depend on it.
This note explains the main functions of the CPU, its internal components, how those components work together, and the units used to describe processor speed.
What Is the CPU?
The CPU (Central Processing Unit) is the part of a computer that interprets and executes instructions. It processes data according to the instructions of programs and controls the operation of other components.
The CPU does not work alone. It communicates with primary memory, input devices, output devices, and storage through connections called buses.
The CPU has three important responsibilities:
- Processing: performing arithmetic calculations, comparisons, and logical operations on data.
- Instruction execution: carrying out the instructions contained in programs.
- Control: coordinating the activities of the computer's components.
The CPU is commonly called the brain of the computer, but it is a hardware component rather than a complete computer system. A computer also needs memory, input and output devices, and other components to operate.
Main Components of the CPU
The three main components shown in this note are:
- Arithmetic and Logic Unit (ALU)
- Control Unit (CU)
- Memory Registers
These components work together during instruction processing.
1. Arithmetic and Logic Unit (ALU)
The Arithmetic and Logic Unit (ALU) performs arithmetic and logical operations on data. It is responsible for calculations and comparisons required by program instructions.
Arithmetic operations
Arithmetic operations are mathematical calculations, such as:
- Addition
- Subtraction
- Multiplication
- Division
When a program adds the prices of several items, the CPU's ALU performs the required arithmetic operations and produces the calculated result.
Logical operations
Logical operations work with conditions and comparisons. They help a program make decisions based on data.
Examples include:
- AND: produces a true result only when both input conditions are true.
- OR: produces a true result when at least one input condition is true.
- NOT: reverses a logical value; true becomes false and false becomes true.
- Comparison: checks relationships such as equal to, greater than, or less than.
A program may need to check whether a student's mark is greater than or equal to a pass mark. The ALU can perform the comparison, and the program can use the result to decide what to do next.
Key Idea: The ALU performs arithmetic calculations and logical operations. It does not coordinate the entire computer; that is the role of the Control Unit.
2. Control Unit (CU)
The Control Unit (CU) controls and coordinates the operations of the computer. It manages the execution of instructions and sends control signals to other components.
The Control Unit works with instructions stored in memory. It interprets the instructions and directs the relevant components to carry out the required actions.
Its main functions include:
- Controlling operations: coordinating the activities of the CPU and other computer components.
- Sending control signals: issuing signals that tell components when and what actions to perform.
- Directing data and instruction flow: coordinating transfers between input devices, memory, the ALU, and output devices.
How the Control Unit works
A simplified view of instruction processing is:
This is a simplified sequence. Actual CPU operation involves repeated instruction cycles and coordination among several internal components.
Example: Adding two numbersWhen a program needs to add two numbers, the Control Unit coordinates the steps. It arranges for the required data to be available, directs the ALU to perform the addition, and helps ensure that the result is placed where the program needs it.
3. Memory Registers
Registers are small, very fast storage locations inside the CPU. They temporarily hold data, instructions, addresses, and intermediate results needed during processing.
Registers are much smaller in capacity than main memory, but they are designed to be accessed quickly by the CPU.
Registers are used to:
- Hold data that the CPU is currently processing.
- Keep instructions or information needed during instruction execution.
- Store intermediate results produced by operations.
- Hold values temporarily so the CPU can use them without repeatedly accessing main memory.
The note illustrates registers using labels such as R1, R2, R3, and R4. These labels represent separate register locations; the exact number and purpose of registers depend on the processor's design.
Example: Temporary calculation resultsWhile evaluating an expression, the CPU may keep values and intermediate results in registers. The ALU can use these values for the next operation, and the result can later be stored in memory.
Key Idea: Registers are temporary storage locations inside the CPU. They hold information that is needed immediately during processing.
Buses and Communication Within the Computer
A bus is a communication pathway used to transfer information between computer components. The note identifies three types:
- Data bus: carries data between components.
- Address bus: carries addresses that identify memory locations or input/output locations.
- Control bus: carries control signals used to coordinate operations.
The CPU uses these pathways to communicate with memory and other components. For example, it may use an address to identify where information is stored, transfer data through the data bus, and use control signals to coordinate the operation.
The three buses have different purposes, so they should not be treated as interchangeable.
How the CPU Works with Other Components
A computer system accepts data and instructions, processes them, and produces results. The CPU performs the processing and coordinates many of the activities involved.
A simplified flow is:
The flow is not necessarily a one-way path. During processing, the CPU may repeatedly retrieve instructions and data from memory, store intermediate results, and send results to output devices or storage.
Computer Processing and CPU Speed
The CPU executes program instructions. Its speed is often discussed in relation to the number of cycles it performs per second.
The unit hertz (Hz) means one cycle per second. Larger units are commonly used to describe processor clock frequency.
| Unit | Meaning |
|---|---|
| Hertz (Hz) | 1 cycle per second |
| Kilohertz (kHz) | 1,000 cycles per second |
| Megahertz (MHz) | 1,000,000 cycles per second |
| Gigahertz (GHz) | 1,000,000,000 cycles per second |
For example, a processor with a clock frequency of 2 GHz has a clock signal of 2 billion cycles per second.
Clock frequency is useful when describing a CPU, but it is not the same as the exact number of instructions completed per second. The number of instructions completed also depends on the processor's design and the instructions being executed.
Differences Between the ALU, CU, and Registers
| Component | Main function |
|---|---|
| Arithmetic and Logic Unit (ALU) | Performs arithmetic calculations and logical operations |
| Control Unit (CU) | Interprets instructions and coordinates operations using control signals |
| Registers | Temporarily store data, instructions, addresses, and intermediate results inside the CPU |
All three components are needed for instruction processing, but they perform different roles.
Exam-Focused Points
Key Idea: The CPU is the main component responsible for executing program instructions, processing data, and controlling the operation of other components.
- ALU performs arithmetic and logical operations.
- CU coordinates computer operations and sends control signals.
- Registers are small, fast, temporary storage locations inside the CPU.
- Data, address, and control buses support communication between components.
- Hz is a unit of frequency. MHz means one million cycles per second, while GHz means one billion cycles per second.
Summary
The CPU executes program instructions, processes data, and coordinates the operation of a computer. Its main components have distinct roles: the ALU performs calculations and logical operations, the Control Unit directs and coordinates activities, and registers hold information temporarily during processing. Buses allow the CPU to communicate with other components. CPU clock frequency is measured in hertz, commonly expressed in MHz or GHz.