i/o organization competency – c6. important facts to remember when i/o devices are to be connected...

Post on 18-Jan-2018

216 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

DESCRIPTION

I/O Interface unit

TRANSCRIPT

I/O Organization

Competency – C6

Important facts to remember when I/O devices are to be connected to CPU

• There is a vast variety of I/O devices. Some devices (keyboard and mouse) are very slow, whereas others(disks and flash memory) are much faster.

• The method of data transfer differs from device to device.

• I/O devices transfer data at slower rate than CPU and memory.

• The number of data bytes and their formats differ from one device to another.

I/O Interface unit

Functions of I/O Interface unit

1. To receive read/write instructions from CPU, interpret them and send appropriate commands to the specified I/O device.

2. For a write command, temporarily store the data received from the main memory. Inform the specified device about the readiness of the data. When the device is ready, it accepts the data from the buffer.

Functions of I/O Interface unit3. For a read instruction received from the CPU,

send a command to the specified device. When requested data is received from it, put the data in a buffer and inform the CPU that the data is ready. CPU should now start accepting data from the buffer.

3. Monitor errors during transmission, correct it and inform CPU if data is corrupted.

4. Control all I/O operations.

Device Interfacing

Device Interfacing

• Device Controller – performs device-dependent functions.

• Interface Unit – performs the logic of communicating with the receiver or with the sender.

Device Interfacing

• A computer system contains many I/O devices.

• Each I/O device will be assigned an unique address for identification.

• The interface units of various I/O devices are connected to rest of the computer system using a system bus.

Comm. B/w CPU & Peripheral devices

I/O Interface

I/O Methods

Three methods are possible when data is to be transferred from I/O units to or from memory.

1. Program Controlled data transfer2. Interrupt driven data transfer3. DMA based data transfer

Program Controlled data transfer

Program Controlled data transfer

Program Controlled data transfer

The Interface unit has the following registers:

1.IBR : Interface Buffer Register

2. Data-Ready: Flip-flop that indicates that data is ready in the IBR.

3. Busy: Flip-flop that indicates that the I/O interface unit is engaged.

Program Controlled data transferSeries of steps involved data transfer:1.An I/O instruction is encountered in the

program being executed. 2. The CPU sends the device address and

command(read or write) to be executed on the I/O bus.

3. The device address on the I/O bus is decoded by the address decoder to recognize the desired I/O device.

Series of steps involved data transfer:

4. The interface unit commands the concerned device controller to assemble a word in the IBR.

At the sane time it turns on an interface busy flip-flop and data ready flip-flop is reset to 0.

5. The device controller fills the IBR. As soon as the data is ready in IBR the ready

flip-flop of the device interface is set to 1.

Series of steps involved data transfer:

6. The CPU continually checks the data ready flip-flop in a wait loop.

When the ready flip-flop is set to 1, the contents of IBR are transferred to the specified CPU register through the data bus.

Interrupt Structures• Interrupt process may be compared to the

action of housewife.

• Two processes: Interrupted Process Interrupting Process

• I/O transfer between CPU and the I/O –CPU interrupted processI/O interface interrupting process.

Single Level Interrupt Processing

Interrupt controlled data transfer

Interrupt Types• CPU should handle a variety of interrupts

from many I/O devices.• External Interrupts: Interrupt caused by I/O

devices and emergency events outside CPU’s control.

• Internal Interrupts: Also named as Trap. Occur when there is a mistake in a user’s program. (Divide by zero, Accumulator overflow or use of illegal operation code)

Interrupt Types

• The number of types of interrupts that can be distinguished by a CPU is called Interrupt Levels or Interrupt Classes.

• The relative importance given to an interrupt is called its priority.

Handling Multiple interrupts (Handshaking between CPU and I/O Interface Unit)

Handshaking – The procedure of exchanging signals between processes to communicate each other’s state

Methods for servicing interrupts

1. Software Polling2. Bus Arbitration3. Daisy chaining which is a hardware

arrangement.4. Vectored interrupt handling5. Use of multiple interrupt lines

Software Polling

Bus Arbitration

Daisy Chaining

Vectored Interrupts

Multiple Interrupt lines

top related