Past exam question: 2082 Kartik (Back), Q8
Open in the Padhaiko appQuestion
Differentiate between Memory mapped I/O and I/O mapped I/O.
Solution
Architectural Comparison:
- Memory Mapped I/O: The I/O ports are treated as memory locations within the single unified 16-bit address space. Both memory and I/O share the 64 KB space, and the processor uses standard memory reference instructions and control signals (
MEMR_bar,MEMW_bar). - I/O Mapped I/O (Isolated I/O): The I/O ports exist in a completely separate 8-bit address space (256 input and 256 output ports). The processor differentiates I/O transfers from memory transfers using the
IO/M_barsignal and executes dedicated I/O instructions (IN,OUT).
Comparison Table:
| Feature | Memory Mapped I/O | I/O Mapped I/O (Isolated I/O) |
|---|---|---|
| Address Width | 16-bit address (A15–A0) | 8-bit address (A7–A0 replicated on A15–A8) |
| Address Space | Shares 64 KB address space with memory | Separate 256 input and 256 output ports |
| Control Signals | MEMR_bar, MEMW_bar (IO/M_bar = 0) | IOR_bar, IOW_bar (IO/M_bar = 1) |
| Instructions Used | Any memory instruction (MOV, LDA, STA, ADD M) | Only dedicated IN and OUT instructions |
| Data Register | Any general-purpose register | Only Accumulator (Reg A) |
| Hardware Decoding | Full 16-bit address decoding required | Simpler 8-bit address decoding |
| Memory Available | Reduces total memory addressable for RAM/ROM | Preserves full 64 KB memory space |
| Execution Speed | Usually 3 bytes / 13 T-states | 2 bytes / 10 T-states |
Answer:
Memory mapped I/O treats devices as memory using 16-bit addresses and standard memory instructions (reducing RAM/ROM space), while I/O mapped I/O uses an isolated 8-bit port space with dedicated IN/OUT instructions and IOR/IOW strobes.