chapter 8 input/output. busses l group of electrical conductors suitable for carrying computer...

43
Chapter 8 Input/Output

Upload: george-hodges

Post on 25-Dec-2015

217 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Chapter 8 Input/Output. Busses l Group of electrical conductors suitable for carrying computer signals from one location to another l Each conductor in

Chapter 8

Input/Output

Page 2: Chapter 8 Input/Output. Busses l Group of electrical conductors suitable for carrying computer signals from one location to another l Each conductor in

Busses

Group of electrical conductors suitable for carrying computer signals from one location to another

Each conductor in the bus is referred to as a line and carries a single signal - such as a bit in an address

Page 3: Chapter 8 Input/Output. Busses l Group of electrical conductors suitable for carrying computer signals from one location to another l Each conductor in

Line Categories

Data lines - carrying data from one location to another

Address lines - specify address of recipient Control lines - for synchronization of bus

and modules connected to bus Power lines - carry power to a module

Page 4: Chapter 8 Input/Output. Busses l Group of electrical conductors suitable for carrying computer signals from one location to another l Each conductor in

Typical Uses of Busses

Transfer data between CPU and memory

Transfer data between CPU and computer peripherals

Transfer data between different points within the CPU

Page 5: Chapter 8 Input/Output. Busses l Group of electrical conductors suitable for carrying computer signals from one location to another l Each conductor in

Point-to-Point Busses

Bus carries signals from a specific source to a specific destination

Example - cable connecting parallel or serial computer port to peripheral

Page 6: Chapter 8 Input/Output. Busses l Group of electrical conductors suitable for carrying computer signals from one location to another l Each conductor in

Multi-point Bus

Bus connects several points together Bus broadcasts a signal to every recipient on

the bus In most cases, an address accompanies the

signal in order to identify the desired destination

Example - Ethernet network connection

Page 7: Chapter 8 Input/Output. Busses l Group of electrical conductors suitable for carrying computer signals from one location to another l Each conductor in

Pt-to-Pt and Multi-Pt Busses

Page 8: Chapter 8 Input/Output. Busses l Group of electrical conductors suitable for carrying computer signals from one location to another l Each conductor in

CPU - I/O

A P-P bus may be used to connect CPU to memory

A M-P bus may connect CPU to memory and/or to I/O modules

Referred to as a backplane, system bus, external bus

Bridge - interface between different busses that allow them to communicate

Page 9: Chapter 8 Input/Output. Busses l Group of electrical conductors suitable for carrying computer signals from one location to another l Each conductor in

Typical PC Bus Connections

PCI - Peripheral Component Interface

AGP - Accelerated Graphics Processor

ISA - Industry Standard Architecture

EISA - Extended ISA

USB - Universal Serial Bus

VLB - Video Electronics Standards Bus

SCSI - Small Computer System Interface

IEEE 1395 Bus (FireWire)

RS232-C serial PC bus

Page 10: Chapter 8 Input/Output. Busses l Group of electrical conductors suitable for carrying computer signals from one location to another l Each conductor in

Characteristics of Busses

8-bit ISA 8 8.33 8.316-bit ISA 16 8.33 16.6EISA 32 8.33 33.3VLB 32 33 133.3PCI 32 33 133.364-bit PCI 64 66 533.3AGP 32 66 266.6AGP x2 32 66x2 533.3AGP x4 32 66x4 1,066.6

Bus Width Speed Bandwidth (bits) (MHz) (Mbytes/sec)

Page 11: Chapter 8 Input/Output. Busses l Group of electrical conductors suitable for carrying computer signals from one location to another l Each conductor in

PCI Bus

32- or 64-bit bus used in Suns, Apples, Compaq, Alpha, ...

Backplane bus interconnecting CPU and various plug-in I/O modules that control serial and parallel ports, sound cards, disks, …

CPU sends signals to bus via individual pins of the integrated circuit

Page 12: Chapter 8 Input/Output. Busses l Group of electrical conductors suitable for carrying computer signals from one location to another l Each conductor in

PCI Bus Connections

Page 13: Chapter 8 Input/Output. Busses l Group of electrical conductors suitable for carrying computer signals from one location to another l Each conductor in

Pentium III Bus Lines

Page 14: Chapter 8 Input/Output. Busses l Group of electrical conductors suitable for carrying computer signals from one location to another l Each conductor in

Focus on I/O DevicesFocus on I/O Devices

Objective - provide a method to allow efficient utilization of the CPU while I/O is taking place• Keyboard• Disk• Monitor• Printer

Each device operates at a different speed but the CPU is the fastest

Page 15: Chapter 8 Input/Output. Busses l Group of electrical conductors suitable for carrying computer signals from one location to another l Each conductor in

Differences in I/O requirements

Keyboard - slow, sporadic input• much waiting between keying• enter text or send special control messages

such as CTRL keys or function keys• user may enter input in response to a

request or interrupt the CPU Mouse - can also generate expected or

unexpected input

Page 16: Chapter 8 Input/Output. Busses l Group of electrical conductors suitable for carrying computer signals from one location to another l Each conductor in

Other I/O Requirements

Hard Disk, CDROM or DVD - usually transfer large amounts of data in blocks instead of one character at a time

CPU should be free to do other tasks while the I/O is taking place

Disk, printer, and monitors operate under program control

Newer DVD and CDROMs self-initiate when placed in the drive

Page 17: Chapter 8 Input/Output. Busses l Group of electrical conductors suitable for carrying computer signals from one location to another l Each conductor in

Summarize Requirements for I/OSummarize Requirements for I/O

Each device must be individually addressed Each device must be able to initiate

communication with the CPU Information could be transferred directly to the

CPU by individual word for slower character input , but faster and direct transfer to memory is also needed

Page 18: Chapter 8 Input/Output. Busses l Group of electrical conductors suitable for carrying computer signals from one location to another l Each conductor in

Simple I/O Configuration

Page 19: Chapter 8 Input/Output. Busses l Group of electrical conductors suitable for carrying computer signals from one location to another l Each conductor in

More Complex I/O Configuration

Page 20: Chapter 8 Input/Output. Busses l Group of electrical conductors suitable for carrying computer signals from one location to another l Each conductor in

Programmed I/OProgrammed I/O

Simplest form of I/O (Figure 8.2) I/O module connected to a pair of I/O registers

in the CPU via a bus Registers similar to MAR and MDR Information is transferred one word at a time

(64 bits) Very slow - only for small amounts of data CPU is involved in every step of the process

Page 21: Chapter 8 Input/Output. Busses l Group of electrical conductors suitable for carrying computer signals from one location to another l Each conductor in

Programmed I/O

Page 22: Chapter 8 Input/Output. Busses l Group of electrical conductors suitable for carrying computer signals from one location to another l Each conductor in

Programmed I/O (continued)

Page 23: Chapter 8 Input/Output. Busses l Group of electrical conductors suitable for carrying computer signals from one location to another l Each conductor in

Concept of InterruptsConcept of Interrupts

“signal that causes the CPU to alter its normal flow of instruction execution”

Interrupt lines are special control lines to the CPU

Messages sent over those lines are known as interrupts

More efficient than polling since devices are frequently idle and the CPU is so fast

Page 24: Chapter 8 Input/Output. Busses l Group of electrical conductors suitable for carrying computer signals from one location to another l Each conductor in

Servicing an InterruptServicing an Interrupt

Interrupt causes temporary suspension of the program currently running

Current registers and instruction are saved in a special area known as the stack or PCB (Process Control Block)

Interrupt handler program starts execution When complete, the registers and program

instruction is restored and program resumes

Page 25: Chapter 8 Input/Output. Busses l Group of electrical conductors suitable for carrying computer signals from one location to another l Each conductor in

Servicing an Interrupt

Page 26: Chapter 8 Input/Output. Busses l Group of electrical conductors suitable for carrying computer signals from one location to another l Each conductor in

Why Are Interrupts Used?Why Are Interrupts Used?

External event - such as input from the keyboard(Example Figure 8.6)

Completion signal - control output to printers Allocating CPU time - giving execution time to

many processes Abnormal Events - Power failure, illegal

instructions, non existent op codes

Page 27: Chapter 8 Input/Output. Busses l Group of electrical conductors suitable for carrying computer signals from one location to another l Each conductor in

External Event - Keyboard Input

Page 28: Chapter 8 Input/Output. Busses l Group of electrical conductors suitable for carrying computer signals from one location to another l Each conductor in

Completion Signal - Print Handler

Page 29: Chapter 8 Input/Output. Busses l Group of electrical conductors suitable for carrying computer signals from one location to another l Each conductor in

Allocating CPU Time

Page 30: Chapter 8 Input/Output. Busses l Group of electrical conductors suitable for carrying computer signals from one location to another l Each conductor in

Multiple Interrupts

Different events may vie for service - thus, multiple interrupts

How to handle? Vectored Interrupts - each interrupt includes

address of device Polled Interrupts - general interrupt signal and

system polls devices to determine source Priorities Interrupts - interrupts have assigned

priorities

Page 31: Chapter 8 Input/Output. Busses l Group of electrical conductors suitable for carrying computer signals from one location to another l Each conductor in

Vectored Interrupt Processing

Page 32: Chapter 8 Input/Output. Busses l Group of electrical conductors suitable for carrying computer signals from one location to another l Each conductor in

Polled Interrupt Processing

Page 33: Chapter 8 Input/Output. Busses l Group of electrical conductors suitable for carrying computer signals from one location to another l Each conductor in

Priorities Interrupt

Page 34: Chapter 8 Input/Output. Busses l Group of electrical conductors suitable for carrying computer signals from one location to another l Each conductor in

Processing an IBM S/390 Interrupt

Page 35: Chapter 8 Input/Output. Busses l Group of electrical conductors suitable for carrying computer signals from one location to another l Each conductor in

DMA - Direct Memory AccessDMA - Direct Memory Access

Impractical to transfer data from peripheral device to CPU via programmed I/O - ties up CPU

DMA Purpose: to transfer large blocks of data directly from disk to memory

Faster mode of transfer CPU starts process and then is free to perform

other tasks Transfer is under control of the I/O module CPU is interrupted when I/O transfer is

complete

Page 36: Chapter 8 Input/Output. Busses l Group of electrical conductors suitable for carrying computer signals from one location to another l Each conductor in

Information Needed for DMAInformation Needed for DMA

Location of the data on the I/O device Starting location of the block of data in

memory Size of the block to be transferred Direction of transfer - read or write BOTTOM LINE - CPU is free to perform other

tasks while high speed data transfer is taking place

Page 37: Chapter 8 Input/Output. Busses l Group of electrical conductors suitable for carrying computer signals from one location to another l Each conductor in

DMA Initiation and Control

Page 38: Chapter 8 Input/Output. Busses l Group of electrical conductors suitable for carrying computer signals from one location to another l Each conductor in

Interconnection: CPU, Memory, I/O

Page 39: Chapter 8 Input/Output. Busses l Group of electrical conductors suitable for carrying computer signals from one location to another l Each conductor in

External Interface Busses and Ports

A port is a connector at the end of a bus into which a peripheral device can be plugged

Control of the port is provided by a port controller connected to a standard bus (PCI or ISA)

Device control is built into a controller within the device and into software (drivers) that are installed in the OS

Common interface busses: USB, SCSI, IEEE 1394

Page 40: Chapter 8 Input/Output. Busses l Group of electrical conductors suitable for carrying computer signals from one location to another l Each conductor in

USB - Universal Serial Bus

Newer bus intended to replace the standard serial port

Faster - capable of transfers up to 12 megabits per second

Hubs can provide multiple connection points for I/O devices

Devices can be added without rebooting Still for slow to medium devices, such as

keyboards, scanners, joysticks and cameras

Page 41: Chapter 8 Input/Output. Busses l Group of electrical conductors suitable for carrying computer signals from one location to another l Each conductor in

USB Topology Example

Page 42: Chapter 8 Input/Output. Busses l Group of electrical conductors suitable for carrying computer signals from one location to another l Each conductor in

FireWire Configuration

Page 43: Chapter 8 Input/Output. Busses l Group of electrical conductors suitable for carrying computer signals from one location to another l Each conductor in

Typical PC Bus Interface