What is a CPU?
- Stands for the "Central Processing Unit".
- The part of the computer that is responsible for "thinking", "deciding" or "Controlling" what the computer does.
Core Components of the CPU
The CPU consists of several key components, each with a specific role:
- Registers: small, fast memory storage locations for holding current data and instructions being processed
- Units: Responsible for executing the algorithm steps
- Arithmetic Logic Unit (ALU): arithmetic and logical operations.
- Control Unit (CU): Generates control signals to activate hardware units.
- Busses: Responsible for carrying data and instructions from one component to another

Computers are designed to help people with “thinking” tasks.
- Just as we need a brain to process the world around us, computers need one too.
- For a computer, this brain is the Central Processing Unit (CPU).
- Like the human brain, it makes decisions and performs calculations based on data stored in short-term memory.
Arithmetic Logic Unit (ALU)
- It does all the thinking!
- Performs arithmetic (add, subtract) and logical (AND, OR, NOT) operations.
- Works with data from registers.
Control Unit (CU)
- The boss or controller of the CPU.
- Orchestrates the fetch-decode-execute cycle.
- Decodes instructions and directs data flow between CPU, memory, and peripherals.
- Sends control signals via the control bus.
Registers: The CPU's Fastest Memory
Registers
Registers are small, high-speed storage locations within the CPU.
They temporarily hold data and instructions during execution.
- Instruction Register (IR)
- Holds the current instruction being executed.
- Program Counter (PC)
- Stores the address of the next instruction to be executed.
- Memory Address Register (MAR)
- Holds the address of the memory location to be accessed.
- Memory Data Register (MDR)
- Stores data being transferred to or from memory.
- Accumulator (AC)
- Holds intermediate results of arithmetic and logical operations.
Buses: The Communication Pathways
Buses
Buses are communication pathways that transfer data between CPU components and other parts of the computer.
- Address Bus
- Carries memory addresses from the CPU to specify where data should be read or written.
- This is unidirectional and only goes from the CPU to the memory
- Data Bus
- Transfers actual data between the CPU, memory, and other components.
- Bidirectional, allowing data flow in both directions.
- Control Bus
- Carries control signals from the CU to manage actions and timing.
Cache
- A small, high-speed memory located inside or very close to the CPU.
- Purpose: Stores frequently used data and instructions to speed up access and reduce the need to fetch from slower main memory (RAM).
- Levels:
- L1 Cache: Smallest and fastest, closest to the CPU core.
- L2 Cache: Larger but slightly slower.