Hardware
CPU architecture, FDE cycle, input/output devices, sensors, and data storage.
1 CPU & Von Neumann Architecture
The CPU (Central Processing Unit) processes all instructions and data. A microprocessor is a CPU on a single integrated circuit chip. The Von Neumann architecture stores both program instructions and data in the same memory.
Components of the CPU
| Component | Abbreviation | Role |
|---|---|---|
| Arithmetic Logic Unit | ALU | Performs arithmetic (+, −, ×, ÷) and logical (AND, OR, NOT) operations |
| Control Unit | CU | Directs all operations — fetches, decodes and coordinates execution of instructions |
| Program Counter | PC | Holds the memory address of the next instruction to be fetched |
| Memory Address Register | MAR | Holds the memory address currently being read from or written to |
| Memory Data Register | MDR | Holds the data that has just been fetched from or is about to be written to memory |
| Current Instruction Register | CIR | Holds the instruction currently being decoded and executed |
| Accumulator | ACC | Stores the result of the most recent ALU operation |
Buses
| Bus | Direction | What it carries |
|---|---|---|
| Address bus | One-way (CPU → Memory) | Memory addresses |
| Data bus | Two-way | Data and instructions |
| Control bus | Two-way | Control signals (read, write, clock) |
2 Fetch–Decode–Execute (FDE) Cycle
Know each register's specific role at each stage. E.g. The MAR always holds the address, the MDR always holds the data. The PC increments during Fetch, not Execute.
3 CPU Performance
| Factor | How it affects performance |
|---|---|
| Clock speed | Higher clock speed = more FDE cycles per second = faster processing. Measured in GHz. |
| Number of cores | More cores = more instructions processed simultaneously (parallel processing). A quad-core can handle 4 streams at once. |
| Cache size | Cache is very fast memory built into the CPU. Larger cache = more frequently used data stored nearby = fewer slow RAM accesses. |
Cache is faster than RAM because it is physically inside (or very close to) the CPU. Levels: L1 (fastest, smallest), L2, L3 (slowest of cache, but still much faster than RAM).
4 Instruction Sets & Embedded Systems
An instruction set is the complete list of machine code commands a CPU can execute. Every CPU has its own instruction set — programs must be compiled for the specific instruction set.
An embedded system is a dedicated computer system designed to perform a single specific task within a larger device. It uses a microprocessor with a fixed program stored in ROM.
- Performs ONE dedicated function
- Program stored in ROM — cannot be changed by user
- Examples: washing machine, microwave, car ABS, pacemaker, traffic lights
- Low power consumption
- Reliable and fast for its specific task
- Performs MANY different functions
- Programs loaded from storage, can be changed
- Examples: laptop, desktop PC, smartphone
- Higher power consumption
- Flexible and upgradeable
5 Input & Output Devices
Input devices convert real-world data into digital form. Output devices convert digital data into real-world form.
- Keyboard, mouse, microphone, digital camera
- Barcode/QR scanners, touch screens (resistive, capacitive, infra-red)
- 2D/3D scanners, sensors of all types
- Inkjet/Laser/3D printers, LED/LCD screens
- LCD/DLP projectors, speakers, actuators
- Actuator: converts electrical signal into physical movement (motor, valve, solenoid)
6 Sensors
A sensor is an input device that measures a physical property and converts it into an electrical signal (analogue), which is then converted to digital data for the computer.
| Sensor | Measures | Example Use |
|---|---|---|
| Temperature | Heat level (°C) | Greenhouse climate control, server room monitoring |
| Humidity | Moisture in air (%) | Weather stations, data centres |
| Moisture | Water content in soil/material | Automated irrigation systems |
| Light | Light intensity (lux) | Automatic street lighting, camera exposure |
| Infrared | Heat radiation / presence | Motion detectors, burglar alarms, TV remotes |
| Pressure | Force per unit area | Industrial machinery, weather forecasting |
| Proximity | Distance to nearby object | Automatic doors, parking sensors |
| Acoustic | Sound level (dB) | Noise pollution monitoring |
| Accelerometer | Rate of change of velocity / orientation | Smartphone screen rotation, fitness trackers |
| Flow | Rate of liquid/gas movement | Water supply monitoring, fuel management |
| Gas | Concentration of specific gases | Carbon monoxide detectors, industrial safety |
| Level | Height of liquid in a container | Water tanks, fuel gauges |
| Magnetic field | Magnetic field strength/direction | Compass, metal detectors |
| pH | Acidity/alkalinity of liquid | Swimming pools, agriculture, water treatment |
7 Data Storage
- Directly accessed by the CPU
- RAM — Volatile, read/write, holds current programs and data
- ROM — Non-volatile, read only, holds firmware/bootloader
- Fast but limited in size
- Not directly accessed by CPU
- Non-volatile — data persists without power
- Used for long-term data storage
- Larger capacity but slower than RAM
8 Virtual Memory
Virtual memory is a section of secondary storage (HDD/SSD) used as an extension of RAM when physical RAM is full. Pages of data are swapped between RAM and virtual memory as needed.
- RAM becomes full — no space for a new program or process
- OS identifies pages of data in RAM that haven't been used recently
- Those pages are moved (swapped out) to the virtual memory space on the disk
- The new data is loaded into the freed RAM space
- If the swapped-out pages are needed again, they are swapped back into RAM
Virtual memory is much slower than RAM because disk access is far slower than memory access. Heavy use of virtual memory causes noticeable slowdowns ("thrashing").
9 Cloud Storage
Cloud storage stores data on remote servers accessed via the internet, rather than on local hardware. Physical servers in data centres store the actual data.
| Cloud Storage | Local Storage | |
|---|---|---|
| Access | From any device, anywhere with internet | Only from the device it's connected to |
| Capacity | Scalable — pay for more when needed | Fixed — must buy new hardware to expand |
| Cost | Ongoing subscription / pay-per-use | One-time hardware cost |
| Security risk | Data held by third party — risk of breaches | Physical device can be lost/damaged/stolen |
| Dependence | Requires reliable internet connection | Works offline |
| Maintenance | Provider handles hardware maintenance | User responsible for backups and repairs |
