I/O devices(rough)

November 2, 2010 Leave a comment Go to comments

CPU vs I/O

CPU is electronic. I/O can be electronic or mechanical.
Operating method of CPU and I/O devices is different.
Instruction format may differ.
Clock of CPU and I/O device is generally different(asynchronous).
Malfunction of CPU disturbs the operation of I/O device. Malfunction of I/O device doesn’t disturb the operation of CPU.

Interface

Interface is a communication link that resolves these differences.It is of two types

Offline- not directly connected to CPU, instead connected to some other device connected to the CPU. e.g. card reader

In the case of card reader, the process is called SPOOLING(Simultaneous Peripheral Offline).

Online-directly connected to the CPU.

There are two ways to connect an I/O device

  1. Memory mapped I/O

1.port address is treated as memory address.

2.device driver is treated as ordinary file

3.special instruction is not required to run device driver.

2.I.O mapped I/O

    1.port address is different from memory address.

    2.special instruction is needed for input and output signal to I/O devices.

    The speed of memory mapped I/O is slow because of the following reasons :

    • it is part of memory.
    • The user area is reduced because some part of memory is treated as port address.
    • It is used only  because it is simple.

    Modes of data transfer

    There are 3 modes of data transfer:

    1. Under program control- system waits for event to occur
    2. By interrupt – system performs other jobs until interrupt
    3. By DMA(Direct Memory Access) –

    –          It is used for large volume of I/O.

    –          CPU transfers control to DMA which directly accesses data bus and control bus for direct transfer

    I/O->CPU->memory(when DMA is not used)

    I/O->DMA->memory(when DMA is used)

    NOTE: DMA has higher priority than CPU because without data, processing cannot occur, so transfer of data needs to be given prime importance.

    Asynchronous Data Transfer

    For CPU and I/O to be synchronous, they need to share a common clock and for that they need to be physically close, which is not possible. So, asynchronous data transfer is used.

    It is of two types:

    1. Strobe signal
    2. Handshaking

    Strobe signal

    –          There is no confirmation of receipt of signal to destination.

    –          It is a source initiated data transfer system.

    Its main disadvantage is that there is no confirmation of data in data bus.

    Handshaking

    it is a type of destination initiated data transfer

    Advertisements
    1. No comments yet.
    1. No trackbacks yet.

    Leave a Reply

    Fill in your details below or click an icon to log in:

    WordPress.com Logo

    You are commenting using your WordPress.com account. Log Out / Change )

    Twitter picture

    You are commenting using your Twitter account. Log Out / Change )

    Facebook photo

    You are commenting using your Facebook account. Log Out / Change )

    Google+ photo

    You are commenting using your Google+ account. Log Out / Change )

    Connecting to %s

    %d bloggers like this: