Unit 2: Computer Storage, Processing and I/O Devices
I. Orientation: The Memory Hierarchy
Every computer organises storage as a hierarchy, trading speed against cost-per-bit and capacity. The processor works only on data held in fast memory; slower, cheaper storage holds the bulk of data until it is needed. This pyramid governs every topic in the unit.
- Speed–cost trade-off: As you move down the hierarchy speed falls and capacity rises: registers (< 1 ns) → cache → main memory (RAM, ~10–100 ns) → SSD (~50 µs) → HDD (~10 ms) → optical/tape.
- Volatility: Whether contents survive power loss. Registers, cache and RAM are volatile; ROM, HDD, SSD, flash and optical media are non-volatile.
- Primary vs secondary: Primary memory is directly accessible by the CPU and holds running programs; secondary storage is not CPU-addressable and retains data permanently.
- Access method: Random access (any location in constant time, e.g. RAM, SSD) versus sequential access (traverse in order, e.g. magnetic tape).
II. Types of Memory
Memory is classified by its role, volatility and technology.
A. Primary (main) memory
Directly connected to the CPU over the memory bus and measured in nanoseconds.
- RAM (Random Access Memory): Volatile read/write memory holding the active OS, programs and data.
- DRAM (Dynamic RAM): Stores each bit in a capacitor that leaks charge, so it must be refreshed thousands of times per second. Cheap and dense; used as main memory (DDR4, DDR5 modules).
- SRAM (Static RAM): Stores each bit in a flip-flop of 4–6 transistors, no refresh needed. Faster and costlier; used for CPU cache.
- ROM (Read Only Memory): Non-volatile memory holding firmware such as the BIOS/UEFI boot code.
- PROM / EPROM / EEPROM: Programmable once, erasable by UV light, and electrically erasable respectively. Flash memory is a form of EEPROM.
- Cache memory: Small, very fast SRAM between CPU and RAM (L1 a few KB, L2/L3 up to tens of MB) that holds recently used data to cut average access time.
B. Registers
The fastest storage, built into the CPU itself.
- Purpose: Hold operands, instructions and addresses during execution; word-sized (e.g. 64-bit).
- Examples: Accumulator, program counter (PC), instruction register (IR), memory address register (MAR).
C. Secondary and virtual memory
- Secondary memory: Non-volatile bulk storage (HDD, SSD) covered in Section IV.
- Virtual memory: An OS technique that uses part of secondary storage as an extension of RAM, swapping pages in and out so programs larger than physical RAM can run.
III. Memory Units
Storage capacity is measured in binary multiples of the bit.
- Bit: The smallest unit, a single binary digit (0 or 1).
- Nibble: 4 bits.
- Byte: 8 bits, the standard unit for one character (e.g. ASCII 'A' = 01000001).
- Word: The natural data size the CPU processes at once (32-bit or 64-bit).
Larger units use powers of 2 (binary) though disks are often sold in powers of 10 (decimal):
1 Byte = 8 bits
1 Kilobyte (KB) = 1024 bytes = 2^10 bytes
1 Megabyte (MB) = 1024 KB = 2^20 bytes
1 Gigabyte (GB) = 1024 MB = 2^30 bytes
1 Terabyte (TB) = 1024 GB = 2^40 bytes
1 Petabyte (PB) = 1024 TB = 2^50 bytes- Binary vs decimal convention: Manufacturers label a "1 TB" disk as 10^12 bytes, so the OS reports about 931 GiB. The distinct binary units are KiB, MiB, GiB (IEC standard).
IV. Secondary Storage Devices
Non-volatile devices that retain data without power and give large capacity at low cost per bit.
A. Hard Disk Drive (HDD)
A magnetic, electromechanical drive that stores data on spinning platters.
- Structure: One or more rigid platters coated with magnetic material, spun at 5400–7200 RPM (up to 15000 in servers); read/write heads on an actuator arm float microns above the surface.
- Data organisation: Tracks (concentric rings), sectors (arcs, historically 512 bytes, now 4 KB), and cylinders (aligned tracks across platters).
- Access time: Sum of seek time (head to track), rotational latency (sector under head) and transfer time; typically ~10 ms overall.
- Traits: High capacity (multiple TB) and low cost, but slow, noisy and vulnerable to shock because of moving parts.
B. Flash drives
Solid-state, removable storage using NAND flash memory.
- Principle: Data is held as trapped charge in floating-gate transistors, retained without power; no moving parts.
- USB flash drive (pen drive): Flash chip plus a USB controller in a compact case; hot-swappable and used for transfer and backup, capacities from a few GB to 1 TB.
- Memory cards: SD, microSD and CompactFlash cards use the same technology in cameras and phones.
- Wear: Each cell tolerates a limited number of write/erase cycles, so controllers apply wear levelling to spread writes.
C. Optical disks: DVD
Media read and written by a laser that detects pits and lands on a reflective layer.
- Reading principle: A laser beam reflects off the spiral track; transitions between pits and lands encode bits. DVD uses a red laser (650 nm) with tighter pits than CD.
- DVD capacity: 4.7 GB single-layer, 8.5 GB dual-layer, versus a CD's 700 MB; Blu-ray uses a blue-violet laser (405 nm) for 25 GB per layer.
- Formats: DVD-ROM (read only, pressed), DVD-R (write once), DVD-RW/RAM (rewritable).
- Use and limits: Cheap for mass distribution and archiving, but slow, low capacity and increasingly obsolete.
D. Solid State Drive (SSD)
A secondary storage drive built entirely from flash memory, replacing the HDD role.
- SSD (no moving parts): Data on NAND flash; near-instant access (~50 µs), silent, shock-resistant, low power. Interfaces include SATA and the faster NVMe over PCIe (several GB/s).
- HDD (mechanical) — contrast: Slower and fragile but far cheaper per GB and available in larger single-drive capacities.
- Controller and FTL: An internal controller runs the flash translation layer, mapping logical blocks to physical cells and handling wear levelling and the TRIM command.
- Endurance: Limited program/erase cycles; rated in TBW (terabytes written).
V. Input / Output Devices
I/O devices bridge the user and the machine: input devices feed data in, output devices present results.
A. Keyboard
The primary text input device.
- Operation: Keys form a grid; a pressed key closes a circuit at a row–column intersection, and the controller sends a scan code to the CPU.
- Types: Membrane (soft, quiet, cheap) versus mechanical (individual switches, tactile, durable); layouts such as QWERTY.
B. Mouse
A pointing device that maps hand motion to on-screen cursor movement.
- Optical/laser mouse: An LED or laser and a small camera track surface texture; no moving ball, higher accuracy.
- Sensitivity: Measured in DPI (dots per inch); higher DPI means faster cursor travel.
C. LCDs
Liquid Crystal Displays, the dominant flat-panel output device.
- Principle: Liquid crystals twist under voltage to control how much backlight passes through colour filters; each pixel has red, green and blue sub-pixels.
- Specifications: Resolution (e.g. 1920×1080), refresh rate (Hz) and response time (ms); LED-backlit LCDs and OLED (self-emitting pixels) are refinements.
D. Scanner
An input device that converts a physical document or image into a digital bitmap.
- Operation: A moving light source and a CCD/CIS sensor capture reflected light row by row; resolution measured in DPI.
- Types: Flatbed (documents/photos), handheld, and specialised barcode/QR scanners; OCR software converts scanned text into editable characters.
E. Plotter
An output device for large-format, precise line drawings.
- Principle: Draws continuous vector lines by moving a pen or tool across the medium, unlike a printer's dot pattern; ideal for CAD, maps and engineering blueprints.
- Types: Flatbed plotters (paper fixed, pen moves in X and Y) and drum plotters (paper rolls on a drum).
F. Printer
An output device that produces hard copy on paper.
- Impact printers: Strike an inked ribbon against paper. The dot-matrix printer forms characters from a grid of pins; noisy but able to print multipart carbon forms.
- Non-impact printers: No physical strike.
- Inkjet: Sprays microscopic ink droplets; cheap, good colour, slower.
- Laser: A laser draws the page on a charged drum, which attracts toner powder fused by heat; fast, sharp, economical for volume.
- Quality metric: Print resolution in DPI; speed in pages per minute (PPM).
G. Latest I/O devices in market
Recent devices blur the input/output boundary and add new interaction modes.
- Touchscreens: Capacitive panels sense finger position, combining display output with direct touch input on phones, tablets and kiosks.
- Biometric scanners: Fingerprint, face and iris readers used for authentication.
- Voice assistants: Microphone-array input with speech recognition (Alexa, Siri).
- VR/AR headsets: Head-mounted displays with motion-tracking controllers for immersive output and gesture input.
- 3D printers: Additive-manufacturing output that builds physical objects layer by layer from a digital model.
- Gesture and eye-tracking sensors: Depth cameras and infrared sensors that read hand movement or gaze as input.
Did this save you a night before the exam?
LPU Notes is free, and it stays free. Ads cover part of the server bill. The rest comes out of a student's own pocket: the domain, the storage, and keeping the site up through the weeks everyone needs it at once.
The payment button didn't load. An ad blocker or a filtered network is the usual reason. to try again.
Nothing here is ever locked, and nothing unlocks. Chip in only if it was worth it. What it pays for →