Hardware
Computer components, memory types, storage devices, embedded systems, logic gates and circuits — how the physical machine works.
3.1 Computers and Their Components
The Four Core Needs
Every computer system needs four fundamental elements:
| Need | Purpose | Examples |
|---|---|---|
| Input | Receive data from outside world | Keyboard, mouse, microphone, touchscreen, camera |
| Output | Send processed results to outside world | Monitor, speakers, printer, projector |
| Primary Memory | Fast temporary working storage for CPU | RAM, ROM, cache |
| Secondary Storage | Permanent non-volatile storage | HDD, SSD, optical disc, USB flash drive |
Hardware Devices
| Device | Type | How It Works |
|---|---|---|
| Laser Printer | Output | Laser charges drum, toner sticks to charged areas, heat fuses to paper |
| 3D Printer | Output | Builds objects layer-by-layer from digital model (additive manufacturing) |
| Microphone | Input | Sound waves vibrate diaphragm → electrical signal → digitised by ADC |
| Speakers | Output | DAC converts digital signal → electrical → vibrates diaphragm → sound |
| Magnetic HDD | Secondary Storage | Spinning magnetic platters; read/write head magnetises sectors |
| Solid State (SSD/Flash) | Secondary Storage | NAND flash memory cells; no moving parts; faster, quieter, more durable |
| Optical Disc | Secondary Storage | Laser reads/writes pits and lands on reflective disc surface |
| Touchscreen | Input/Output | Capacitive: detects electrical change when finger touches; or resistive pressure-based |
| VR Headset | Input/Output | Displays stereoscopic images; motion sensors track head movement |
A buffer is a temporary storage area (usually RAM) that holds data while it is being transferred between two devices operating at different speeds. Example: a print buffer holds print jobs while the printer (slow) processes them, freeing the CPU (fast) to continue working.
Embedded Systems
An embedded system is a dedicated computer system built into a larger device, designed to perform one specific function. It typically has fixed programs stored in ROM.
Benefits of Embedded Systems
- Optimised for single task → very efficient
- Low power consumption
- Low cost (mass production)
- Small physical size
- Very reliable (simple, fixed program)
Drawbacks of Embedded Systems
- Cannot be reprogrammed for other tasks
- Limited upgradability
- If hardware fails, whole device replaced
- Bugs are hard to patch (fixed ROM)
Examples: Washing machine controller, car ABS system, ATM, pacemaker, microwave oven, router firmware.
Memory Types
RAM — Random Access Memory
- Volatile (data lost when power off)
- Read and write access
- Stores current programs and data
- Directly accessible by CPU
- More RAM → better multitasking
ROM — Read Only Memory
- Non-volatile (retains data without power)
- Read only (cannot be written normally)
- Stores firmware / BIOS
- Used in embedded systems
- Contents fixed at manufacture
| Memory Type | Speed | Cost | Use | Characteristics |
|---|---|---|---|---|
| SRAM (Static) | Very fast | Expensive | Cache memory | Uses flip-flops; no refresh needed; retains data while powered |
| DRAM (Dynamic) | Slower than SRAM | Cheaper | Main RAM (system) | Uses capacitors; needs constant refresh; denser packing |
ROM Variants
| Type | Full Name | Programmable? | Erasable? |
|---|---|---|---|
| ROM | Read Only Memory | At manufacture only | No |
| PROM | Programmable ROM | Once by user | No |
| EPROM | Erasable Programmable ROM | Yes | UV light only |
| EEPROM | Electrically Erasable Programmable ROM | Yes | Electrically (byte by byte) |
Monitoring and Control Systems
Monitoring System
- Reads sensor data and records it
- Does NOT take automatic action
- Alerts a human if threshold exceeded
- Example: weather station, ECG monitor
Control System
- Reads sensor data AND acts on it
- Takes automatic action via actuators
- Uses feedback loop
- Example: thermostat, greenhouse, ABS brakes
Sensors measure physical properties (temperature, pressure, IR, sound) → data sent to microprocessor → microprocessor compares with target value → if different, sends signal to actuators (motors, valves, heaters) to correct → loop repeats. This is called a closed-loop control system.
3.2 Logic Gates and Logic Circuits
The Six Logic Gates
| Gate | Symbol | Operation | Output = 1 when… |
|---|---|---|---|
| NOT | Buffer with bubble | Q = NOT A | Input is 0 |
| AND | D-shape | Q = A AND B | All inputs are 1 |
| OR | Curved shield | Q = A OR B | At least one input is 1 |
| NAND | AND + bubble | Q = NOT(A AND B) | Not all inputs are 1 |
| NOR | OR + bubble | Q = NOT(A OR B) | All inputs are 0 |
| XOR | Curved shield + extra curve | Q = A XOR B | Inputs are different |
Constructing Logic Circuits
You need to convert between three forms:
Problem: A security system activates (Q=1) if it's night (A=1) AND either motion (B=1) OR a door is open (C=1).
Expression: Q = A AND (B OR C)
Circuit: OR gate with inputs B,C → AND gate with A and OR output → Q
