You are on page 1of 9

Overview

Input / Output modules are the third


critical element of the computer system
(others are the CPU and the memory)
All computer systems must have efficient
EE 4504 means to receive input and deliver output
– Failure to address I/O concerns has doomed
Computer Organization many otherwise good systems
We will look at
– I/O modules and their interface to the rest of
the system
Section 4
– I/O mechanisms
Input / Output – Example interfaces
Reading: Text, Chapter 6

EE 4504 Section 4 1 EE 4504 Section 4 2

1
I/O Modules

External devices are not generally


connected directly into the bus structure of
the computer
– Wide variety of devices require different logic
interfaces -- impractical to expect CPU to
“know how” to control each device
– Mismatch of data rates
– Different data representations
The I/O module
– Provides a standard interface to the CPU and
the bus
– Tailored to specific I/O device and its interface
requirements
– Relieves the CPU of the management of the I/O
devices
– Interface consists of
» Control
» Status and
» Data signals Figure 6.3 I/O Module block diagram

EE 4504 Section 4 3 EE 4504 Section 4 4

2
Programmed I/O
Advantages
I/O operation in which CPU issues the I/O – Simple to implement
command to the I/O module – Requires very little special software or
CPU is in direct control of the operation hardware
– CPU waits until the I/O operation is completed
before it can perform other tasks
– Completion indicated by a change in the
module status bits
– CPU must periodically poll the module to check
its status
As a result of the speed difference between
a CPU and the peripheral devices (orders
of magnitude), programmed I/O wastes an
enormous amount of CPU processing
power
– Very inefficient
– CPU slowed to the speed of the peripheral

Figure 6.4a Programmed I/O operation


EE 4504 Section 4 5 EE 4504 Section 4 6

3
Interrupt-Driven I/O

I/O addressing To reduce the time spent on I/O operations,


– Isolated (standard) I/O the CPU can use an interrupt-driven
» Address space of the I/O modules is approach
isolated from the memory address space – CPU issues I/O command to the module
» Separate instructions in the instruction set – CPU continues with its other tasks while the
are used to perform I/O module performs its task
» Typical control lines include the read/write – Module signals the CPU when the I/O operation
lines plus an IO/M line to switch address is finished (the interrupt)
reference between memory space and I/O – CPU responds to the interrupt by executing an
space interrupt service routine and then continues on
– Memory mapped I/O with its primary task
» I/O devices are integrated into the normal CPU recognizes and responds to interrupts
memory address space
at the end of an instruction execution cycle
» All of the memory accessing instructions
can be used to access the I/O peripherals Interrupt technique is used to support a
» “Cost” is the loss of “real” memory wide variety of devices
addresses
Not a big problem today with the huge
address spaces in current systems

EE 4504 Section 4 7 EE 4504 Section 4 8

4
Figure 6.4b Interrupt-driven I/O Figure 6.6 CPU’s response to an interrupt

EE 4504 Section 4 9 EE 4504 Section 4 10

5
Design issues -- with multiple modules and
thus multiple interrupts
– How does the CPU determine which device
caused the interrupt?
– If multiple interrupts occur at the same time,
which is processed first?
Interrupt determination
– Provide multiple interrupt signal lines for a
system
» Practical only for small numbers of
interrupts
– Use 1 interrupt for more than 1 device
» Must perform some sort of device polling to
determine which requested service
» Requesting device can place an ID on the
bus -- vectored interrupts
» Bus arbitration and vectored interrupts
Determination scheme prioritizes multiple
interrupts
Intel 8259 Interrupt Controller

EE 4504 Section 4 11 EE 4504 Section 4 12

6
Direct Memory Access

Both programmed and interrupt driven I/O


require the continued involvement of the
CPU in ongoing I/O operations
Direct memory accessing takes the CPU
out of the task except for initialization of
the operation
Large amounts of data can be transferred
between memory and the peripheral w/o
severely impacting CPU performance
– CPU initializes DMA module
» Read or write operation defined
» I/O device involved
» Starting address of memory block
» Number of words to be transferred
– CPU then continues with other work

Figure 6.4c Direct memory accessing I/O

EE 4504 Section 4 13 EE 4504 Section 4 14

7
External Interface
DMA operates by “stealing” bus cycles
from the CPU The external interface, made with the I/O
– In practice, it uses the bus when the CPU is not module, must be tailored to the nature and
using it -- no impact on the CPU performance operation of the peripheral
– Accesses memory to retrieve a data word – Parallel vs. serial data transfers
– Forwards the word to the I/O peripheral – Data format conversions
– Transfer rates
– Number of devices supported
Examples
– RS-232 serial ports
– Game ports
– High speed I/O buses
» Support external mass storage devices and
multimedia devices

Figure 6.13 DMA configurations


EE 4504 Section 4 15 EE 4504 Section 4 16

8
Small Computer System Interface (SCSI) P1394 High Performance Serial Bus
– Introduced by Apple in 1984 – High speed, low cost serial link
– Used to interface a wide variety of high speed – Gaining support in consumer electronics
devices to the computer system products as well as computer systems
– While called a “bus” it is really a mechanism to – Deliberately move away from parallel
daisy chain devices together connections with associated high cable and
– SCSI-1 connector costs
» Used 8-bit data bus width – Provide high speed serial link (25-400 Mbps)
» 5 MHz clock -- transfer rate of 5 MB/sec that is able to connect to many devices
» Supported up to 7 devices (compare to the 2 – Daisy chain up to 63 devices together on 1 bus,
of a typical IDE configuration) interconnect up to 1022 buses together through
bridging techniques
– SCSI-2
– Communication is based on a 3-layer protocol
» Current standard
» Physical layer
» Expands the bus width to 16 or 32 bits
» Link layer
» Clock rate of 10 MHz
» Transaction layer
» Supports wide variety of device types,
making I/O software in the host simplier

EE 4504 Section 4 17 EE 4504 Section 4 18

You might also like