CH08 COA11e
CH08 COA11e
Chapter 8
Input/Output
Copyright © 2019, 2016, 2013 Pearson Education, Inc. All Rights Reserved
Figure 8.1
Generic Model of an I/O Module
Copyright © 2019, 2016, 2013 Pearson Education, Inc. All Rights Reserved
External Devices
Three
• Provide a means of
exchanging data between
the external environment
categories:
and the computer • Human readable
• – Suitable for communicating with the
Attach to the computer by a
computer user
link to an I/O module – Video display terminals (VDTs), printers
– The link is used to exchange
control, status, and data • Machine readable
between the I/O module and
– Suitable for communicating with
the external device equipment
– Magnetic disk and tape systems,
• Peripheral device sensors and actuators
– An external device connected
to an I/O module • Communication
– Suitable for communicating with remote
devices such as a terminal, a machine
readable device, or another computer
Copyright © 2019, 2016, 2013 Pearson Education, Inc. All Rights Reserved
Figure 8.2
Block Diagram of an External Device
Copyright © 2019, 2016, 2013 Pearson Education, Inc. All Rights Reserved
Most common means of
computer/user interaction
Device communication
• Involves commands, status information, and data
Data buffering
• Performs the needed buffering operation to balance device and memory
speeds
Error detection
• Detects and reports transmission errors
Copyright © 2019, 2016, 2013 Pearson Education, Inc. All Rights Reserved
Figure 8.3
Block Diagram of an I/O Module
Copyright © 2019, 2016, 2013 Pearson Education, Inc. All Rights Reserved
Programmed I/O
Copyright © 2019, 2016, 2013 Pearson Education, Inc. All Rights Reserved
Table 8.1
I/O Techniques
Copyright © 2019, 2016, 2013 Pearson Education, Inc. All Rights Reserved
I/O Commands
• There are four types of I/O commands that an I/O module may
receive when it is addressed by a processor:
1) Control
– used to activate a peripheral and tell it what to do
2) Test
– used to test various status conditions associated with an I/O module and its
peripherals
3) Read
– causes the I/O module to obtain an item of data from the peripheral and place it in an
internal buffer
4) Write
– causes the I/O module to take an item of data from the data bus and subsequently
transmit that data item to the peripheral
Copyright © 2019, 2016, 2013 Pearson Education, Inc. All Rights Reserved
Figure 8.4
Three Techniques for Input of a Block of Data
Copyright © 2019, 2016, 2013 Pearson Education, Inc. All Rights Reserved
I/O Instructions
With programmed I/O there is a close correspondence between the I/O-
related instructions that the processor fetches from memory and the I/O
commands that the processor issues to an I/O module to execute the
instructions
• The form of the instruction depends on the way in which external devices are addressed
Each I/O device connected through I/O modules is given a unique identifier
or address
• When the processor issues an I/O command, the command contains the address of the desired
device
• Thus, each I/O module must interpret the address lines to determine if the command is for itself
Memory-mapped I/O
• There is a single address space for memory locations and I/O devices
• A single read line and a single write line are needed on the bus
Isolated I/O
• Alternatively, the bus may be equipped with memory read and write plus input and output
command lines.
• the command line specifies whether the address refers to a memory location or an I/O device.
Copyright © 2019, 2016, 2013 Pearson Education, Inc. All Rights Reserved
I/O Mapping Summary
• Memory mapped I/O
– Devices and memory share an address space
– I/O looks just like memory read/write
– No special commands for I/O
▪ Large selection of memory access commands available
• Isolated I/O
– Separate address spaces
– Need I/O or memory select lines
– Special commands for I/O
▪ Limited set
Copyright © 2019, 2016, 2013 Pearson Education, Inc. All Rights Reserved
Figure 8.5
Memory-Mapped and Isolated I/O
Copyright © 2019, 2016, 2013 Pearson Education, Inc. All Rights Reserved
Interrupt-Driven I/O
The problem with programmed I/O is that the
processor has to wait a long time for the I/O
module to be ready for either reception or
transmission of data
Copyright © 2019, 2016, 2013 Pearson Education, Inc. All Rights Reserved
Figure 8.6
Simple Interrupt Processing
Copyright © 2019, 2016, 2013 Pearson Education, Inc. All Rights Reserved
Figure 8.7
Changes in Memory and Registers for an
Interrupt
Copyright © 2019, 2016, 2013 Pearson Education, Inc. All Rights Reserved
Design Issues
• Because there
will be multiple
I/O modules how
does the
Two design processor
determine which
issues arise device issued
in the interrupt?
implementin • If multiple
g interrupt interrupts have
I/O: occurred how
does the
processor decide
which one to
process?
Copyright © 2019, 2016, 2013 Pearson Education, Inc. All Rights Reserved
Device Identification
Four general categories of techniques are in common use:
• Multiple interrupt lines
– Between the processor and the I/O modules
– Most straightforward approach to the problem
– Consequently even if multiple lines are used, it is likely that each line will have multiple
I/O modules attached to it
• Software poll
– When the processor detects an interrupt it branches to an interrupt-service routine
whose job is to poll each I/O module to determine which module caused the interrupt
– Time consuming
• Daisy chain (hardware poll, vectored)
– The interrupt acknowledge line is daisy chained through the modules
– Vector – address of the I/O module or some other unique identifier
– Vectored interrupt – processor uses the vector as a pointer to the appropriate device-
service routine, avoiding the need to execute a general interrupt-service routine first
• Bus arbitration (vectored)
– An I/O module must first gain control of the bus before it can raise the interrupt request
line
– When the processor detects the interrupt it responds on the interrupt acknowledge line
– Then the requesting Copyright © 2019, 2016, 2013 Pearson Education, Inc. All Rights Reserved
module places its vector on the data lines
Figure 8.8
Use of the 82C59A Interrupt Controller
Copyright © 2019, 2016, 2013 Pearson Education, Inc. All Rights Reserved
Figure 8.9
The Intel 8255A Programmable Peripheral
Interface
Copyright © 2019, 2016, 2013 Pearson Education, Inc. All Rights Reserved
Figure 8.10
The Intel 8255A Control Word
Copyright © 2019, 2016, 2013 Pearson Education, Inc. All Rights Reserved
Figure 8.11
Keyboard/Display Interface to 8255A
Copyright © 2019, 2016, 2013 Pearson Education, Inc. All Rights Reserved
Drawbacks of Programmed and Interrupt-
Driven I/O
Copyright © 2019, 2016, 2013 Pearson Education, Inc. All Rights Reserved
Figure 8.12
Typical DMA Block Diagram
Copyright © 2019, 2016, 2013 Pearson Education, Inc. All Rights Reserved
Figure 8.13
DMA and Interrupt Breakpoints during an
Instruction Cycle
Copyright © 2019, 2016, 2013 Pearson Education, Inc. All Rights Reserved
Figure 8.14
Alternative DMA Configurations
Copyright © 2019, 2016, 2013 Pearson Education, Inc. All Rights Reserved
Figure 8.15
8237 DMA Usage of System Bus
Copyright © 2019, 2016, 2013 Pearson Education, Inc. All Rights Reserved
Fly-By DMA Controller
Copyright © 2019, 2016, 2013 Pearson Education, Inc. All Rights Reserved
Table 8.2
Intel 8237A Registers
Bit Command Status Mode Single Mask All Mask
E/D = enable/disable
TC = terminal count
Copyright © 2019, 2016, 2013 Pearson Education, Inc. All Rights Reserved
Direct Cache Access (DCA)
Copyright © 2019, 2016, 2013 Pearson Education, Inc. All Rights Reserved
Figure 8.16
Xeon E5-2600/4600 Chip Architecture
Copyright © 2019, 2016, 2013 Pearson Education, Inc. All Rights Reserved
Cache-Related Performance Issues (1 of 2)
Network traffic is transmitted in the form of a sequence of protocol blocks called packets or
protocol data units
The lowest, or link, level protocol is typically Ethernet, so that each arriving and departing
block of data consists of an Ethernet packet containing as payload the higher-level protocol
packet
The higher-level protocols are usually the Internet Protocol (IP), operating on top of
Ethernet and the Transmission Control Protocol (TCP), operating on top of IP
The Ethernet payload consists of a block of data with a TCP header and an IP header
For outgoing data, Ethernet packets are formed in a peripheral component, such as in I/O
controller or network interface controller (NIC)
For incoming traffic, the I/O controller strips off the Ethernet information and delivers the TCP/IP
packet to the host CPU
Copyright © 2019, 2016, 2013 Pearson Education, Inc. All Rights Reserved
Cache-Related Performance Issues (2 of 2)
Incoming • Outgoing
• Packet arrives
• Packet transfer requested
• DMA
• Packet created
• NIC interrupts host
• Output operation invoked
• Retrieve descriptors and
headers • DMA transfer
• Cache miss occurs • NIC signals completion
• Header is processed • Driver frees buffer
• Payload transferred
Copyright © 2019, 2016, 2013 Pearson Education, Inc. All Rights Reserved
Figure 8.17
Comparison of DMA and DDIO
Copyright © 2019, 2016, 2013 Pearson Education, Inc. All Rights Reserved
Evolution of the I/O Function
1. The CPU directly controls a 4. The I/O module is given direct
peripheral device. access to memory via DMA. It can
now move a block of data to or
2. A controller or I/O module from memory without involving the
is added. The CPU uses CPU, except at the beginning and
programmed I/O without end of the transfer.
interrupts.
5. The I/O module is enhanced to
3. Same configuration as in become a processor in its own
step 2 is used, but now right, with a specialized instruction
interrupts are employed. set tailored for I/O
The CPU need not spend
time waiting for an I/O 6. The I/O module has a local
operation to be performed, memory of its own and is, in fact, a
thus increasing efficiency. computer in its own right. With this
architecture a large set of I/O
devices can be controlled with
minimal CPU involvement.
Copyright © 2019, 2016, 2013 Pearson Education, Inc. All Rights Reserved
Figure 8.18
I/O Channel Architecture
Copyright © 2019, 2016, 2013 Pearson Education, Inc. All Rights Reserved
External
Interconnection
Standards
Copyright © 2019, 2016, 2013 Pearson Education, Inc. All Rights Reserved
Universal Serial Bus (USB)
• Widely used for peripheral connections
• Is the default interface for slower speed devices
• Commonly used high-speed I/O
• Has gone through multiple generations
– USB 1.0
▪ Defined a Low Speed data rate of 1.5 Mbps and a Full Speed rate of 12 Mbps
– USB 2.0
▪ Provides a data rate of 480 Mbps
– USB 3.0
▪ Higher speed bus called SuperSpeed in parallel with the USB 2.0 bus
▪ Signaling speed of SuperSpeed is 5 Gbps, but due to signaling overhead the usable data rate is up to
4 Gbps
– USB 3.1
▪ Includes a faster transfer mode called SuperSpeed+
▪ This transfer mode achieves a signaling rate of 10 Gbps and a theoretical usable data rate of 9.7 Gbps
Copyright © 2019, 2016, 2013 Pearson Education, Inc. All Rights Reserved
InfiniBand
Copyright © 2019, 2016, 2013 Pearson Education, Inc. All Rights Reserved
PCI Express and SATA
PCI Express • SATA
• High-speed bus system for • Serial Advanced Technology
connecting peripherals of a Attachment
wide variety of types and • An interface for disk storage
speeds systems
• Provides data rates of up to 6
Gbps, with a maximum per
device of 300 Mbps
• Widely used in desktop
computers and in industrial
and embedded applications
Copyright © 2019, 2016, 2013 Pearson Education, Inc. All Rights Reserved
Ethernet
• Predominant wired
networking technology
• Has moved from bus-based to
• Has evolved to support data switch-based
rates up to 100 Gbps and – Data rate has periodically
distances from a few meters increased by an order of
to tens of km magnitude
• Has become essential for – There is a central switch
supporting personal with all of the devices
computers, workstations, connected directly to the
servers, and massive data switch
storage devices in
organizations large and small • Ethernet systems are currently
available at speeds up to 100
• Began as an experimental Gbps
bus-based 3-Mbps system
Copyright © 2019, 2016, 2013 Pearson Education, Inc. All Rights Reserved
Wi-Fi
• Is the predominant wireless • As the technology of
Internet access technology antennas, wireless
transmission techniques, and
• Now connects computers, wireless protocol design has
tablets, smart phones, and evolved, the IEEE 802.11
other electronic devices such committee has been able to
as video cameras TVs and introduce standards for new
thermostats versions of Wi-Fi at higher
• speeds
In the enterprise has become
an essential means of • Current version is 802.11ac
enhancing worker productivity (2014) with a maximum data
and network effectiveness rate of 3.2 Gbps
• Public hotspots have expanded
dramatically to provide free
Internet access in most public
places
Copyright © 2019, 2016, 2013 Pearson Education, Inc. All Rights Reserved
Summary
•Input/
Chapter 8 Output
• Direct Cache Access
• External devices
• I/O channels and
• I/O modules processors
• Programmed I/O • External
interconnection
• Interrupt-driven I/O standards
• Direct memory
access
Copyright © 2019, 2016, 2013 Pearson Education, Inc. All Rights Reserved
Copyright
This work is protected by United States copyright laws and is provided solely
for the use of instructions in teaching their courses and assessing student
learning. dissemination or sale of any part of this work (including on the
World Wide Web) will destroy the integrity of the work and is not permit-
ted. The work and materials from it should never be made available to
students except by instructors using the accompanying text in their
classes. All recipients of this work are expected to abide by these
restrictions and to honor the intended pedagogical purposes and the needs of
other instructors who rely on these materials.
Copyright © 2019, 2016, 2013 Pearson Education, Inc. All Rights Reserved