Computer Architecture · Unit 8 · 4 hrs
Input Output Organization
Exam-focused notes for Input Output Organization (Computer Architecture, CSC213): what the TU syllabus asks and how it has actually been tested, with 11 solved past questions from this unit.
Input Output Organization in short
Peripherals, keyboards, disks, printers and network links, run at very different speeds and use very different signalling conventions from the CPU and memory they must exchange data with. This chapter covers the interface hardware and transfer strategies that bridge that gap, from a single polled byte up to a whole channel of DMA traffic.
What this unit covers
- Input-Output Interface: I/O Bus and Interface Modules, I/O vs. Memory Bus, Isolated vs. Memory-Mapped I/O
- Asynchronous Data Transfer: Strobe, Handshaking
- Modes of Transfer: Programmed I/O, Interrupt-Initiated I/O, Direct memory Access
- Priority Interrupt: Polling, Daisy-Chaining, Parallel Priority Interrupt
- Direct Memory Access, Input-Output Processor, DMA vs. IOP
Priority Interrupt
2081 · 10 marks
What do you understand by priority interrupt? Explain polling, daisy-chaining and parallel priority interrupt.[10]
Modes of Transfer
2081 · 5 marks
Why I/O interface is important? Discuss the concept of programmed I/O with suitable flowchart. [5]
2077 · 10 marks
Define I/O interface. Comparison between programmed I/O, Interrupt driven I/O and direct memory access (DMA).[10]
Direct Memory Access, Input-Output Processor, DMA vs. IOP
2080 · 10 marks
What is DMA? Explain the DMA controller with block diagram. How the DMA interact with I/O device.[10]
Show solved answerHide answer
Direct Memory Access (DMA)
Definition
Direct Memory Access (DMA) is a process for data transfer between memory and I/O devices, controlled by an external circuit called the DMA controller, without the involvement of the CPU. Most data that is input or output from a computer is processed by the CPU, but some data does not require CPU processing or can be processed by another device. In these situations, DMA saves processing time and is a more efficient way to move data from the computer's memory to other devices.
Example: A PCI controller and a hard drive controller each have their own set of DMA channels.
Block Diagram of DMA Controller
+------------------+
| CPU |
| (HOLD) (HLDA) |
+--------+---------+
|
+--------+---------+
| System Buses |
| (Address / Data) |
+--+----------+----+
| |
+--------+--+ +--+--------+
| Memory | | DMA |
| (RAM) | | Controller|
+--------+--+ +--+---+----+
| |
BR/BG RS/DS
| |
+----+---+----+
| I/O Device |
| (Peripheral)|
+-------------+
Internal Structure of DMA Controller
+-----------------------------------------------+
| DMA Controller |
| |
| +------------------+ +------------------+ |
| | Address Register | | Word Count Reg | |
| +------------------+ +------------------+ |
| |
| +------------------+ +------------------+ |
| | Data Register | | Control/Status | |
| +------------------+ | Register | |
| +------------------+ |
| |
| Control Lines: BR, BG, RD, WR, RS, DS |
+-----------------------------------------------+
Key Registers in DMA Controller
| Register | Purpose |
|---|---|
| Address Register | Holds the memory address for data transfer |
| Word Count Register | Holds the number of words to be transferred |
| Data Register | Temporarily holds data during transfer |
| Control/Status Register | Stores control bits and status of transfer |
Control Signals Used in DMA Operation
The CPU has two special pins used for DMA operation:
1. Bus Request (BR)
- Used by the DMA controller to request the CPU to release the buses.
- When BR is active, the CPU:
- Terminates execution of the current instruction
- Places the address bus, data bus, and read/write lines into high impedance state
2. Bus Grant (BG)
- CPU activates the BG output to inform the DMA that buses are now available.
- DMA takes control and conducts memory transfers without CPU involvement.
- When DMA finishes the transfer:
- It disables the BR line
- CPU disables BG and returns to normal operation
Sequence of Events During DMA Operation
Step 1: I/O device sends DMA Request to DMA Controller
|
Step 2: DMA Controller activates BR line --> CPU
|
Step 3: CPU completes current instruction, releases buses
CPU activates BG line --> DMA
|
Step 4: DMA puts address register value onto Address Bus
DMA initiates RD and WR signals
DMA sends DMA Acknowledge to I/O device
|
Step 5: Data transfer takes place between Memory and I/O
(without CPU involvement)
|
Step 6: DMA disables BR line after transfer completes
CPU disables BG and resumes normal operation
How DMA Interacts with I/O Devices
The interaction between DMA and I/O devices follows the steps below (based on the DMA transfer mechanism):
Step-by-Step Interaction
-
CPU Initiates the Setup:
- The CPU communicates with the DMA controller through the address and data buses.
- The DMA has its own address, which activates the RS (Register Select) and DS (DMA Select) lines.
- CPU loads the DMA controller with:
- Starting memory address
- Word count (number of words to transfer)
- Direction of transfer (read/write)
-
I/O Device Sends DMA Request:
- When a peripheral device is ready for data transfer, it sends a DMA Request signal to the DMA controller.
-
DMA Requests the Bus:
- The DMA controller activates the BR (Bus Request) line, informing the CPU to release the buses.
-
CPU Grants the Bus:
- The CPU responds by activating BG1 (Bus Grant) line.
- When BG1 = 0: RD and WR signals allow the CPU to communicate with internal DMA registers.
- When BG1 = 1: DMA communicates with RAM through RD and WR lines directly.
-
DMA Performs the Transfer:
- DMA puts the current value of its address register onto the address bus.
- Initiates RD and WR signals as required.
- Sends a DMA Acknowledge to the peripheral device.
- Data is transferred directly between I/O device and Memory.
-
Transfer Completion:
- After all words are transferred (word count reaches zero), DMA disables the BR line.
- CPU regains control of the buses and resumes normal operation.
Types of DMA Transfer
| Type | Description |
|---|---|
| Burst Transfer | DMA takes control of the bus and transfers a block of data at once before returning control to CPU |
| Cycle Stealing | DMA transfers one word at a time, stealing one bus cycle from the CPU, then returns control |
Summary
DMA is an efficient I/O technique that lets a peripheral device transfer data directly to and from memory without CPU intervention on every word, using the DMA controller as a temporary bus master to drive the address and control lines. This significantly speeds up bulk data transfers compared to programmed I/O, since the CPU is freed to execute other instructions while the transfer proceeds in the background and is only notified (typically by an interrupt) once the transfer is complete.
2079 · 5 marks
Explain Direct Memory Access with suitable diagram. [5]
2078 · 5 marks
What are the major differentiate between Input-output processor (IOP) and direct memory Access (DMA) [5]
Show solved answerHide answer
Differences Between Input-Output Processor (IOP) and Direct Memory Access (DMA)
Brief Introduction
DMA (Direct Memory Access) is a data transfer mechanism between memory and I/O devices controlled by an external DMA controller circuit, without CPU involvement during the actual transfer.
IOP (Input-Output Processor) is a more advanced processor with direct memory access capability that can execute its own channel programs stored in main memory, communicating independently with I/O devices.
Major Differences
| Feature | DMA | IOP |
|---|---|---|
| Intelligence / Capability | A simple controller circuit; can only transfer data between memory and I/O devices | A full processor; can execute a set of instructions called a channel program stored in main memory |
| Program Execution | Cannot execute programs; only performs data transfer operations | Can execute a channel program independently once initiated by the CPU |
| CPU Involvement | CPU must set up the DMA controller (source, destination, count) before each transfer | CPU only issues a channel I/O class instruction to initiate; after that, IOP operates completely independently |
| Bus Control Method | Uses HOLD/HLDA signals (Bus Request BR and Bus Grant BG) to take control of the bus from the CPU | Accesses memory using cycle stealing, without fully taking over the bus |
| Complexity | Simpler in design and functionality | More complex; essentially a dedicated I/O processor |
| Flexibility | Limited to simple block data transfers | Highly flexible; can handle complex I/O operations through programmable channel programs |
| Interaction with CPU | Interrupts CPU via HOLD line; CPU places buses in high impedance state during burst transfer or cycle stealing | Once initiated, the channel (IOP) operates independently of the CPU with minimal interruption |
| Transfer Modes | Supports Burst Transfer and Cycle Stealing | Primarily uses Cycle Stealing to access main memory |
| Use Case | Suitable for simple, high-speed bulk data transfers (e.g., hard disk to memory) | Suitable for managing multiple, complex I/O devices simultaneously |
Summary
DMA is a hardware controller that temporarily takes over the system bus to transfer data directly between memory and I/O without CPU processing. IOP is a dedicated processor that goes further by executing its own channel programs stored in memory, managing I/O operations fully independently after a single initiation command from the CPU. IOP is therefore a superset of DMA functionality.
2075 · 5 marks
How does DMA controller work? Give an example of DMA data transfer. [5]
2075.1 · 6 marks
What are the major differentiate between Input-output processor (IOP) and direct memory Access (DMA) [6]
Show solved answerHide answer
Differences Between Input-Output Processor (IOP) and Direct Memory Access (DMA)
Brief Introduction
DMA (Direct Memory Access): A process for data transfer between memory and I/O devices, controlled by an external circuit called the DMA controller, without the involvement of the CPU.
IOP (Input-Output Processor): A processor with direct memory access capability that communicates with I/O devices. It can execute its own channel programs stored in main memory, operating independently once initiated by the CPU.
Major Differences
| Feature | DMA | IOP |
|---|---|---|
| Definition | A hardware mechanism that transfers data between memory and I/O without CPU involvement | A dedicated processor that handles I/O operations and can execute channel programs independently |
| Intelligence / Capability | Limited; can only perform simple block data transfers | More intelligent; can execute a full set of I/O instructions (channel programs) |
| Program Execution | Cannot execute programs; only performs data transfer | Can execute a channel program stored in main memory |
| CPU Interaction | Requests bus via BR (Bus Request) signal; CPU responds with BG (Bus Grant) and releases the bus | CPU initiates the channel using a channel I/O class instruction; after that, IOP operates completely independently |
| Bus Control | Takes control of the bus temporarily using HOLD and HLDA pins (cycle stealing or burst transfer) | Accesses memory by cycle stealing but operates as a separate processor |
| Complexity | Simpler in design and function | More complex; essentially a separate processor with its own instruction set |
| Flexibility | Less flexible; designed for specific, straightforward data transfers | More flexible; can handle complex I/O operations through programmable channel programs |
| Dependency on CPU | Requires CPU to set up transfer parameters (source, destination, count) each time | Once initiated, operates fully independently of the CPU |
| Cost | Less expensive to implement | More expensive due to added processing capability |
| Example Use | Hard drive controller, PCI controller data transfers | Large mainframe systems handling multiple complex I/O channels |
Summary
DMA is a simpler, hardware-controlled mechanism that temporarily borrows the system bus from the CPU to transfer data directly between memory and I/O devices. IOP is a more powerful, programmable processor that can independently manage complex I/O operations by executing channel programs stored in main memory, requiring minimal CPU intervention after initiation.
Input-Output Interface
2077 · 5 marks
Differentiate between isolated versus memory mapped I/O. [5]
2075.1 · 10 marks
What is input output interface? Differentiate between Input-output bus and memory bus?[10]
2075.1 · 6 marks
Differentiate between I/O bus and interface modules. [6]
Make Unit 8 stick
Practice CSC213 with flashcards & quizzes