Computer Fundamentals
Input/Output (I/O) Techniques; Storage Devices
C-CAT
Input/Output (I/O) Techniques
I/O Control Techniques
| Technique | Description | CPU Involvement |
|---|---|---|
| Programmed I/O (Polling) | CPU continuously checks device status in a loop ("busy waiting") | Very high — CPU wastes time |
| Interrupt-Driven I/O | Device sends interrupt signal to CPU when ready | Moderate — CPU interrupted only when needed |
| DMA (Direct Memory Access) | DMA controller handles data transfer directly between device and memory | Low — 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:
| Metric | Description |
|---|---|
| Rotational Speed | 5400 or 7200 RPM |
| Seek Time | Time to move head to correct track (~5ms) |
| Rotational Latency | Time for correct sector to rotate under head (~4ms) |
| Transfer Rate | Speed of reading/writing data (~100-200 MB/s) |
| Access Time | Seek + Latency + Transfer (~10-15ms) |
Solid State Drive (SSD)
SSD stores data in NAND flash memory chips — no moving parts.
Advantages over HDD:
| Feature | HDD | SSD |
|---|---|---|
| Speed | ~100-200 MB/s | 500 MB/s to 7 GB/s |
| Access time | ~10ms | ~0.1ms |
| Moving parts | Yes (failure point) | No |
| Power consumption | Higher | Lower |
| Noise | Yes | Silent |
| Physical shock | Susceptible | Resistant |
| Cost | Lower per GB | Higher per GB |
SSD Types:
| Interface | Speed | Form Factor |
|---|---|---|
| SATA SSD | ~500 MB/s | 2.5 inch |
| NVMe M.2 | 3-7 GB/s | M.2 slot on motherboard |
| PCIe SSD | 5-12 GB/s | PCIe slot |
Continue learning
Related notes
Definition of AI; Need of AI
Artificial Intelligence
Introduction to Data Engineering; Big Data — The 5 V's; Types of Data
Big Data and Data Engineering
Introduction to C Programming; C Program Structure; Data Types and Variables
C Programming
What Is a Computer?; Machine Cycle: Fetch–Decode–Execute; CPU Organization
Computer Architecture
Put this topic into timed practice
Open mock tests when you want full-exam pacing, or keep drilling in practice mode.