Show understanding of the need for input, output, primary memory and secondary (including removable) storage

3.1 Computers and Their Components

Learning Objective

Show understanding of the need for input, output, primary memory and secondary (including removable) storage, together with the supporting concepts of buses, buffers and cache.

Why Different Components Are Required

  • Input devices – bring data and instructions from the external world into the computer.
  • Output devices – present processed information in a form usable by humans or other machines.
  • Primary memory – fast, directly addressable storage used while a program runs (volatile RAM and non‑volatile ROM).
  • Secondary storage – large‑capacity, non‑volatile media that retain data when power is removed; may be fixed or removable.
  • Buffers – temporary holding areas that smooth data transfer between components that operate at different speeds.
  • Buses – the pathways that carry address, data and control signals between the CPU, memory and I/O devices.
  • Cache memory – a small, very fast memory that stores copies of frequently accessed data to bridge the speed gap between CPU and main RAM.

Input Devices

Input devices convert real‑world phenomena into binary data the computer can process.

  • Keyboard – textual characters (ASCII/Unicode).
  • Mouse / Touchpad – positional data (X/Y coordinates) and button states.
  • Scanner – optical image → digital bitmap.
  • Microphone – analog sound → digital audio (via an ADC).
  • Sensors (temperature, pressure, light, etc.) – physical measurements → digital values (data‑acquisition sensors).
  • Specialised I/O for embedded systems – e.g., rotary encoders, infrared receivers.

Output Devices

Output devices transform binary results back into a form usable by people or other machines.

  • Monitor – visual display of pixels.
  • Printer – paper output (text, graphics).
  • Speaker – audio output (via a DAC).
  • Actuators – mechanical movement such as motors, relays or solenoids (used in control systems).
  • Embedded‑system displays – LCD panels, seven‑segment LEDs.

Bus Architecture

A bus is a set of parallel wires that transfers information between the CPU, memory and I/O controllers.

  • Address bus – carries the memory location (or I/O port) the CPU wishes to read or write. Width determines the maximum addressable space (e.g., a 32‑bit address bus can address 2³² bytes ≈ 4 GB).
  • Data bus – carries the actual data being transferred. Wider data buses (e.g., 64‑bit) move more bits per clock cycle, increasing throughput.
  • Control bus – carries timing and control signals such as read/write, interrupt requests, and clock signals.

All components must agree on the bus protocol; otherwise data corruption occurs.

Buffers

A buffer is a small area of primary memory that temporarily stores data while it is being transferred between two components that operate at different speeds.

  • CPU ↔ I/O controller – the CPU can continue processing while the slower I/O device finishes its transfer.
  • Example: a print buffer holds a raster page while the printer head prints line by line.

Typical data path: CPU → Buffer → I/O device (and the reverse direction for input).

Primary Memory

Memory Hierarchy (from fastest to slowest)

  1. CPU registers
  2. Cache memory (L1, L2, L3)
  3. Static RAM (SRAM) – used for cache
  4. Dynamic RAM (DRAM) – main memory
  5. Read‑Only Memory (ROM, PROM, EPROM, EEPROM) – firmware
  6. Secondary storage (HDD, SSD, optical media, etc.)

Each level is larger but slower than the one above it, providing a cost‑effective balance between speed and capacity.

RAM vs ROM – Comparative Table

Memory TypeVolatilityTypical UseRead/Write SpeedWrite / Erase CharacteristicsTypical Example
SRAM (Static RAM)VolatileCPU cache, registers≈ 1 nsRead‑write, no refresh neededL1/L2 cache
DRAM (Dynamic RAM)VolatileMain memory≈ 10–20 ns (refresh required)Read‑write, refreshed every few msDDR4/DDR5 modules
ROM (Read‑Only Memory)Non‑volatileFixed firmware (boot code)ModerateWrite‑once (factory)BIOS/UEFI chip
PROM (Programmable ROM)Non‑volatileOne‑time programmable firmwareModerateProgrammed once with high voltage; thereafter read‑onlyLegacy hardware
EPROM (Erasable PROM)Non‑volatileRe‑writable firmware (UV erase)ModerateErased with UV light, then re‑programmed; erase cycle ≈ minutesOlder micro‑controllers
EEPROM (Electrically Erasable PROM)Non‑volatileFirmware updates, configuration dataSlower than RAMByte‑wise erase/write; typical endurance 10⁴–10⁶ cyclesBIOS flash, micro‑controller flash

Key Points About RAM

  • Volatility – data is lost when power is removed.
  • Speed – access times < 100 ns, far faster than any secondary storage.
  • Random access – any location can be read or written directly.
  • Capacity – measured in gigabytes (GB) for modern PCs.
  • Holds the currently executing program, its variables, and any OS components that need rapid access.

Cache Memory

Cache is a small, very fast SRAM that stores copies of data or instructions recently used by the CPU.

  • Levels – L1 (closest to the CPU, typically 32–64 KB), L2 (128 KB–2 MB), L3 (2–32 MB, shared among cores).
  • Purpose – reduces the average memory access time by keeping frequently accessed items close to the processor.
  • Write policies – write‑through (immediate update to main RAM) or write‑back (update RAM only when a cache line is replaced).
  • Cache hit – data found in cache → fast access.

    Cache miss – data not in cache → fetch from slower RAM.

Secondary Storage

Secondary storage provides non‑volatile, high‑capacity storage for programs, files and system data.

TypeTypical CapacityTypical Access TimeRemovable?Typical Use
Hard Disk Drive (HDD)500 GB – 4 TB5 – 10 ms (seek + rotational latency)NoDesktop & laptop main storage (cost‑effective)
Solid‑State Drive (SSD)256 GB – 2 TB≈ 0.1 ms (no moving parts)NoHigh‑performance laptops, gaming PCs
Optical Disc (CD/DVD/Blu‑ray)700 MB – 100 GB≈ 0.2 s (spin‑up + seek)YesSoftware distribution, media archiving
USB Flash Drive4 GB – 1 TB≈ 0.1 s (depends on USB version)YesPortable data transfer, backups
Magnetic TapeSeveral TB (compressed)≈ 10 s (sequential access)YesLarge‑scale backups, archival storage

Key reasons for secondary storage:

  1. Persistence – data remains after power‑off.
  2. Capacity – far larger than RAM, suitable for archives, media libraries and databases.
  3. Cost efficiency – lower cost per gigabyte compared with RAM.

Embedded Systems

An embedded system is a specialised computer built into a larger device to perform dedicated functions. It typically combines a micro‑controller (or micro‑processor), limited RAM, non‑volatile ROM/flash, and a set of tailored I/O interfaces.

Example: a digital thermostat contains a micro‑controller, a temperature sensor (input), a small LCD (output), a few kilobytes of RAM for the control algorithm, and EEPROM to store user settings. Because the system is designed for a single purpose, its I/O and memory are optimised for low power and fast response.

Monitoring & Control Systems

These systems continuously acquire data from sensors, process it, and then drive actuators to maintain a desired condition.

  1. Sensor → Analog‑to‑Digital Converter (ADC) → Buffer → RAM.
  2. CPU reads the digitised value, runs the control algorithm, and writes the result to a Digital‑to‑Analog Converter (DAC) or directly to an actuator driver.
  3. Actuator (motor, valve, etc.) changes the physical world, which may be sensed again, forming a feedback loop.

Block diagram: Sensor → ADC → Buffer → RAM → CPU → DAC → Actuator (feedback to sensor).

Relationship Between the Components (Data Flow)

  1. Input device captures real‑world data.
  2. Data passes through an I/O controller, optionally a buffer, and is stored in primary memory.
  3. The CPU fetches instructions and data from RAM (or cache), processes them, and writes results back to RAM.
  4. If results must be retained long‑term, they are transferred to secondary storage.
  5. For user interaction, the CPU reads results from RAM and sends them to output devices (through buffers if required).

Performance Considerations

The overall effective throughput of a system is limited by its slowest component:

\$\$

\text{Effective Throughput} = \min\bigl(R{\text{CPU}},\;R{\text{Cache}},\;R{\text{RAM}},\;R{\text{I/O}},\;R_{\text{Storage}}\bigr)

\$\$

where \(R\) denotes the data‑transfer rate (bits · s\(^{-1}\)). Latency (delay before the first byte arrives) is also important for interactive devices such as keyboards and displays.

Key Points to Remember

  • Input and output are the interfaces between a computer and the external world.
  • Buses (address, data, control) carry the signals that connect CPU, memory and I/O.
  • Buffers smooth data exchange between fast and slow components.
  • Cache bridges the speed gap between CPU and main RAM.
  • Primary memory (RAM) provides rapid, temporary storage; ROM families provide non‑volatile firmware with differing write/erase capabilities.
  • Secondary storage offers large, permanent capacity; some media are removable for portability or backup.
  • Embedded systems illustrate how a minimal set of I/O and memory can be tailored for a specific control task.
  • System performance depends on a balanced combination of CPU speed, cache hierarchy, memory speed, I/O bandwidth and storage latency.