Peripheral Devices
Peripherals are the electromechanical and electromagnetic devices connected to a computer that provide input, output or auxiliary storage. They are outside the CPU-memory core.
1. Why Peripherals Need an Interface
Four fundamental mismatches between the CPU and a peripheral:
1. SPEED : CPU works in nanoseconds; a keyboard in
hundreds of milliseconds. Ratio can exceed 10^6.
2. DATA FORMAT : peripherals may be serial, byte-wide, or use a
different code (ASCII, Unicode, analogue voltages);
the CPU works in fixed-width parallel words.
3. SIGNAL LEVEL: peripherals may use 12 V (RS-232) or analogue
signals; the CPU uses 3.3 V / 5 V logic.
4. OPERATING MODE: each device has its own control protocol; the
CPU should not have to know the details.
-> Therefore every peripheral is connected through an INTERFACE UNIT.
2. Classification by Function
| Category | Devices | Direction |
|---|
| Input | Keyboard, mouse, joystick, scanner, barcode reader, microphone, webcam, touchscreen, sensors, OMR/OCR/MICR readers | Device → CPU |
| Output | Monitor (CRT/LCD/LED/OLED), printer, plotter, speaker, projector, actuators | CPU → Device |
| Storage | HDD, SSD, optical disc, magnetic tape, USB flash, memory card | Both |
| Communication | NIC, modem, Wi-Fi adapter, Bluetooth | Both |
3. Input Devices in Detail
| Device | Working principle | Typical rate |
|---|
| Keyboard | Key press closes a switch in a row-column matrix; an encoder produces the scan code | ~10 chars/s |
| Mouse | Optical sensor images the surface and computes displacement | ~100 reports/s |
| Scanner | A CCD/CIS array converts reflected light to pixel values | Minutes per page |
| MICR | Magnetic Ink Character Recognition — used on bank cheques | Fast, very reliable |
| OMR | Optical Mark Recognition — detects pencil marks (OMR answer sheets) | Very fast |
| OCR | Optical Character Recognition — converts scanned images to text | Software-dependent |
| Barcode reader | Laser/CCD reads the reflectance pattern of the bars | Instant |
| Touch screen | Resistive (pressure) or capacitive (charge change) | Continuous |
4. Output Devices in Detail
Monitors
| Type | Technology | Notes |
|---|
| CRT | Electron beam scans a phosphor screen | Obsolete; bulky, high power |
| LCD | Liquid crystals modulate a backlight | Thin, low power |
| LED | LCD with an LED backlight | Better contrast |
| OLED | Each pixel emits its own light | True blacks, no backlight |
Resolution and memory:
A 1024 x 768 display with 24-bit colour needs:
1024 x 768 x 3 bytes = 2,359,296 bytes ≈ 2.25 MB of video RAM per frame.
At 60 frames per second:
2.25 MB x 60 = 135 MB/s of bandwidth.
Printers
| Category | Type | Principle | Quality / speed |
|---|
| Impact | Dot matrix | Pins strike an inked ribbon | Low quality, can print carbon copies |
| Impact | Daisy wheel | Fully formed characters strike a ribbon | Letter quality, very slow |
| Impact | Line printer | Prints a whole line at a time | Very fast, low quality |
| Non-impact | Inkjet | Droplets sprayed onto paper | Good quality, cheap printer |
| Non-impact | Laser | Laser writes a charge image on a drum; toner adheres | High quality, high speed |
| Non-impact | Thermal | Heat-sensitive paper | Receipts, low cost |
Impact printers : noisy, slow, cheap consumables, multi-part forms
Non-impact printers: quiet, fast, better quality, costlier consumables
5. Data Rates — the reason for interface design
| Device | Typical data rate |
|---|
| Keyboard | 10 bytes/s |
| Mouse | 100 bytes/s |
| Modem (56 K) | 7 KB/s |
| Printer (laser) | 100 KB/s |
| Hard disk | 100–200 MB/s |
| SSD (NVMe) | 3–7 GB/s |
| Gigabit Ethernet | 125 MB/s |
| Main memory | 10–50 GB/s |
| CPU register file | 100+ GB/s |
The spread between a keyboard and main memory is about 10^9.
No single transfer technique can serve both efficiently — which is
exactly why Unit IV defines THREE modes of transfer:
programmed I/O, interrupt-driven I/O and DMA.
6. ASCII — the character code peripherals speak
ASCII = 7-bit code -> 128 characters (an 8th bit is often a parity bit)
0x00 - 0x1F : control characters (NUL, BEL, BS, HT, LF, CR, ESC, ...)
0x20 : space
0x30 - 0x39 : digits '0' to '9'
0x41 - 0x5A : 'A' to 'Z'
0x61 - 0x7A : 'a' to 'z'
0x7F : DEL
Useful facts:
'A' = 65 = 0x41, 'a' = 97 = 0x61 -> difference is exactly 32 (bit 5)
'0' = 48 = 0x30 -> digit value = ASCII code - 48
| Related code | Bits | Note |
|---|
| BCD | 6 | Older, 64 characters |
| EBCDIC | 8 | IBM mainframes, 256 characters |
| ASCII | 7 (+1 parity) | The de facto standard |
| Unicode / UTF-8 | 8–32 | Covers all world scripts; ASCII is a subset |
7. Where Peripherals Attach
Every device hangs off an interface unit that resolves the four mismatches listed in section 1. The structure of that interface unit is the subject of the next lesson.
Summary
Peripherals = input, output, storage and communication devices
Four mismatches: speed, data format, signal level, operating mode
-> every device needs an INTERFACE
Data rates span 10^9 -> three different transfer modes are needed
ASCII = 7-bit character code used by most character devices