Chapter 8 Input/Output
Busses l Group of electrical conductors suitable for carrying computer signals from one location to another l Each conductor in the bus is referred to as a line and carries a single signal - such as a bit in an address
Line Categories l Data lines - carrying data from one location to another l Address lines - specify address of recipient l Control lines - for synchronization of bus and modules connected to bus l Power lines - carry power to a module
Typical Uses of Busses l Transfer data between CPU and memory l Transfer data between CPU and computer peripherals l Transfer data between different points within the CPU
Point-to-Point Busses l Bus carries signals from a specific source to a specific destination l Example - cable connecting parallel or serial computer port to peripheral
Multi-point Bus l Bus connects several points together l Bus broadcasts a signal to every recipient on the bus l In most cases, an address accompanies the signal in order to identify the desired destination l Example - Ethernet network connection
Pt-to-Pt and Multi-Pt Busses
CPU - I/O l A P-P bus may be used to connect CPU to memory l A M-P bus may connect CPU to memory and/or to I/O modules l Referred to as a backplane, system bus, external bus l Bridge - interface between different busses that allow them to communicate
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
Characteristics of Busses Bus Width Speed Bandwidth (bits) (MHz) (Mbytes/sec)
PCI Bus l 32- or 64-bit bus used in Suns, Apples, Compaq, Alpha,... l Backplane bus interconnecting CPU and various plug-in I/O modules that control serial and parallel ports, sound cards, disks, … l CPU sends signals to bus via individual pins of the integrated circuit
PCI Bus Connections
Pentium III Bus Lines
Focus on I/O Devices l Objective - provide a method to allow efficient utilization of the CPU while I/O is taking place Keyboard Disk Monitor Printer l Each device operates at a different speed but the CPU is the fastest
Differences in I/O requirements l 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 l Mouse - can also generate expected or unexpected input
Other I/O Requirements l Hard Disk, CDROM or DVD - usually transfer large amounts of data in blocks instead of one character at a time l CPU should be free to do other tasks while the I/O is taking place l Disk, printer, and monitors operate under program control l Newer DVD and CDROMs self-initiate when placed in the drive
Summarize Requirements for I/O l Each device must be individually addressed l Each device must be able to initiate communication with the CPU l 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
Simple I/O Configuration
More Complex I/O Configuration
Programmed I/O l Simplest form of I/O (Figure 8.2) l I/O module connected to a pair of I/O registers in the CPU via a bus l Registers similar to MAR and MDR l Information is transferred one word at a time (64 bits) l Very slow - only for small amounts of data l CPU is involved in every step of the process
Programmed I/O
Programmed I/O (continued)
Concept of Interrupts l “signal that causes the CPU to alter its normal flow of instruction execution” l Interrupt lines are special control lines to the CPU l Messages sent over those lines are known as interrupts l More efficient than polling since devices are frequently idle and the CPU is so fast
Servicing an Interrupt l Interrupt causes temporary suspension of the program currently running l Current registers and instruction are saved in a special area known as the stack or PCB (Process Control Block) l Interrupt handler program starts execution l When complete, the registers and program instruction is restored and program resumes
Servicing an Interrupt
Why Are Interrupts Used? l External event - such as input from the keyboard(Example Figure 8.6) l Completion signal - control output to printers l Allocating CPU time - giving execution time to many processes l Abnormal Events - Power failure, illegal instructions, non existent op codes
External Event - Keyboard Input
Completion Signal - Print Handler
Allocating CPU Time
Multiple Interrupts l Different events may vie for service - thus, multiple interrupts l How to handle? l Vectored Interrupts - each interrupt includes address of device l Polled Interrupts - general interrupt signal and system polls devices to determine source l Priorities Interrupts - interrupts have assigned priorities
Vectored Interrupt Processing
Polled Interrupt Processing
Priorities Interrupt
Processing an IBM S/390 Interrupt
DMA - Direct Memory Access l Impractical to transfer data from peripheral device to CPU via programmed I/O - ties up CPU l DMA Purpose: to transfer large blocks of data directly from disk to memory l Faster mode of transfer l CPU starts process and then is free to perform other tasks l Transfer is under control of the I/O module l CPU is interrupted when I/O transfer is complete
Information Needed for DMA l Location of the data on the I/O device l Starting location of the block of data in memory l Size of the block to be transferred l Direction of transfer - read or write l BOTTOM LINE - CPU is free to perform other tasks while high speed data transfer is taking place
DMA Initiation and Control
Interconnection: CPU, Memory, I/O
External Interface Busses and Ports l A port is a connector at the end of a bus into which a peripheral device can be plugged l Control of the port is provided by a port controller connected to a standard bus (PCI or ISA) l Device control is built into a controller within the device and into software (drivers) that are installed in the OS l Common interface busses: USB, SCSI, IEEE 1394
USB - Universal Serial Bus l Newer bus intended to replace the standard serial port l Faster - capable of transfers up to 12 megabits per second l Hubs can provide multiple connection points for I/O devices l Devices can be added without rebooting l Still for slow to medium devices, such as keyboards, scanners, joysticks and cameras
USB Topology Example
FireWire Configuration
Typical PC Bus Interface