🖥️
3.1 Computer Architecture
Index
🗺️ Navigation
Index
Central Processing Unit
Components of a CPU
🧮 Arithmetic & Logic Unit (ALU)
🧠 Control Unit (CU)
💾 RAM (Immediate Access Store)
🧠 Registers
💾 Memory in the von Neumann Model
🔍 Example – Read Operation:
📝 Example – Write Operation:
🔁 System Buses
📍 Address Bus
🔁 Data Bus
🔧 Control Bus
🔄 Fetch–Decode–Execute Cycle (FDE Cycle)
🧲 Fetch
🧠 Decode
⚙️ Execute
⚙️ CPU Performance Factors: Cores, Cache & Clock Speed
🕒 System Clock
⚠️ Overclocking
🧠 Cache Memory
🧩 CPU Cores
🧾 Instruction set
🔧 Embedded Systems
🧩 Types of Embedded Hardware
⚙️ How They Work
🔄 Programmability
✅ Benefits of Embedded Systems
❌ Drawbacks of Embedded Systems
🚗 Common Applications of Embedded Systems
Central Processing Unit
The CPU processes instructions and data that are input into the computer so that the result can be output. A
microprocessor is an integrated circuit that contains a CPU on a single chip, handling all processing tasks in a system.
Early computers couldn’t store programs or data, so they needed constant human input. In the 1940s, John von Neumann
introduced the stored program concept, forming the basis of modern computers. The von Neumann architecture
included:
A CPU to process data
Memory that stores both programs and data
Programs made of instructions that run in sequence
The CPU can directly access memory
This allowed computers to run more independently and efficiently.
3.1 Computer Architecture 1
Components of a CPU
🧮 Arithmetic & Logic Unit (ALU)
The ALU performs arithmetic operations (such as addition, subtraction, and shifting) and logic operations (like AND, OR)
while a program is running. Some computers may have multiple ALUs for specialized tasks. Complex operations like
multiplication and division are done using sequences of addition, subtraction, and left/right logical shifts.
🧠 Control Unit (CU)
The CU is responsible for fetching and interpreting instructions from memory. It uses the Program Counter (PC) to locate
the instruction's address. The instruction is processed using the Fetch–Decode–Execute cycle. During this cycle, the CU
sends control signals via the control bus to coordinate the activities of other components.
The CU also ensures synchronisation of data and instructions across the system. This is supported by the system clock,
which sends regular timing signals. Without this clock, the computer would not function reliably.
💾 RAM (Immediate Access Store)
RAM stores the data and programs that the CPU needs during operation. It is also called the Immediate Access Store
(IAS). The CPU transfers data and programs from backing storage (like a hard drive) into RAM temporarily because RAM
is much faster. Keeping important data in RAM speeds up processing significantly during program execution.
🧠 Registers
Registers are small, high-speed memory units within the CPU. In the von Neumann architecture, we focus on special-
purpose registers which play a key role in processing instructions.
💾 Memory in the von Neumann Model
Memory is divided into partitions, each with a unique address and stored content. The CPU interacts with memory using
MAR and MDR.
🔍 Example – Read Operation:
The address (e.g., 1111 0001 ) is placed in MAR
A read signal is sent
The content at that address (e.g., 0101 1011 ) is loaded into MDR
📝 Example – Write Operation:
The data (e.g., 1001 0101 ) is placed into MDR
The target address (e.g., 1111 1101 ) is placed in MAR
A write signal stores the data into that memory location
🔁 System Buses
Buses are used for transferring data and signals within the computer. They use parallel transmission, where each wire
carries 1 bit.
3.1 Computer Architecture 2
📍 Address Bus
Carries memory addresses from CPU to memory
Unidirectional: only sends addresses one way (CPU → memory)
Wider buses can address more memory locations
16-bit → 65,536 locations
32-bit → 4.3 billion locations
🔁 Data Bus
Bidirectional: transfers data to and from CPU, memory, and I/O
Can carry instructions, values, or addresses
Bus width affects how many bits (word size) can be transferred at once
Larger word sizes (e.g., 32-bit, 64-bit) improve performance
🔧 Control Bus
Bidirectional: carries control signals from the Control Unit (CU) to other components
Typically 8 bits wide – enough for common control signals
Ensures coordination and timing between components
🔄Cycle)
Fetch–Decode–Execute Cycle (FDE
The FDE cycle is the process the CPU follows to run instructions. It involves three
main steps: fetch, decode, and execute. This cycle repeats continuously while
the computer is on.
🧲 Fetch
The Program Counter (PC) holds the address of the next instruction.
This address is sent to MAR, and the instruction at that location is fetched
from memory.
The instruction is loaded into the MDR and then copied to the Current
Instruction Register (CIR).
The PC is incremented (increased by 1) to point to the next instruction.
🧠 Decode
The instruction in the CIR is analyzed and interpreted.
The CPU determines what needs to be done (e.g., calculation, memory
access, data transfer).
⚙️ Execute
The CPU sends control signals to the relevant components (ALU, memory,
I/O, etc.) to carry out the instruction.
The action is completed, and the cycle repeats with the next instruction.
⚙️ CPU Performance Factors: Cores, Cache & Clock Speed
3.1 Computer Architecture 3
The performance of a CPU depends on several key factors, including the system clock, cache memory, and the number
of cores.
🕒 System Clock
The system clock controls the timing of all CPU operations by generating regular signals.
A clock cycle is one unit of time in which an instruction can be fetched, decoded, or executed.
Clock speed is measured in Hertz (Hz). A typical modern CPU may run at 3.5 GHz, meaning 3.5 billion cycles per
second.
Increasing clock speed can increase processing speed, but it doesn’t always guarantee better overall performance.
⚠️ Overclocking
Overclocking involves manually increasing the clock speed via BIOS settings.
Risks include:
1. Instruction errors due to timing mismatches
2. Overheating, leading to crashes or hardware damage
🧠 Cache Memory
Cache is a small, fast memory located inside the CPU. It stores frequently used instructions/data, allowing faster
access than RAM.
While looking for data/instructions, the CPU checks the cache first before accessing RAM.
A larger cache generally leads to better CPU performance.
🧩 CPU Cores
A core is a processing unit within the CPU that contains its own ALU, control unit, and registers.
Modern CPUs are often dual-core, quad-core, or more.
More cores allow multiple tasks (threads) to be processed simultaneously, improving performance.
However:
Performance gain isn’t linear (e.g. 4 cores ≠ 4× speed) due to communication overhead between cores and the CPU.
🧾 Summary of CPU Performance Factors:
Wider data/address buses = faster access to memory locations
Higher clock speed = faster instruction cycles (with caution)
More cores = better multitasking (up to a limit)
Larger/faster cache = quicker access to commonly used data
All these factors must be considered together to evaluate a computer’s true processing capability.
🧾 Instruction set
In a computer system, instructions are operations that the CPU processes in sequence during the Fetch–Decode–Execute
cycle. Each instruction tells the Arithmetic Logic Unit (ALU) and Control Unit (CU) what to do.
An instruction is made up of:
Opcode – the operation to perform (e.g. ADD, JMP)
Operand – the data or address involved in the operation
3.1 Computer Architecture 4
The set of all opcodes a CPU understands is called its instruction set. Since the CPU must recognize each operation, there
is a limited number of opcodes available.
🚧 Don’t confuse instruction sets with programming languages like Python or Java. Program code must be
compiled or interpreted into low-level machine instructions (opcodes) that the CPU can execute.
Instruction sets are the
CPU’s native language, and they allow all software to interact directly with hardware.
🔧 Embedded Systems
An embedded system combines dedicated hardware and software to perform a specific function within a larger device.
Unlike general-purpose computers, embedded systems are optimized for one task.
🧩 Types of Embedded Hardware
Microcontroller: A single chip containing a CPU, RAM, ROM, and I/O peripherals—ideal for simple, self-contained
tasks.
Microprocessor: A CPU-only chip; requires external RAM, ROM, and peripherals.
System on Chip (SoC): Integrates a microprocessor/microcontroller plus memory, I/O ports, and sometimes secondary
storage on one chip—used in smartphones, tablets, and advanced appliances.
⚙️ How They Work
1. Inputs can be:
Manual (keypad, dial)
Automatic (analogue/digital sensors for temperature, pressure, light, etc.)
2. Processing happens on the embedded CPU/microcontroller, often in real time.
3. Outputs drive actuators or signals (e.g. heating elements, motors, displays, alarms).
Many systems operate in a feedback loop, continuously reading inputs and adjusting outputs.
🔄 Programmability
Non-programmable devices: Built-in firmware; must be replaced for upgrades.
Programmable devices: Can receive updates via:
Direct connection to a computer (e.g. GPS map updates)
Over-the-air links (Wi-Fi, satellite, cellular)
✅ Benefits of Embedded Systems ❌ Drawbacks of Embedded Systems
Compact size – easy to fit into small or complex Hard to upgrade – many are non-programmable and
devices require full replacement
Low cost – cheaper to manufacture than general- Specialist troubleshooting – diagnosing issues often
purpose systems requires expert knowledge
Efficient – designed for one task, so no need for User interface can be confusing – simple controls may
complex operating systems hide complex functions
Low power consumption – ideal for battery-operated Security risks – internet-connected devices are
or always-on devices vulnerable to hacking or malware
Remote control – many can be managed via Limited lifespan – difficult repairs and upgrades lead to
smartphones or the internet more waste (throw-away culture)
Real-time performance – respond quickly to changes Outdated quickly – fast tech evolution means many
(e.g. sensors, feedback loops) devices become obsolete sooner
3.1 Computer Architecture 5
Reliable with mass production – consistent
performance across thousands of units
🚗 Common Applications of Embedded Systems
1. Automotive Systems
Modern vehicles rely heavily on embedded systems for:
Engine management systems (e.g. adjusting fuel-air mixture)
Anti-lock braking systems (ABS)
Airbags and vehicle safety systems
In-car entertainment, GPS navigation, and climate control
Sensor-based monitoring (e.g. tire pressure, fuel injection, exhaust emissions)
2. Home Appliances
Washing machines, microwaves, refrigerators, and ovens use embedded systems to:
Set and control cycles (e.g. wash time, temperature)
Monitor internal sensors (e.g. temperature or humidity)
Enable remote control using a smartphone or smart home hub
3. Entertainment Devices
Set-top boxes process input from remote controls, decode signals from satellite or cable, and control
recording/playback on storage devices like SSDs.
4. Security Systems
Used in alarm systems for:
Sensor monitoring (e.g. temperature, motion, acoustic signals)
Keypad input and output control (e.g. sirens, lights)
Remote alerts via mobile devices
5. Lighting Control
Embedded systems manage indoor and outdoor lighting based on:
Time of day or week
Room occupancy
Brightness of natural light
Used in offices, public spaces, fountains, or buildings for displays and energy saving.
6. Vending Machines
Embedded systems handle:
User inputs via keypads
Money verification and stock tracking
Motor control for item dispensing
Real-time updates sent to the supplier for restocking or sales tracking
7. Medical and Industrial Equipment
Embedded systems are used in medical imaging devices, patient monitors, factory robots, and sensor-driven
machinery to ensure precision and safety.
3.1 Computer Architecture 6