8 Input Output Organization

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.

Input Output Organization: notes

Input-Output Interface: I/O Bus and Interface Modules, I/O vs. Memory Bus, Isolated vs. Memory-Mapped I/O

An I/O interface resolves the mismatches between the CPU and its peripherals: peripherals transfer data far more slowly than the CPU runs, their operating modes differ from one device to the next, their data codes and word formats differ from the CPU's own, and they are electromechanical or electromagnetic devices operating quite differently from the CPU's purely electronic circuitry. Peripherals attach to the CPU through a special communication link, the I/O bus, carrying data, address and control lines to every interface module; each interface module decodes its device's address, decodes the I/O command on the control lines, generates the signals the peripheral controller needs, synchronizes the data flow, and supervises the transfer rate between the peripheral and the CPU. The control lines carry one of four I/O commands: a control command (activates the peripheral and tells it what to do), a status command (tests conditions such as an error or a completed transfer), a data input command (reads data from the peripheral into the interface buffer), and a data output command (writes data from the bus into the interface buffer for the peripheral).

Three arrangements are possible for the I/O bus versus the memory bus: two entirely separate buses, one for memory and one for I/O; one shared bus with separate control lines for each; or one shared bus with common control lines for both. Isolated I/O keeps distinct address spaces and distinct instructions for memory and for I/O devices, so device registers never take addresses away from memory, at the cost of needing separate input/output instructions (such as IN and OUT) alongside ordinary memory-reference instructions. Memory-mapped I/O instead gives device registers ordinary addresses within the single memory address space, so any memory-reference instruction can read or write a device register directly, simplifying the instruction set at the cost of reserving part of the memory address space for devices.

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]

A priority interrupt is a system that establishes a priority among various interrupt sources so that when two or more devices request an interrupt simultaneously, the CPU can identify and service the highest-priority device first, and then handle lower-priority devices in order. --- When multiple...

Open this answer on its own page →

Modes of Transfer

2081 · 5 marks

Why I/O interface is important? Discuss the concept of programmed I/O with suitable flowchart. [5]

--- Peripherals connected to a computer need a special communication link to interface with the CPU. This special link is called the I/O bus. The I/O interface is important for the following reasons: 1. Speed Mismatch: Peripheral devices (keyboard, printer, disk) operate at much slower speeds tha...

Open this answer on its own page →

2077 · 10 marks

Define I/O interface. Comparison between programmed I/O, Interrupt driven I/O and direct memory access (DMA).[10]

--- An Input/Output (I/O) Interface provides a method for transferring information between internal storage (CPU/Memory) and external I/O devices (peripherals). It is needed because several differences exist between the computer and peripheral devices: Difference Explanation ------ Speed mismatch...

Open this answer on its own page →

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 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

RegisterPurpose
Address RegisterHolds the memory address for data transfer
Word Count RegisterHolds the number of words to be transferred
Data RegisterTemporarily holds data during transfer
Control/Status RegisterStores 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

  1. 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)
  2. 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.
  3. DMA Requests the Bus:

    • The DMA controller activates the BR (Bus Request) line, informing the CPU to release the buses.
  4. 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.
  5. 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.
  6. 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

TypeDescription
Burst TransferDMA takes control of the bus and transfers a block of data at once before returning control to CPU
Cycle StealingDMA 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.

Open this answer on its own page →

2079 · 5 marks

Explain Direct Memory Access with suitable diagram. [5]

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. It is especially useful for bulk data transfers, such as data transfer between memory and a hard disk. Most da...

Open this answer on its own page →

2078 · 5 marks

What are the major differentiate between Input-output processor (IOP) and direct memory Access (DMA) [5]

Show solved 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

FeatureDMAIOP
Intelligence / CapabilityA simple controller circuit; can only transfer data between memory and I/O devicesA full processor; can execute a set of instructions called a channel program stored in main memory
Program ExecutionCannot execute programs; only performs data transfer operationsCan execute a channel program independently once initiated by the CPU
CPU InvolvementCPU must set up the DMA controller (source, destination, count) before each transferCPU only issues a channel I/O class instruction to initiate; after that, IOP operates completely independently
Bus Control MethodUses HOLD/HLDA signals (Bus Request BR and Bus Grant BG) to take control of the bus from the CPUAccesses memory using cycle stealing, without fully taking over the bus
ComplexitySimpler in design and functionalityMore complex; essentially a dedicated I/O processor
FlexibilityLimited to simple block data transfersHighly flexible; can handle complex I/O operations through programmable channel programs
Interaction with CPUInterrupts CPU via HOLD line; CPU places buses in high impedance state during burst transfer or cycle stealingOnce initiated, the channel (IOP) operates independently of the CPU with minimal interruption
Transfer ModesSupports Burst Transfer and Cycle StealingPrimarily uses Cycle Stealing to access main memory
Use CaseSuitable 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.

Open this answer on its own page →

2075 · 5 marks

How does DMA controller work? Give an example of DMA data transfer. [5]

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 direct involvement of the CPU. It saves CPU processing time and provides a more efficient way to move data. --- The DMA controller use...

Open this answer on its own page →

2075.1 · 6 marks

What are the major differentiate between Input-output processor (IOP) and direct memory Access (DMA) [6]

Show solved 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

FeatureDMAIOP
DefinitionA hardware mechanism that transfers data between memory and I/O without CPU involvementA dedicated processor that handles I/O operations and can execute channel programs independently
Intelligence / CapabilityLimited; can only perform simple block data transfersMore intelligent; can execute a full set of I/O instructions (channel programs)
Program ExecutionCannot execute programs; only performs data transferCan execute a channel program stored in main memory
CPU InteractionRequests bus via BR (Bus Request) signal; CPU responds with BG (Bus Grant) and releases the busCPU initiates the channel using a channel I/O class instruction; after that, IOP operates completely independently
Bus ControlTakes 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
ComplexitySimpler in design and functionMore complex; essentially a separate processor with its own instruction set
FlexibilityLess flexible; designed for specific, straightforward data transfersMore flexible; can handle complex I/O operations through programmable channel programs
Dependency on CPURequires CPU to set up transfer parameters (source, destination, count) each timeOnce initiated, operates fully independently of the CPU
CostLess expensive to implementMore expensive due to added processing capability
Example UseHard drive controller, PCI controller data transfersLarge 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.

Open this answer on its own page →

Input-Output Interface

2077 · 5 marks

Differentiate between isolated versus memory mapped I/O. [5]

Isolated I/O and Memory-Mapped I/O are two different techniques used by a CPU to communicate with I/O devices. They differ primarily in how address spaces and instructions are organized. --- Feature Isolated I/O Memory-Mapped I/O --------- Instructions CPU has distinct input and output instructio...

Open this answer on its own page →

2075.1 · 10 marks

What is input output interface? Differentiate between Input-output bus and memory bus?[10]

An Input-Output (I/O) Interface is a hardware component that provides a method for transferring information between the internal storage (CPU and memory) of a computer and external peripheral (I/O) devices. It acts as a bridge that resolves the differences and incompatibilities between the comput...

Open this answer on its own page →

2075.1 · 6 marks

Differentiate between I/O bus and interface modules. [6]

An I/O bus is a shared communication pathway (set of wires/lines) that connects the CPU, memory, and multiple peripheral devices together. It carries data, address, and control signals between these components. Key characteristics of I/O Bus: Feature Description ------ Nature Physical communicati...

Open this answer on its own page →