Microprocessor (CPU)
Table of Contents
What is a Microprocessor?
A Microprocessor is the central processing unit (CPU) of a computer system, built on a single integrated circuit (IC) chip.
It performs all computational tasks, decision-making, and control operations.
You can think of it as the “brain” of the computer that processes all data and executes instructions stored in memory.
Examples:
- Intel 8085, 8086
- Intel Core i5, i7
- AMD Ryzen 5
- ARM processors (used in smartphones)
Main Components of CPU
- ALU (Arithmetic Logic Unit)
- CU (Control Unit)
- MU (Memory Unit) or Registers
1. Arithmetic Logic Unit (ALU)
Definition:
The ALU is the part of the CPU responsible for all mathematical and logical operations. It takes input data from registers or memory, processes it, and sends the result back.
Functions of ALU:
Arithmetic Operations:
- Addition →
5 + 3 = 8 - Subtraction →
9 - 4 = 5 - Multiplication →
2 × 6 = 12 - Division →
12 ÷ 3 = 4 - Increment / Decrement →
X = X + 1,X = X - 1
Logical Operations:
- AND – Returns 1 if both bits are 1.
Example:1 AND 1 = 1,1 AND 0 = 0 - OR – Returns 1 if any bit is 1.
Example:1 OR 0 = 1 - NOT – Inverts the bit.
Example:NOT 1 = 0 - XOR – Returns 1 if bits are different.
Example:1 XOR 0 = 1 - Comparison – Checks if
A > B,A = B, orA < B.
Example
If you want to add two numbers stored in registers R1 = 10 and R2 = 20,
→ The ALU performs: R3 = R1 + R2
→ Result (30) is stored in register R3.
2. Control Unit (CU)
Definition:
The Control Unit manages and coordinates all the operations inside the CPU.
It tells the ALU, Memory Unit, and Input/Output devices what to do and when to do it.
It does not process data itself but ensures that all components work together correctly.
Main Functions of CU:
- Fetching:
CU fetches instructions from memory (using Program Counter).
Example: Fetch instructionADD R1, R2. - Decoding:
CU interprets the fetched instruction — e.g., it understands that this means add contents of R1 and R2. - Execution Control:
CU sends control signals to ALU to perform the addition. - Storing Result:
CU directs the result to be stored in the specified register or memory location.
Example
Suppose you write a small program to calculate A + B:
- CU fetches the instruction
ADD A, Bfrom memory. - CU decodes it (understands what to do).
- CU signals ALU to perform addition.
- ALU adds A and B.
- CU then stores the result in memory or a register.
3. Memory Unit (MU)
Definition:
The Memory Unit stores data, instructions, and results temporarily or permanently.
It acts as the storage space for everything the CPU needs to process.
Types of Memory:
| Type | Description | Example |
|---|---|---|
| Primary Memory (Main Memory) | Directly accessible by CPU | RAM, ROM |
| Secondary Memory | Long-term data storage | Hard disk, SSD |
| Cache Memory | High-speed temporary storage | L1, L2, L3 cache |
| Registers | Small, fastest memory inside CPU | AX, BX (in Intel CPUs) |
Example
When you run a program:
- Instructions are stored in RAM.
- CU fetches them one by one.
- ALU executes them.
- Intermediate results may be stored in registers temporarily.
- Final output is stored back in RAM or disk.
4. How CPU Works (Step-by-Step Cycle)
This process is known as the Instruction Cycle or Fetch–Decode–Execute Cycle.
| Step | Description | Example |
|---|---|---|
| Fetch | CU fetches instruction from memory. | Fetch “ADD R1, R2” |
| Decode | CU interprets what needs to be done. | Understand that it’s an addition command. |
| Execute | ALU performs the operation. | Add the data in R1 and R2. |
| Store | Result is saved in register or memory. | Store sum in R3. |
Other CPU Components
| Component | Description |
|---|---|
| Registers | High-speed storage for temporary data (like R1, R2, Accumulator). |
| Program Counter (PC) | Holds the address of the next instruction to execute. |
| Instruction Register (IR) | Stores the current instruction being executed. |
| Bus System | Transfers data and signals between CPU, memory, and devices (Data Bus, Address Bus, Control Bus). |
Summary Table
| Unit | Full Form | Function | Example |
|---|---|---|---|
| ALU | Arithmetic Logic Unit | Performs arithmetic & logical operations | Addition, Comparison |
| CU | Control Unit | Controls and coordinates CPU activities | Fetch–Decode–Execute |
| MU | Memory Unit | Stores data, instructions, and results | RAM, Cache |
| Registers | — | Temporary data storage inside CPU | AX, BX |
| PC | Program Counter | Tracks next instruction | Next step pointer |
Example (Real-Life Analogy)
Imagine a teacher (CU) in a classroom:
- CU (teacher) reads the question (instruction) from the book (memory).
- The teacher asks a student (ALU) to solve it.
- The student (ALU) does the calculation and gives the answer.
- The teacher writes the answer back in the notebook (memory).
This is exactly how your CPU works!
Microprocessor (CPU) Read More »

