Hardware
Hardware
CHAPTER 3
3.1 COMPUTER ARCHITECTURE
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?
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)
- 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
Clock Cycle
A single beat of the system clock
Most CPUs need multiple cycles to complete
an instruction
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