0

Accessing I/O Devices:-



  • Most modern computers use single bus arrangement for connecting I/O devices to CPU & Memory.

  • The bus enables all the devices connected to it to exchange information.

  • Bus consists of 3 set of lines : Address, Data & Control Lines.

  • Processor places a particular address (unique for an I/O Device) on address lines.

  • Device which recognizes this address responds to the commands issued on the Control lines.

  • Processor requests for either Read/Write.

  • The data will be placed on Data lines


I/O INTERFACE:-iointerface


1) It is a special hardware used to connect the I/O device to the bus , i.e, I/O interface.

2)The I/O module has following sections:-


  • Address decoder:- It enables the device to recognize its address when this address appears on the address lines.

  • Data register:- The data register holds the data being transferred to or from the processor.


3) The status register contains information relevant to the operation of the I/O module.

* Both the data and status register are connected to the data bus.

iomodule


MODES OF DATA TRANSFER:-


1.Programmed I/O Mode:-

1) In programmed I/O mode data are exchanged between the processor and the I/O module.  When a processor is executing a program and encounters an instruction relating to I/O, it executes that instruction by issuing a command to that appropriate I/O module. With programmed I/O the I/O module will perform the requested action and then set the appropriate bit in the I/O status register.

2) The I/O module takes no further action to alert the processor (it doesn't interrupt the processor).

3) The I/O commands issued by the processor to the I/O module


  • Test

  • Control

  • Read

  • Write


2.Memory Mapped I/O:-

1) There is a single address space for memory location and I/O devices.( the address space is shared)

2) With memory mapped I/O a single read line a single write line are needed on the bus. The bus may be equipped with memory read and write plus Input and output command lines.

3) Now the command lines specifies whether the address refers to memory location or an I/O device.

4) Most CPU uses memory mapped I/O.

5) Always CPU assigns address to memory some of memory space is stolen and assigned to I/O device.

6) It deals with fewer address lines.

MEMORYMAPED


3.Interrupt Driven I/O:-

1) In this method the program issues an I/O command and than continues to execute until it is interrupted by the I/O hardware to signal the end of I/O operation.

2) Here the program enters a wait loop in which it repeatedly checks the device status. During this process the processor is not performing any useful computation.

3) There are many situations where tasks can be performed while waiting for an I/O device to be ready, to allow this the I/O device should alert the processor when it becomes ready. It can be done by sending a hardware signal called an interrupt.

4) The routine executed in response to an interrupt request is called Interrupt Service Routine (ISR).

5) The processor first completes execution of instruction then it loads the program counter(pc) with the address of first instruction of ISR.

4.Direct Memory Access:-


1) In this method the input and output devices read/write information from the main memory without interference of the CPU through the system bus.

2) For I/O transfer, processor determines the status of I/O by:


  • Polling

  • Waiting for interrupt signal.


3) Considerable Overhead is incurred in above I/O transfer processing.

4) By DMA approach , large blocks of data at high speed can be sent between external device and main memory.

DMA CONTROLLER:-

1) It allows the data transfer between I/O device and memory.

2) DMA controllers acts a processor but it is controlled by the CPU. To initiate the transfer of a block of words, the processor sends the following data to controller


  • Starting address of memory block

  • The word count

  • Control to specify the mode of transfer such as read or write.

  • A control to start the DMA transfer.


3) The DMA controller performs the required I/O operation and send a interrupt to the processor upon completion.


 DMA

Use Of DMA controller in Computer System


1) DMA device have higher priority then processor over BUS control.

2) Types of DMA Transfer:-


  • Cycle stealing

  • Burst mode


Cycle Stealing:-

DMA controller ‘steals’ memory cycles from the processor though processor originates most memory access.

Burst mode:- 

The DMA controller may be given exclusive access to the main memory to transfer a block of data without interruption.

Conflicts Of DMA:-


  • Conflict between processor and DMA

  • Two DMA Controller try to access the BUS at same time to access the main memory.






 

Post a Comment

 
Top