Computer Fundamentals

Input/Output (I/O) Techniques; Storage Devices

C-CAT

Input/Output (I/O) Techniques

I/O Control Techniques

TechniqueDescriptionCPU Involvement
Programmed I/O (Polling)CPU continuously checks device status in a loop ("busy waiting")Very high — CPU wastes time
Interrupt-Driven I/ODevice sends interrupt signal to CPU when readyModerate — CPU interrupted only when needed
DMA (Direct Memory Access)DMA controller handles data transfer directly between device and memoryLow — CPU only initiates/completes transfer

Programmed I/O (Polling)

# Pseudo-code for polling
while device.status != READY:   # busy waiting!
    pass  # CPU stuck in loop
device.transfer_data()
  • CPU wastes cycles checking device repeatedly
  • Simple but inefficient
  • Used for simple, slow devices

Interrupt-Driven I/O

CPU sends I/O request to device
CPU continues with other tasks
Device finishes I/O → sends INTERRUPT signal
CPU saves current state → handles interrupt (ISR)
CPU resumes previous task

Interrupt types:

  • Hardware interrupt — device signaling CPU (keyboard press, NIC packet)
  • Software interrupt — program requesting OS service (system call)

Exception — CPU error (divide by zero, page fault, overflow)

DMA (Direct Memory Access)

CPU → "Transfer 1MB from disk to RAM" → DMA Controller
CPU continues other work
DMA handles: disk → DMA buffer → RAM (directly, without CPU)
DMA → Interrupt to CPU: "Transfer complete"
  • DMA controller is a special chip that handles I/O independently
  • CPU is free to do useful work during data transfer
  • Very important for high-speed I/O (disk, network)

Storage Devices

Hard Disk Drive (HDD)

HDD stores data on rotating magnetic platters.

Platter (magnetic disk)
  └── Tracks (concentric circles)
        └── Sectors (pie slices; 512 bytes or 4KB each)
              └── Clusters (groups of sectors)

Components:

  • Platter — rotating aluminum disk coated with magnetic material

Read/Write Head — floats nanometers above platter; reads/writes data

  • Arm/Actuator — moves heads across platters
  • Spindle — motor spinning platters at 5400 or 7200 RPM

HDD Performance:

MetricDescription
Rotational Speed5400 or 7200 RPM
Seek TimeTime to move head to correct track (~5ms)
Rotational LatencyTime for correct sector to rotate under head (~4ms)
Transfer RateSpeed of reading/writing data (~100-200 MB/s)
Access TimeSeek + Latency + Transfer (~10-15ms)

Solid State Drive (SSD)

SSD stores data in NAND flash memory chips — no moving parts.

Advantages over HDD:

FeatureHDDSSD
Speed~100-200 MB/s500 MB/s to 7 GB/s
Access time~10ms~0.1ms
Moving partsYes (failure point)No
Power consumptionHigherLower
NoiseYesSilent
Physical shockSusceptibleResistant
CostLower per GBHigher per GB

SSD Types:

InterfaceSpeedForm Factor
SATA SSD~500 MB/s2.5 inch
NVMe M.23-7 GB/sM.2 slot on motherboard
PCIe SSD5-12 GB/sPCIe slot

Continue learning

Related notes

Put this topic into timed practice

Open mock tests when you want full-exam pacing, or keep drilling in practice mode.