OVERVIEW OF INPUT–OUTPUT (I/O) ORGANIZATION
INPUT–OUTPUT
(I/O) ORGANIZATION
Introduction
Define how a computer system
communicates with external devices, such as:
- Keyboard
- Mouse
- Printer
- Hard
disk
- Display
- Network
devices
Basic Components
of the I/O System
Main Components
- CPU
- Main
Memory
- I/O
Devices
- I/O
Interface (Controller / Module)
- System
Bus
Need for I/O
Organization
Bridges the gap between CPU and devices because:-
- CPU
speed is very high
- I/O
devices are slow
- Data
formats differ
- Error
handling required
- Multiple
devices need CPU access
I/O Interface (I/O
Module)
Functions of the I/O Interface
- Device
selection
- Data
buffering
- Speed
matching
- Error
detection
- Control
& status reporting
Types of I/O
Devices
Input Devices
- Keyboard
- Mouse
- Scanner
- Microphone
Output Devices
- Monitor
- Printer
- Speaker
- Plotter
Storage Devices
- Hard
Disk
- SSD
- USB
Drive
I/O Addressing Techniques
(a) Memory-Mapped I/O
- I/O
devices treated as memory locations
- Same
address space for memory & I/O
- Uses
normal memory instructions
(b) Isolated (Port-Mapped) I/O
- Separate
address space for I/O
- Special
instructions (IN, OUT)
I/O Data Transfer
Techniques
1. Programmed I/O
CPU actively controls data
transfer.
Working
CPU Ă send command Ă I/O Module Ă connect withĂ DeviceĂ status activeĂ data transfer.
2. Interrupt-Driven I/O
I/O device interrupts the CPU
when ready.
Working
- CPU
starts I/O
- CPU
performs other work
- The device sends an interrupt
- CPU
executes ISR (Interrupt Service Routine)
3. Direct Memory Access (DMA)
DMA controller transfers data directly
between memory and the device.
Working Steps
- CPU
initializes the DMA controller
- DMA
takes control of the bus
- Data
transfer without CPU
- DMA
interrupts the CPU after completion
Modes of DMA
Transfer
- Burst
Mode – DMA
transfers entire block
- Cycle
Stealing –
DMA steals CPU cycles
- Transparent
Mode – DMA
works when the CPU is idle
I/O Bus and System
Bus
System Bus
- Data
Bus
- Address
Bus
- Control
Bus
I/O Bus
- Dedicated
bus for I/O devices
- Reduces
CPU load
Interrupt Handling
Mechanism
Interrupt Types
- Hardware
Interrupt
- Software
Interrupt
- Maskable
Interrupt
- Non-Maskable
Interrupt
Interrupt Sequence
- Save
PC
- Jump
to ISR
- Execute
ISR
- Return
to the main program
Advantages of
Proper I/O Organization
✔ Efficient data transfer
✔
Better CPU utilization
✔
Faster system performance
✔
Supports multiple devices
Bottlenecks in I/O
Organization
- Slow
I/O devices
- Bus
contention
- Interrupt
overhead
- Limited
buffer size
0 Comments