CPU Functions
Presented By : Ziad Mahmoud
202006018
Presented To : DR Mohamed Khalaf
The Role of the CPU in a Computer System
1- What is the CPU?
The Central Processing Unit (CPU) is the brain of the computer, responsible for executing
instructions, processing data, and managing system operations. It controls all activities within
the computer and ensures smooth execution of tasks.
2- Key Components of the CPU and Their Functions
1. Control Unit (CU)
Main Responsibilities:
Directs the flow of data between the CPU, memory, and input/output devices.
Manages the Fetch-Decode-Execute Cycle to process instructions.
Coordinates operations between the ALU, memory, and registers.
2. Arithmetic Logic Unit (ALU)
Main Responsibilities:
Executes arithmetic operations (addition, subtraction, multiplication, division).
Performs logical operations (AND, OR, NOT, XOR).
Compares values (greater than, less than, equal to).
Sends results to registers or memory.
The Role of the CPU in a Computer System
Registers
What are Registers?
Small, high-speed memory units within the CPU that store temporary data and instructions.
They hold the current instruction, addresses, and intermediate results.
Important Registers:
Program Counter (PC): Stores the address of the next instruction to be executed.
Instruction Register (IR): Holds the current instruction being processed.
Accumulator (ACC): Stores intermediate results from calculations.
Cache Memory
Role of Cache Memory:
A small but fast memory inside the CPU that stores frequently accessed instructions and data.
Reduces the need to access RAM, which speeds up processing.
How Does the CPU Work? (Fetch-Decode-Execute Cycle)
The Three Steps of the Execution Cycle:
1. Fetch:
The Control Unit (CU) retrieves an instruction from RAM and loads it into the Instruction Register (IR).
2. Decode:
The CU interprets the instruction and determines if it requires processing in the ALU.
3. Execute:
The ALU performs the required operation, and the result is stored in registers or memory.
The Program Counter (PC) is updated to fetch the next instruction.
How the CPU Interacts with Other Components
RAM (Random Access Memory): Stores instructions and data for active processes.
Data Bus: Transfers data between the CPU and other components.
Input/Output Devices: Communicates with the CPU to send and receive data.
Why is CPU Speed and Performance Important?
Clock Speed (GHz): Determines how many instructions the CPU can process per second.
Number of Cores: More cores allow parallel processing, improving multitasking.
✅ Cache Memory Size: Larger cache reduces data access time, increasing efficiency.