Computer Hardware DesignUnit 613 min read
Storage, I/O Devices & Data Transfer Techniques
Unit 6 of Computer Hardware Design explores secondary storage technologies (HDD, SSD, optical), I/O devices (keyboard, printer, scanner), data transfer methods (parallel/serial, DMA, interrupts), and their performance trade-offs, with real-world examples from Nepalese tech companies like Ncell and eSewa.
TAKEAWAYS:
- Storage devices trade capacity, speed, and cost (HDD vs. SSD vs. optical), with SSDs using NAND flash and HDDs relying on magnetic platters and read/write heads.
- I/O devices connect via ports (USB, HDMI) and use controllers to translate human input/output into machine-readable signals.
- Data transfer methods (polling, interrupts, DMA) determine how efficiently the CPU handles peripheral requests, with DMA being fastest for bulk transfers.
- RAID levels (0–6) balance speed, redundancy, and cost, critical for servers like NEPSE’s trading systems.
- Optical storage (DVD, Blu-ray) uses laser beams to read pits/lands, while magnetic tape is used for archival backups.
- Exam focus: Compare storage types, explain DMA vs. interrupts, and analyze RAID configurations.
1. Secondary Storage Devices
Secondary storage retains data even when powered off. Key types:
A. Magnetic Storage (HDD)
- How it works:
- Data stored as magnetic polarities on rotating platters (disks).
- Read/write heads (floating on air bearings) detect/alter polarity via electromagnetic induction.
- Seek time (head movement) + rotational latency (waiting for data to spin under head) determine speed.
- Capacity: ~500GB–20TB (modern HDDs); Speed: 80–160MB/s (slower than SSDs).
- Real-world use:
- Ncell’s backup servers use HDDs for cost-effective bulk storage of call logs and transaction records.
- NTC’s network routers rely on HDDs for logging historical traffic data (cheaper than SSDs for archival).
B. Solid-State Storage (SSD)
- How it works:
- Uses NAND flash memory (no moving parts).
- Data stored in cells (SLC, MLC, TLC) with wear leveling to extend lifespan.
- Speed: 300–3500MB/s (faster than HDDs); Capacity: 120GB–8TB.
- No seek time (electronic access), but limited write cycles (~3000–100,000 per cell).
- Real-world use:
- eSewa’s payment servers use SSDs to handle high-speed transaction processing (e.g., festival bonus payouts).
- Pathao’s ride-hailing app stores user location data on SSDs for low-latency updates.
C. Optical Storage (DVD, Blu-ray)
- How it works:
- Data encoded as pits (0s) and lands (1s) on a reflective disc.
- Laser reads pits/lands via reflection intensity.
- DVD: 4.7GB (single-layer), Blu-ray: 25GB (single-layer).
- Speed: 1–16x (e.g., 16x DVD = 22.16MB/s).
- Real-world use:
- Nepalese movie theaters use Blu-ray for high-definition film playback.
- Educational institutions distribute courseware via DVDs (e.g., TU’s exam question banks).
D. Magnetic Tape
- How it works:
- Data stored linearly on plastic tape coated with magnetic particles.
- Sequential access (must read entire tape to reach data).
- Capacity: 1–10TB (highest among secondary storage); Speed: 100–300MB/s (slow).
- Used for archival backups (e.g., banks, government records).
- Real-world use:
- Nepal Rastra Bank uses tape backups for long-term financial record storage.
- NTC’s historical call data is archived on tapes to save space.
2. I/O Devices and Ports
I/O devices bridge humans and computers. Key categories:
A. Input Devices
| Device | Function | Interface | Example in Nepal |
|---|---|---|---|
| Keyboard | Text/data entry | USB/PS2 | Used in eSewa kiosks |
| Mouse | Pointer control | USB/Bluetooth | Bank ATMs |
| Scanner | Digitize documents | USB/Network | Daraz’s warehouse inventory |
| Microphone | Audio input | USB/3.5mm Jack | Voice commands in Pathao app |
| Webcam | Video capture | USB/HDMI | Online exam proctoring (TU) |
B. Output Devices
| Device | Function | Interface | Example in Nepal |
|---|---|---|---|
| Monitor | Display graphics/text | HDMI/DVI | TU exam halls |
| Printer | Print documents | USB/Network | Ncell bill printing |
| Speaker | Audio output | 3.5mm Jack/HDMI | Public address systems |
| Projector | Large-screen display | HDMI/VGA | Government meetings |
C. Ports and Controllers
- Ports physically connect devices:
- USB (Universal Serial Bus): Plug-and-play, supports data + power (e.g., USB 3.2: 20Gbps).
- HDMI: Audio/video (e.g., monitors, projectors).
- Ethernet: Networked devices (e.g., routers).
- Serial/Parallel: Legacy (rare today).
- Controllers translate signals:
- Keyboard controller: Converts key presses to scan codes.
- GPU: Renders graphics for monitors.
3. Data Transfer Techniques
The CPU communicates with I/O devices via three methods:
A. Polling
How it works:
- CPU repeatedly checks if a device is ready (e.g., keyboard buffer full).
- Wastes CPU cycles if device is idle.
- Example: Checking if a printer has finished printing.
sequenceDiagram CPU->>Device: Check status (Poll) Device-->>CPU: Not Ready CPU->>Device: Check status (Poll) Device-->>CPU: Ready CPU->>Device: Transfer Data
B. Interrupts
How it works:
- Device sends a signal (interrupt) when ready.
- CPU saves state, executes Interrupt Service Routine (ISR), then resumes.
- Faster than polling (CPU not wasted).
- Example: Mouse movement triggers an interrupt to update cursor position.
sequenceDiagram Device->>CPU: Interrupt (Mouse Moved) CPU->>Device: Acknowledge CPU->>ISR: Execute (Update Cursor) ISR-->>CPU: Return CPU->>Program: Resume
C. Direct Memory Access (DMA)
- How it works:
- DMA controller transfers data directly between I/O and memory, bypassing CPU.
- CPU only involved at start/end.
- Used for bulk transfers (e.g., loading a game from SSD to RAM).
- Example: Downloading a large file from Daraz to your laptop.
- Comparison Table:
Method CPU Involvement Speed Use Case Polling High Slow Legacy systems Interrupts Moderate Fast Real-time input (mouse) DMA Low Fastest Bulk data (SSD to RAM)
4. RAID (Redundant Array of Independent Disks)
RAID improves performance, redundancy, or both by combining multiple disks.
Key RAID Levels
| Level | Description | Redundancy | Performance | Use Case |
|---|---|---|---|---|
| 0 | Striping (no redundancy) | No | Very High | Temporary storage (e.g., video editing) |
| 1 | Mirroring (duplicate disks) | Yes | Moderate | Critical data (e.g., bank servers) |
| 5 | Striping + parity (distributed) | Yes | High | Small businesses |
| 6 | Striping + dual parity | Yes | High | Enterprise backups |
Example:
- NEPSE’s trading system uses RAID 10 (mirroring + striping) for high speed and fault tolerance during stock trades.
- Ncell’s call logs use RAID 5 for cost-effective redundancy.
flowchart LR A["RAID 5\n(Striping + Parity)"] --> B["Disk 1"] A --> C["Disk 2"] A --> D["Disk 3"] A --> E["Parity Data\n(Distributed across disks)"] B --> F["Data Stripes"] C --> F D --> F
5. Storage Performance Metrics
Key metrics to compare storage:
| Metric | Definition | Example Values |
|---|---|---|
| Capacity | Total data storage | HDD: 2TB, SSD: 1TB |
| Speed | Data transfer rate | SSD: 3500MB/s, HDD: 160MB/s |
| Latency | Time to first byte | SSD: ~0.1ms, HDD: ~10ms |
| Durability | Lifespan (write cycles for SSD) | SLC SSD: 100,000 cycles |
| Cost | Price per GB | HDD: ~$0.02/GB, SSD: ~$0.10/GB |
In the Real World
eSewa’s Transaction Processing
- Idea Used: SSD + RAID 10
- How: During festivals (e.g., Dashain), eSewa processes thousands of transactions per second. SSDs provide low latency, while RAID 10 ensures fault tolerance (if one disk fails, data remains intact). The DMA controller speeds up bulk transfers between SSDs and RAM.
Pathao’s Ride-Matching Algorithm
- Idea Used: Interrupts + Real-Time Data Transfer
- How: When a user requests a ride, Pathao’s servers receive interrupts from GPS sensors (via mobile networks). The system prioritizes these interrupts to update driver locations in real-time, matching riders efficiently. DMA is used to quickly transfer location data from mobile devices to central servers.
Nepal Rastra Bank’s Archival System
- Idea Used: Magnetic Tape + RAID 6
- How: NRB stores decades of financial records on magnetic tapes (cheap, high capacity). For active data, RAID 6 (striping + dual parity) ensures two disk failures can be tolerated without data loss. Tapes are used for long-term archival, while SSDs handle daily transactions.
Exam Tip
Storage Comparison:
- Always compare HDD vs. SSD vs. Optical in terms of speed, capacity, cost, and durability.
- Example Question: "Why does an SSD boot faster than an HDD?" Answer: SSDs have no moving parts (electronic access), while HDDs suffer from seek time + rotational latency.
Data Transfer Methods:
- Polling is CPU-intensive but simple.
- Interrupts are efficient for sporadic events (e.g., keyboard input).
- DMA is best for bulk transfers (e.g., loading a game).
- Exam Trick: Draw a timing diagram comparing CPU usage in polling vs. interrupts.
RAID Configurations:
- RAID 0: Fast but no redundancy (use for non-critical data).
- RAID 1: Redundant but high cost (use for critical data).
- RAID 5/6: Balance of speed and redundancy (use for servers).
- Exam Tip: Calculate effective capacity for RAID levels (e.g., RAID 1 halves usable space).
Real-World Applications:
- Ncell: Uses HDDs for backups (cost-effective) and SSDs for active data (speed).
- eSewa: Relies on RAID 10 for high-speed, fault-tolerant transactions.
- Nepal Police: Uses optical discs for evidence storage (tamper-proof).
Diagrams Are Key:
- Always draw:
- HDD/SSD internal structure (for storage).
- Interrupt/DMA flowcharts (for data transfer).
- RAID configurations (for redundancy).
- Example: If asked about DMA, sketch the DMA controller bypassing the CPU to transfer data directly to RAM.
- Always draw:
Final Note: Focus on trade-offs (speed vs. cost, redundancy vs. capacity) and real-world mappings (e.g., eSewa = SSDs + RAID, Ncell = HDDs + tapes). Use tables, diagrams, and examples to score full marks!
Based on the TU BSc CSIT syllabus for Computer Hardware Design, unit 6.
Discussion
Loading…