Ch. 3 Hardware
Computer Architecture and the Central Processing Unit
Central Processing Unit (CPU) Overview:
Responsible for the execution and processing of all instructions and data in a computer system.
Consists of the Control Unit (CU), Arithmetic and Logic Unit (ALU), Registers, and System Buses.
A microprocessor is an integrated circuit (microchip) acting as the CPU, containing the ALU, CU, system clock, and primary memory to interpret and execute all instructions.
Von Neumann Architecture:
Introduced in the mid-1940s as the foundational model for stored-program computers.
Key Features:
Inclusion of a central processing unit (CPU/processor).
Ability of the processor to directly access memory.
Computer memory stores both programs and data simultaneously.
Stored programs consist of instructions executed in a sequential order.

Detailed CPU Components:
Arithmetic and Logic Unit (ALU):
Performs all arithmetic operations (e.g., addition, subtraction) and logical operations (e.g.,
AND,OR).Executes multiplication and division through bit-shifting operators.
Computers may contain more than one ALU.
Control Unit (CU):
Reads instructions directly from primary memory.
Generates electronic control signals during the Fetch-Decode-Execute cycle to coordinate all hardware components.
Synchronises data flow and program instruction execution throughout the system.
Registers:
High-speed memory storage locations internal to the CPU/microprocessor used to store small amounts of data, instruction addresses, or current instructions.
Can be general-purpose or special-purpose.
Current Instruction Register (CIR): Stores the instruction currently being decoded and executed.
Accumulator (ACC): Holds temporary data and results during ALU calculations.
Memory Address Register (MAR): Stores the physical address of the memory location currently being read from or written to.
Memory Data Register / Memory Buffer Register (MDR): Stores data newly read from memory or data waiting to be written to memory.
Program Counter (PC): Stores the address of the next instruction to be fetched from memory.
System Clock:
Generates continuous timing pulses on the control bus to keep all computer functions synchronised.
System Buses:
Conduct parallel data and signal transfer across the system. Bus width typically spans from to .
Address Bus: Unidirectional; carries memory addresses from CPU to memory/peripherals.
Data Bus: Bidirectional; transfers data, instructions, addresses, or numerical values between the CPU, memory, and input/output (I/O) devices.
Control Bus: Bidirectional; carries timing and control signals from the Control Unit to all system components.
The width of the data and address buses directly determines the word length and overall operational performance.
The Fetch-Decode-Execute Cycle and System Performance
Fetch-Decode-Execute (FDE) Cycle Sequence:
Fetch Stage:
The Program Counter (
PC) holds the memory address of the next instruction.This address is copied from the
PCto the Memory Address Register (MAR) via the address bus.The instruction stored at the address contained in the
MARis fetched and copied into the Memory Data Register (MDR) via the data bus.The contents of the
MDRare copied into the Current Instruction Register (CIR).The
PCis incremented by to point to the subsequent instruction address.
Decode Stage:
The instruction held in the
CIRis decoded by the Control Unit so it can be interpreted.
Execute Stage:
The CPU transmits the decoded instruction as a set of control signals to the relevant computer components, executing the instruction in logical sequence.

Factors Affecting CPU Performance:
Clock Speed: Higher clock speeds allow the CPU to complete more instruction cycles per second. Changing clock speeds via the Basic Input/Output System (BIOS) to achieve overclocking can cause overheating and non-synchronised instructions, leading to system crashes.
Bus Width: Broader address and data buses increase data throughput. For instance, a address bus can reference memory locations, whereas a address bus can reference locations.
Cache Memory: High-speed Static RAM (SRAM) integrated into or near the CPU. Holds frequently used data and instructions. Larger cache capacities significantly reduce memory latency and boost performance.
Core Count: A core comprises an individual ALU, CU, and set of registers. Multi-core processors (e.g., quad-core microprocessors containing independent cores) process multiple instructions simultaneously. In a quad-core setup, each core communicates with the remaining three cores via dedicated channels.
Instruction Sets:
An instruction set consists of low-level machine operations decoded and executed sequentially.
Each instruction contains an Opcode and an Operand:
Opcode: Specifies the operation to be performed by the CPU.
Operand: Identifies the data item or the memory/register reference to be acted upon.
Embedded Systems
Definition & Characteristics:
A dedicated hardware and software system constructed to perform a specific, specialized task.
Hardware may comprise electronic, electrical, or electro-mechanical components.
Hardware Classifications:
Microcontroller: Consists of a CPU, RAM, ROM, and peripherals integrated onto a single chip designed for dedicated tasks.
Microprocessor: An integrated circuit containing only a CPU (lacks integrated memory and peripherals).
System on a Chip (SoC): Integrates a CPU, primary/secondary memory, I/O ports, and sometimes a microcontroller onto a single silicon chip.

System Architecture:
Input: Received manually (knobs, buttons, keypads) or automatically (sensors, external systems).
Processing: Hardware and software executing on single, dual, or quad-core microprocessors.
Output: Actuators, motors, screens, or mechanical components.
Trade-Offs of Embedded Systems:
Benefits: Compact physical dimensions; low manufacturing cost; dedicated single-task design eliminating complex operating systems; low power consumption; real-time feedback response; high reliability via mass production; remote control capability via mobile devices.
Drawbacks: Hardware upgrading is difficult or impossible; troubleshooting requires specialists; user interfaces can be unintuitive despite minimal physical controls (e.g., setting a cooker clock); security risks (vulnerability to malware/hacking if connected to the internet); environmental electronic waste caused by discarding intact units when outdated.
Common Applications:
Security systems (sensors for motion, acoustic, and temperature monitoring).
Set-top television boxes (recording/playback via satellite, Wi-Fi, or cable inputs).
Lighting systems (time and occupancy-based light regulation).
Vending machines (item selection, coin validation, temperature control, tilt detection).
Washing machines (wash cycle selection via keypad).
Automotive units (Anti-lock Braking Systems (ABS), Global Positioning Systems (GPS), fuel injection, in-car entertainment).
Input Devices
Barcode Readers:
Barcodes represent numbers to using parallel light and dark lines of varying thickness.
Scanned using a red laser or red LED. Reflected light is captured by photoelectric sensors, converting the pattern into a digital binary sequence (e.g., LDDDDLD translates to ).
Acts as a unique key field in product databases to retrieve pricing and inventory details.
Management Advantages: Instant price updating across databases; real-time sales reporting; eliminates individual shelf pricing; automated inventory control; tracking customer habits via loyalty programs.
Customer Advantages: Accelerated checkout lines; reduced pricing errors; itemised receipts; fresher food due to automated expiration date tracking.
Quick Response (QR) Codes:
Two-dimensional matrix of dark squares arranged on a light background holding up to numeric digits or alphanumeric characters.
Includes three large corner alignment squares.
Decoding Process: Camera captures QR image -> App processes image -> Browser automatically interprets data and navigates to embedded URLs.
Advantages over Barcodes: Holds vastly more data; built-in error checking and redundancy allow reading of damaged codes; read by standard smartphone/tablet cameras without laser scanners; easily transmitted via SMS or image; supports encryption.
Disadvantages over Barcodes: Multiple competing formats exist; vulnerable to malicious code injection (attagging).
Digital Cameras:
Images are focused through lenses onto Charge-Coupled Devices (CCD) containing photodiodes, converting light into pixels arranged in an electronic matrix.
Controlled by microprocessors managing focus, aperture, shutter speed, flash, and red-eye reduction.
Data transfers via USB, Bluetooth, or SD card readers.
Keyboards:
Physical or virtual input devices converting key presses into ASCII binary codes.
Relatively slow input speed, prone to manual entry errors, and presents health risks like Repetitive Strain Injury (RSI).
Microphones:
Convert sound waves into electric signals of varying amplitude via a diaphragm attached to a copper coil moving around a magnet.
Analog signals are converted to digital data using an Analog-to-Digital Converter (ADC).
Optical Mouse:
Pointing device utilising tiny cameras and a red LED light source to calculate positional movement over any surface.
Advantages over Mechanical Mouse: No moving parts to wear out; immune to dirt build-up; requires no specialized driver software.
Wired USB vs. Wireless Mouse: Wired connections eliminate signal loss, require no batteries, and reduce e-waste disposal.
2D and 3D Scanners:
2D Scanners: Convert flat paper documents into digital images (PDF, uncompressed TIFF, or compressed JPEG). Optical Character Recognition (OCR) software extracts raw text for word processing. Applied in airport passport control and facial recognition.
3D Scanners: Use lasers, X-rays, white light, or magnetic resonance to scan solid objects into Computer-Aided Design (CAD) models or for 3D printing. Tomography creates 3D digital objects by capturing thin cross-sectional slices.

Touchscreen Technologies:
Capacitive:
Mechanism: Uses surface or projective capacitive layers where bare finger touches alter the electrostatic field and current flow.
Features: Projective capacitive supports multi-touch (pinching/sliding); high screen clarity; durable scratch tolerance.
Limitations: Sensitive to strong electromagnetic fields or microwaves; requires bare fingers or specialized capacitive styluses.
Infrared:
Mechanism: Employs a glass screen bounded by infrared LEDs and sensors. Finger touches break the grid of invisible light beams, signaling touch coordinates.
Features: Supports multi-touch; highly durable and operational even if cracked or scratched.
Limitations: Sensitive to surface moisture and ambient light interference.
Resistive:
Mechanism: Consists of a flexible top polymer layer and a bottom glass layer separated by a gap with applied voltage. Physical pressure forces the layers together, completing a circuit.
Features: Low cost; resistant to dust and water exposure; operates with any stylus or gloved finger.
Limitations: Low sensitivity; lacks multi-touch; highly susceptible to surface scratching and cracking.
Output Devices
Actuators:
Electromechanical control components (relays, solenoids, electric motors) that convert microprocessor digital command signals into physical movement (e.g., opening valves, starting conveyor belts).

Light Projectors:
Digital Light Processing (DLP):
Uses a Digital Micromirror Device (DMD) chip packed with millions of micro-mirrors that tilt according to data. Mirrored reflections create a greyscale image ( grey levels) which becomes full-colour after passing light through a high-speed RGB colour wheel.
Pros: Higher contrast ratios; long-term component reliability; silent operation; lightweight/compact; single-chip alignment eliminates colour fringing; resistant to dusty environments.
Cons: Moving images can display motion artifacts ("shadows/rainbow effect"); lower colour saturation compared to LCD.
Liquid Crystal Display (LCD) Projectors:
A high-intensity light beam hits dichroic mirrors, splitting light into red, green, and blue components. Three separate monochrome images are formed on LCD panels and recombined through a glass prism to project an enlarged image.
Pros: Sharper images; superior colour saturation; energy-efficient with low thermal output.
Cons: Lower contrast ratios; organic LCD panels degrade over time (yellowing effect); shorter overall operating lifespan.
Printers & 3D Printing:
Inkjet Printers: Spray liquid ink droplets via thermal bubble or piezoelectric print heads onto paper. Paper moves line-by-line via stepper motors. Ideal for low-volume, high-quality colour output (modern units use continuous ink reservoirs to extend print runs).
Laser Printers: Use dry powdered ink (toner). A laser beam charges a photosensitive drum negatively in the shape of text/images. Positively charged toner adheres to charged drum areas and fuses onto paper under heat and pressure in a single pass. Designed for high-volume text/document printing.
3D Printers: Additive manufacturing technology that constructs physical objects layer-by-layer (layers typically thick) from CAD models. Uses resin, metal powder, paper, or ceramic mediums.
Direct 3D Printing: Print head travels along X, Y, and Z axes ejecting build material.
Binder 3D Printing: Alternates passes: the first deposits dry powder, and the second applies a liquid binder.
Applications: Prosthetic limbs, reconstructive surgery, aerospace components, fashion, art replication, and obsolete vehicle spare parts.
Display Screens:
LED Screens: Formed of arrays of tiny Red, Green, and Blue light-emitting diodes. Brightness is regulated electronically to produce millions of colours. Used in large outdoor billboards and stadium scoreboards.
LCD Screens: Formed of liquid crystal matrices backlit by LEDs. LED backlights provide instant maximum brightness, pure white balance, long operational lifespans, and low power consumption.
OLED Screens: Self-emissive organic layers that emit their own light, eliminating backlights entirely. Allows ultra-thin flexible screens (), true black levels, vivid contrast, and low power usage.
Speakers:
Digital audio signals pass through a Digital-to-Analog Converter (DAC) to generate varying electrical currents. Currents pass through a copper coil wrapped around an iron core attached to a paper/plastic cone, producing sound vibrations.
Sensors and Process Control Systems
Sensor Fundamentals:
Sensors are input devices that measure physical properties of their environment and output continuous analog voltage signals.
Signals are converted into binary format using an Analog-to-Digital Converter (ADC) before being read by a microprocessor.
Monitoring vs. Control Systems:
Monitoring System: The microprocessor reads sensor data, converts it via ADC, and compares values against pre-set threshold parameters stored in memory. If parameters are exceeded, screen alerts or audible alarms trigger. The system does not alter the physical process.
Control System: The microprocessor continuously compares sensor readings to set parameters. If values drift out of range, command signals pass through a Digital-to-Analog Converter (DAC) to operate actuators (heaters, pumps, valves), restoring process parameters within limits. This process represents a continuous feedback loop.
Comprehensive Sensor Reference Table:
Sensor Type | Operating Principle | Application Examples |
|---|---|---|
Temperature | Measures ambient thermal energy via electrical resistance changes | Central heating control, chemical processes, greenhouse climate control |
Moisture | Measures water content in solids based on electrical resistance | Agriculture soil testing, food processing quality control |
Humidity | Measures water vapour concentration in air based on electrical conductivity | Microchip fabrication cleanrooms, building HVAC systems, greenhouses |
Light | Photoelectric cells output electric current proportional to light intensity | Automatic street lighting, automated car headlamps |
Infrared (Active) | Emits an infrared beam to an optical detector; beam breakage alters signal | Rain-sensing windshield wipers, intruder security alarms |
Infrared (Passive) | Measures thermal infrared radiation emitted by objects | Motion detectors (body heat), industrial freezer monitoring |
Pressure | Transducer generating variable current proportional to applied force | Vehicle weighbridges, nuclear reactor gas monitoring |
Acoustic / Sound | Microphones converting sound wave pressure into electrical pulses | Intruder footstep detection, acoustic pipe leak detection |
Gas | Electrochemical cells detecting specific gas concentrations () | Airport air pollution monitoring, greenhouse gas balancing, exhaust emissions |
pH | Measures voltage differences across solutions to evaluate acidity/alkalinity | Soil acidity monitoring, chemical process regulation |
Magnetic Field | Measures magnetic field strength and vector variations | Smartphone digital compasses, anti-lock braking systems (ABS) |
Accelerometer | Piezoelectric cells generating voltage based on dynamic acceleration/deceleration | Airbag deployment in car crashes, smartphone screen orientation switching |
Proximity | Detects physical presence of nearby objects without physical contact | Disabling smartphone touchscreens when held to the ear |
Flow (Rate) | Measures physical movement velocity of liquids or gases | Medical inhalers/respirators, natural gas pipelines |
Level | Uses ultrasonics or capacitance to measure static liquid or solid height | Fuel tank gauging, pharmaceutical tablet powder levels, AC refrigerant leak detection |
Data Storage and Memory Architecture
Primary Memory vs. Secondary Storage:
Primary Memory (RAM & ROM): Directly addressable by the CPU. Fast access times, compact capacity, high cost per GiB. Typical sizes: ROM (), RAM ().
Secondary Storage: Non-volatile storage not directly addressable by the CPU. Data must be transferred into RAM before processing. Large capacity (), lower cost per GiB.
Primary Memory Breakdown:
Feature | Random Access Memory (RAM) | Read-Only Memory (ROM) |
|---|---|---|
Volatility | Volatile (data lost when powered off) | Non-volatile (retains data without power) |
Read/Write | Read and write capabilities | Read-only memory |
Contents | Active data, open applications, operating system components | BIOS, firmware, computer start-up routines |
Permanence | Temporary storage area | Permanent storage area |
Types of RAM:
Dynamic RAM (DRAM): Consists of transistors and capacitors. Capacitors leak charge and require continuous refreshing cycles. Inexpensive, high capacity; used for main system memory.
Static RAM (SRAM): Uses transistor flip-flops to hold bits. Requires no refreshing, delivers fast access times; used for CPU Cache memory.
Secondary Storage Technologies:
Magnetic Storage (Hard Disk Drives - HDD):
Data is stored magnetically on spinning aluminium/glass platters ().
Electromagnetic read/write heads float micrometres above surfaces. Data is organised into concentric tracks and sectors.
Latency: The time taken for the requested sector to rotate under the read/write head. Excessive file fragmentation increases latency.
Solid-State Storage (SSD, Flash Memory, SD Cards):
Operates with no moving parts using NAND or NOR logic flash memory chips. At each junction of a solid-state NAND matrix, a floating gate transistor and a control gate transistor store electrical charges representing binary or .
Applying voltage traps electrons behind a dielectric insulating barrier in the floating gate.
Advantages over HDD: Fast data access; silent; low power consumption; light weight; high shock resistance; runs cool.
Disadvantages over HDD: Limited read/write endurance cycles; damaged controller or memory chips cause total unrecoverable data loss.
Optical Storage:
Media Type | Laser Wavelength | Layer Construction | Track Pitch |
|---|---|---|---|
CD | Red () | Single polycarbonate layer | |
DVD (Dual Layer) | Red () | Two polycarbonate layers | $$0.74\,\mu |