Central Processing Unit (CPU)

Learning Objectives

  • Understand the function and importance of the CPU in a computer system
  • Identify and describe the main components of the CPU
  • Explain how the CPU processes instructions and data

1.3.1 Function of the CPU

The CPU (Central Processing Unit) is known as the brain of the computer which receives data from the input unit, processes instructions, and sends results to the output unit.
It performs calculations, logical operations, and decision-making tasks essential for running programs and managing system operations.
Intel CPUs (e.g., Intel Core i5, i7, i9), AMD CPUs (e.g., Ryzen series, EPYC), Apple CPUs(M1, M2), ARM CPUs ((e.g., Qualcomm Snapdragon, MediaTek)), etc. are popular examples of CPUs.
It performs the following key functions:

Key Functions of the CPU

  • Fetch: CPU takes (fetches) instructions or data from the main memory (RAM).
  • Decode: CPU interprets (decodes) the fetched instructions to understand what action is required.
  • Execute: CPU carries out the instruction (arithmetic, logic, data movement, or hardware control).
  • Store: CPU stores the result in memory or sends it to an output device.
  • Managing Interrupts CPU handles signals (interrupts) from hardware or software to ensure smooth and efficient processing.

The CPU's performance is measured by its clock speed (in GHz), which indicates how many instructions it can process per second. Modern CPUs can perform billions of operations per second!

Real-Life Example: Calculating 25 + 10

Let's see how the CPU processes a simple addition problem:

  • Fetch → The CPU retrieves the instruction "25 + 10" from memory.
  • Decode → It recognizes this as an addition operation between two numbers.
  • Execute → The Arithmetic Logic Unit (ALU) performs the calculation: 25 + 10 = 35.
  • Store → The result (35) is saved back to memory for later use or display.
  • Manage Interrupts → If a higher-priority task (like a notification) comes up, the CPU might pause to handle it before completing the calculation.

This entire process happens in nanoseconds, and modern CPUs can perform billions of such operations every second!

1.3.2 Components of the CPU

The CPU consists of three main components that work together to process instructions:

1. Control Unit (CU)

The Control Unit (CU) directs and coordinates all operations of the computer by controlling the flow of data between the CPU, memory, and input/output devices.

2. Arithmetic and Logic Unit (ALU)

The Arithmetic Logic Unit (ALU) is the part of the CPU that performs all arithmetic operations (addition, subtraction, multiplication, division) and logical operations (>, <, =, ≠, AND, OR, NOT).

3. Memory Unit (Registers)

The Memory Unit (MU) is the part of the CPU that stores data, instructions, and results temporarily during processing, so they can be quickly accessed by the Control Unit and ALU.

Interactive Activity

Match the CPU component with its function:

Controls and coordinates all CPU operations
Performs calculations and comparisons
Temporarily holds data and instructions
Control Unit
ALU
Registers

Summary

  • The CPU is the brain of the computer that processes instructions and data.
  • The main components of the CPU are the Control Unit, Arithmetic and Logic Unit, and Memory Unit (Registers).
  • The Control Unit manages and coordinates all CPU operations.
  • The ALU performs all arithmetic and logical operations.
  • Registers are small, high-speed storage locations that temporarily hold data and instructions.