0% found this document useful (0 votes)
14 views28 pages

Hardware

The document provides an overview of computer architecture, focusing on the Central Processing Unit (CPU) and its components, including the Arithmetic and Logic Unit (ALU), Control Unit (CU), and registers. It explains how data moves through the CPU using buses and the fetch-decode-execute cycle, as well as the significance of cache memory and system clock in enhancing performance. Additionally, it discusses the concept of cores in CPUs, instruction sets, and the implications of overclocking.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views28 pages

Hardware

The document provides an overview of computer architecture, focusing on the Central Processing Unit (CPU) and its components, including the Arithmetic and Logic Unit (ALU), Control Unit (CU), and registers. It explains how data moves through the CPU using buses and the fetch-decode-execute cycle, as well as the significance of cache memory and system clock in enhancing performance. Additionally, it discusses the concept of cores in CPUs, instruction sets, and the implications of overclocking.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 28

HARDWARE

CHAPTER 3
3.1 COMPUTER ARCHITECTURE

Computer Architecture: Central Processing


Unit (CPU)

What is the CPU?


• Central Processing Unit (CPU) is the brain of
the computer.
• It performs all the essential processing tasks of
the computer.
• It interprets and executes instructions from
programs (software) and coordinates all the
Parts of the CPU
The CPU is divided into three main parts:
1. Arithmetic and Logic Unit (ALU):
Responsible for performing arithmetic calculations (like addition,
subtraction) and logical operations (such as comparisons).
Performs basic operations on the data received.
2. Control Unit (CU):
Controls the flow of data between the CPU and other parts of the
computer.
It fetches, decodes, and executes instructions from the memory.
3. Registers:
Small, high-speed storage locations in the CPU used to store data
temporarily.
Types of registers:
Program Counter (PC): Holds the address of the next
instruction.
Registers
Registers are small, high-speed storage locations within
the CPU (Central Processing Unit). They temporarily store
data that the CPU needs to process while it's working on
instructions. Registers help the CPU run faster because
they allow it to quickly access data without needing to go
all the way to memory every time.

Types of Registers:
1. Program Counter (PC):
The Program Counter (PC) holds the address of the
next instruction that the CPU will execute.
It helps the CPU keep track of where it is in a program,
and when it finishes one instruction, it moves to the
Buses
Buses are communication pathways that carry data
between different parts of the computer. There are three
main types of buses in a Von Neumann Architecture that
help the CPU interact with memory and other components:
1. Address Bus:
The Address Bus carries the address of the data or
instructions that the CPU wants to access in memory.
It is a one-way bus, meaning that it only sends
addresses from the CPU to memory.
When the Program Counter (PC) has the address of
the next instruction, it sends that address via the
Address Bus to memory.
Buses
2. Data Bus:
The Data Bus carries the actual data or instructions
between the CPU, memory, and input/output devices.
The data can flow in both directions, meaning it can carry
data to and from memory and other components.
For example, when the CPU wants to fetch an instruction,
it uses the Data Bus to bring it from memory into the
CPU’s Current Instruction Register (CIR).
3. Control Bus:
The Control Bus carries control signals that tell the
different parts of the computer what to do.
It controls actions like whether the CPU should read data
from memory, write data to memory, or perform other
tasks.
These control signals ensure that the CPU, memory, and
How Registers and Buses Work Together?

The Program Counter (PC) sends the address of the next


instruction to memory using the Address Bus.
The Data Bus then carries the actual instruction from
memory to the Current Instruction Register (CIR) in the
CPU.
The Control Bus sends signals telling the CPU whether to
fetch, decode, or execute an instruction.
If the instruction involves a calculation, the ALU performs
the operation, and the result is stored in the Accumulator
(ACC).
Data being processed moves between the CPU's Data
Registers, ALU, and Accumulator using the Data Bus.
What is Von Neumann Architecture?
It is a computer architecture model where data and program
instructions are stored in the same memory.
1. Memory Components
These are parts of memory that help store or fetch data and
instructions.
Program Counter (PC):
Keeps track of the address of the next instruction to be
executed.
Memory Address Register (MAR):
Holds the address in memory where the computer needs to read
or write data.
Memory Data Register (MDR):
Temporarily stores the data that is either being fetched from or
sent to the memory.
Current Instruction Register (CIR):
2. CPU Components
Control Unit (CU):
The manager of the CPU. It controls the flow of data
between all components and sends control signals.
Arithmetic and Logic Unit (ALU):
Performs mathematical (addition, subtraction) and
logical (AND, OR) operations.
Accumulator (ACC):
Temporarily holds the results of calculations done by the
ALU.
3. System Clock:
It sends regular timing pulses to control how fast
instructions are processed.
How Data Moves (The Cycle):
Let’s make it simple by using a fetch-decode-execute
cycle:
Fetch:
The PC sends the memory address to the MAR.
The MAR uses the address bus to fetch the
instruction.
The instruction is brought into the MDR through the
data bus.
It is then moved to the CIR.
Decode:
The Control Unit (CU) reads the CIR and figures out
what the instruction means.
Execute:
If it’s a math/logic instruction, it goes to the ALU.
The Buses:
These are like roads connecting the components:

Address Bus:
Carries memory addresses from the CPU to memory.

Data Bus:
Carries data between the CPU and memory.

Control Bus:
Carries control signals to manage the actions of
different parts.
Step-by-Step Flow:
• When the program starts, PC is set to the address of
the first instruction (usually 0x0000).
• The CPU reads this address from PC and sends it via
the Address Bus to memory.
• Memory sends the instruction at that address back to
the CPU via the Data Bus.
• That instruction goes into the Current Instruction
Register (CIR).
• The CPU executes the instruction.
• Meanwhile, the PC increments to point to the address
of the next instruction.
So the next instruction also comes from memory,
but the Program Counter just keeps track of where
Von Neumann Cycle (Fetch–Decode–Execute)

Step 1: Program is Loaded into Memory


When a program is run, it is loaded from storage (like
a hard drive) into main memory (RAM).
Instructions and data of the program now live in
memory, each at a specific address.

Step 2: Program Counter (PC) starts the process


PC is inside the CPU, and it always holds the address
of the next instruction to fetch.
Step 3: Fetching the Instruction
Here’s what happens during the Fetch phase:
• 3.1 – PC → MAR
The address from Program Counter goes into MAR
(Memory Address Register).
MAR holds the address of the instruction to be fetched
from memory.
• 3.2 – MAR → Address Bus
The address from MAR is sent to memory using the
Address Bus (one-way bus: CPU → Memory).
• 3.3 – Memory → MDR
The instruction/data at that address in memory is sent
back via Data Bus and stored in MDR (Memory Data
Register).
• 3.4 – MDR → CIR
The instruction in MDR is sent to CIR (Current
Instruction Register) where it is held for decoding.
• 3.5 – PC is incremented
PC is increased by 1 (or by the size of the instruction),
pointing to the next instruction.
Step 4: Decoding the Instruction
The Control Unit (CU) inside the CPU decodes the
instruction from the CIR.
It figures out:
What operation is required? (e.g. Add, Move, Jump)
What data is needed?
Where should the result go?
Step 5: Executing the Instruction
If it's an arithmetic operation, the data is sent to the ALU
(Arithmetic Logic Unit).
The result is often stored in the Accumulator (ACC).
If it’s a jump or memory operation, the PC or MAR/MDR are
updated again.
What Do the Buses Do?

Bus Name Direction Role


One-way (CPU → Sends the address of
Address Bus
Memory) the data/instruction
Two-way (CPU ⇄ Transfers actual
Data Bus
Memory) data/instructions
Sends control signals
Control Bus One-way or Two-way (like Read, Write,
Clock, etc.)
How Registers help?
Inside
Register Role
CPU?
Holds address of next
PC (Program Counter) ✅
instruction
MAR (Memory Address
✅ Sends address to memory
Register)
MDR (Memory Data Transfers data between CPU &

Register) memory
CIR (Current
✅ Holds instruction to decode
Instruction Register)
Temporarily holds result from
ACC (Accumulator) ✅
ALU
ALU (Arithmetic Logic
✅ Does calculations or logic
Unit)
SUMMARY:

When we run a program, it is stored in memory. The


CPU uses the Program Counter to find the next
instruction. It sends the address to memory using the
Address Bus. The instruction comes back via the Data
Bus and goes through the CPU's internal registers for
decoding and execution. This cycle keeps repeating
until the program finishes.
What is a Core?
A core is like a mini processor inside your computer's main
processor (CPU). It processes instructions.
More cores = your computer can do more tasks at the
same time (multitasking).
Each core works on different instructions or parts of a
program.

- Dual-Core
A CPU with 2 cores
Can do two things at once (e.g., browsing and
downloading)

- Quad-Core
A CPU with 4 cores
Better for heavier tasks like gaming, video editing, etc.
2. What is Cache?
Cache is a small memory inside or close to the CPU
Stores frequently used data and instructions
Much faster than RAM
Think of it as a shortcut drawer, if the CPU needs the same
data again, it doesn’t go to RAM, it grabs it instantly from
the cache

Internal Clock (System Clock)


The internal/system clock controls how fast instructions
are carried out in a computer.
• It sends out a pulse or tick many times per second
• Each tick is a clock cycle
1 GHz clock = 1 billion ticks (cycles) per second
Higher clock speed = more instructions per second
2. What is Cache?
Cache is a small memory inside or close to the CPU
Stores frequently used data and instructions
Much faster than RAM
Think of it as a shortcut drawer, if the CPU needs the same
data again, it doesn’t go to RAM, it grabs it instantly from
the cache

Internal Clock (System Clock)


The internal/system clock controls how fast instructions
are carried out in a computer.
• It sends out a pulse or tick many times per second
• Each tick is a clock cycle
1 GHz clock = 1 billion ticks (cycles) per second
Higher clock speed = more instructions per second
Overclocking
Making the core run faster than its normal
speed
Can improve performance, but:
Generates more heat
May reduce lifespan of the CPU if not
cooled properly

Clock Cycle
A single beat of the system clock
Most CPUs need multiple cycles to complete
an instruction

BIOS = The Wake-Up Call


You can go into the computer's BIOS settings and increase the CPU's clock
Term Meaning

First program that runs – checks hardware


BIOS
and starts OS

Making the CPU run faster than usual (with


Overclocking
risks)
One tick of the clock – how fast tasks are
Clock Cycle
timed
System Clock Sends timing signals to control CPU speed

Small, fast memory close to CPU to speed


Cache
up tasks
Dual/Quad Core Multiple cores = more multitasking

Core The part of the CPU that processes data


What is an Instruction Set?
An instruction set is a list of commands that a CPU
understands and can carry out.

A CPU instruction usually has two main parts:


1. Opcode (Operation Code)
This tells the CPU what action to perform
(e.g., ADD, LOAD, STORE, JUMP)

2. Operand
This tells the CPU what data to use or where to
find it
(e.g., a number, memory address, or register)
[ Start (Power On) ]

[ BIOS Runs ]
- Checks hardware
- Loads Operating System

[ System Clock Starts ]
- Sends pulses (clock cycles)

[ CPU Cores Begin Working ]
- Process tasks/instructions
- Multitask if multi-core

[ Cache Memory Supports CPU ]
- Feeds commonly used data quicklyz

[ Optional: Overclocking ]
- Cores run faster (risk of overheating)

[ Smooth Running Computer ]
- Tasks are done quickly
- User gets fast response

You might also like