• Input-Output interface provides a method for transferring information between internal storage (such as memory and CPU registers) and external I/O devices.
  • Peripherals connected to a computer need special communication links for interfacing them with the central processing unit.
  • The communication link resolves the following differences between the computer and peripheral devices.

             o Devices and signals

                Peripherals - Electromechanical Devices

                CPU or Memory - Electronic Device

            o  Data Transfer Rate

                Peripherals-Usually slower

                CPU or Memory- Usually faster than peripherals

                Some kinds of Synchronization mechanism may be needed

             o Unit of Information

                Peripherals-Byte

                CPU or Memory - Word

             o Operating Modes

               Peripherals - Autonomous, Asynchronous

               CPU or Memory – Synchronous

  • To resolve these differences, computer systems include special hardware components (Interfaces) between the CPU and peripherals to supervise and synchronize all input and output interfaces.

I/O Bus and Interface Modules


  • The I/O bus consists of data lines, address lines and control lines.

           

                                         Fig: Connection of I/O bus to input-output devices

  • Interface performs the following:
    • Decodes the device address (device code)
    • Decodes the commands (operation)
    • Provides signals for the peripheral controller
    • Synchronizes the data flow and supervises the transfer rate between peripheral and CPU or Memory
  • I/O commands that the interface may receive:
    • Control command: issued to activate the peripheral and to inform it what to do.
    • Status command: used to test various status conditions in the interface and the peripheral.
    • Output data: causes the interface to respond by transferring data from the bus into one of its registers.
    • Input data: is the opposite of the data output.

I/O versus Memory Bus

  • Computer buses can be used to communicate with memory and I/O in three ways:
    • Use two separate buses, one for memory and other for I/O. In this method, all data, address and control lines would be separate for memory and I/O.
    • Use one common bus for both memory and I/O but have separate control lines. There is a separate read and write lines; I/O read and I/O write for I/O and memory read and memory write for memory.
    • Use a common bus for memory and I/O with common control line. This I/O configuration is called memory mapped.

Isolated I/O versus Memory Mapped I/O

  • Isolated I/O
    • Separate I/O read/write control lines in addition to memory read/write control lines
    • Separate (isolated) memory and I/O address spaces
    • Distinct input and output instructions

Memory-mapped I/O

  • A single set of read/write control lines (no distinction between memory and I/O transfer)
  • Memory and I/O addresses share the common address space which reduces memory address range available
  • No specific input or output instruction so the same memory reference instructions can be used for I/O transfers
  • Considerable flexibility in handling I/O operations

Example of I/O Interface

                                          

  • Information in each port can be assigned a meaning depending on the mode of operation of the I/O device
    • Port A = Data; Port B = Command; Port C = Status
  • CPU initializes (loads) each port by transferring a byte to the Control Register
    • Allows CPU can define the mode of operation of each port
    • Programmable Port: By changing the bits in the control register, it is possible to change the interface characteristics