Lecture-3
Lecture-3
ITC/CS/SE-301
Lecture – 3
By
Sir, Amir Ali
Information Technology Center
Sindh Agriculture University, Tandojam
Basic Parts of Computer
Hardware
Software
People
Data
Hardware
Input unit
Output Unit
CPU
Storage
What is Central Processing Unit CPU?
Understanding the Brain of the Computer
The CPU collects all of the raw data from various input devices (such a
keyboard or mouse) and converts it into useful information by carrying
out software instructions.
The result of all that work is then sent to output devices such as
monitors and printers.
Types of CPUs
Key Factors:
• Clock Speed: Measured in GHz (gigahertz), determines how many cycles per
second the CPU can execute.
• Cores: More cores allow for multitasking and faster processing.
• Cache Size: Larger cache improves speed by storing more data close to the
CPU.
• Thermal Design Power (TDP): Indicates heat output and power consumption.
ALU (Arithmetic and Logic Unit)
Functions:
Arithmetic Operations:
Logical Operations:
AND, OR, NOT, XOR, and comparisons (e.g., greater than, less than).
Arithmetic and Logic Unit
Comparison
(greater than, equal
to, or less than)
Arithmetic Logical
(addition, subtraction, (AND, OR,
multiplication, and NOT)
division)
Machine Cycle
The basic operation performed by a CPU to execute an instruction.
It consists of a series of steps required to fetch, decode, and execute an instruction.
2.Decode:
•The fetched instruction is decoded by the Control Unit.
•The CPU determines what operation needs to be performed.
3.Execute:
•The CPU performs the operation using the ALU (Arithmetic Logic Unit) or other components.
•Data may be read from or written to memory during this step.
4.Store (Optional):
•The result of the operation is stored in memory or a register.
Machine Cycle
Key Components Involved:
Cache Memory:
Small, high-speed memory located close to the CPU.
Stores frequently accessed data for faster retrieval.
Levels: L1 (fastest), L2, and L3 (larger but slower).
Memory
Functions of Memory
Importance of Memory
Determines the performance and multitasking capability of a computer.
Allows quick access to data, reducing CPU idle time.
Essential for running applications and storing user data.
Relationship between
3. Facilitate Multitasking:
Allows multiple programs to run simultaneously by storing their data and
instructions.
CPU Register
Registers are the fastest type of memory in a computer, located directly within the
CPU.
They store data, instructions, and addresses that the CPU is currently processing.
1.Temporary Storage:
Hold data and instructions that the CPU is actively using.
2.Speed Optimization:
Provide the CPU with quick access to frequently used data.
3.Instruction Execution:
Store operands, intermediate results, and memory addresses during processing.
4.Control Operations:
Help manage program flow and control tasks (e.g., Program Counter).
Types of CPU Register
1. General-Purpose Registers:
Used for storing data and intermediate results during calculations.
Examples: AX, BX, CX, DX (in x86 architecture).
2. Special-Purpose Registers:
1. Floating-Point Registers: