Navi
Showing posts with label Chapter 6 (Input Output Interface). Show all posts

INPUT/OUTPUT TECHNIQUES


There are 3 type of I/O techniques:
i)   Programmed
ii)  Interrupt driven
iii) Direct Memory Access (DMA)


i) Programmed I/O; here, data is exchanged between the processor and the I/O module. The CPU has direct control over the I/O. programmed I/o wastes CPU time.

Programmed I/O detail:
o  CPU requests I/O operation
o  I/O module performs operation
o  I/O module sets status bits
o  CPU checks status bits periodically
o  I/O module does not inform CPU directly
o  I/O module does not interrupt CPU
o  CPU may wait or come back later.

With programmed I/O, lots of CPU time is wasted in polling because processors are faster than I/O devices. This results into CPU inefficient usage. This means that the programmed I/O is suitable for lower performance.



ii) Interrupt Driven I/O;
o  This overcomes CPU waiting
o  There is no repeated CPU checking of devices
o  I/O module interrupts when ready
Interrupt driven I/O basic operation
This is the order in which the interrupt driven i/O carries out its commands step by step.
·       CPU issues read command
·       I/O module gets data from peripherals while CPU does some other work.
·       I/O module interrupts CPU
·       CPU requests data
·       I/O module transfers data
Viewpoint:
v Issue read command
v Do other work
v Check for interrupt at the end of each instruction cycle
v If interrupted




I/O Commands
There are four types of I/O commands that an I/O module may receive when it is addressed by a processor. They include the following;
ü Control. This is used to activate a peripheral and tell it what to do. Instructions like stop, rewind, forward, etc.
ü Test. This is used to try out various conditions associated with an I/O module and its peripherals.
ü Read. This enables the I/O to obtain an item of data from the peripheral and place it in an internal buffer
ü Write. This enables the I/O to take an item of data from the data bus and subsequently transmit that data item to the peripheral

Interrupt I/O is more efficient than programmed I/O because it needs less waiting as compared to programmed I/O. however, interrupt I/O still consumes more processor time because data transfer from memory to I/O module to memory must pass through the processor.
Problems Faced by programmed I/O and Interrupt Driven I/O :
a.   The I/O transfer rate is limited by the speed with which the processor can test and service a device.
b.   The processor is tied up in managing an I/O transfer. A number of instructions must be executed for each I/O transfer.

iii) Direct Memory Access(DMA)
With direct memory access, large amounts of data can be transferred between memory and the peripherals which greatly improves CPU performance.
DMA OPERATIONS.
vCPU tells DMA controller
§  Read/write
§  Device address
§  Starting address of memory block for data
§  Amount of data to be transferred
vCPU carries on with other tasks/work
vDMA controller deals with transfer
vDMA controller sends interrupt when finished



I/O module function and mapping


I/O module function:
Control and Timing; this coordinates the flow of traffic between external devices and internal resources.
CPU Communication; this involves command decoding in I/O module, data exchange through data bus, etc.
Device Communication; involves commands, status information and data.
Data Buffering; the data are buffered in the I/O module and then sent to the peripheral device at its data rate.
Error Detection; this is for reporting errors to the processor.

I/O Module Diagram


Thus, I/O Module takes most of processing burden and becomes a high-level interface to processor also refer to as I/O channel, I/O controller, device controller, etc.



I/O Mapping:
This is when a processor, memory and I/O share a common bus. There are two types of interfacing and they include;
1.   Memory mapped I/O;
o  Devices and memory share an address space
o  I/O looks just like memory read and write
o  No special commands for I/O
2.   Isolated I/O;
o  Separate address spaces
o  Need I/O or memory select lines
o  Needs special commands for I/O

External I/O Devices


External I/O Devices:
There are three categories of external devices;
i) Human readable
o  Suitable to communicate with the computer users
o  Screen, printer, keyboard

ii) Machine readable
o  Suitable to communicate with the equipment
o  Monitoring and control
o  Magnetic disk and tape systems, sensors and actuators

iii) Communication
o  Suitable for communicating with remote devices such as terminal, a machine readable device or another computer
o  Modem
o  Network interface card(NC)


Keyboard/Monitor:
·      These are the most common means of computer/user interaction.
·       The user provides input via the keyboard and the monitor displays the output.
·       The basic unit of exchange is character. Associated with each character is a code, typically 7 or 8 bits in length.
·       Each character in this code is represented by a unique 7-bit binary code.
·       Characters are of two types; printable and control characters. Printable characters are the alphabetic, numeric and special characters that can be printed on the paper or displayed on a screen.
·       Control characters do with the controlling of the printing or displaying of characters.


Figure 7.2

The nature of an external device is indicated in Figure 7.2. The interface to the I/O module is in the form of control, data, and status signals.



Introduction of I/O and Problem


The Computer I/O Architecture is its interface to the outside world and a means of controlling and managing I/O activities. The I/O system consists of I/O devices, device controllers (or I/O modules or I/O interviews) and driver software.



There a various input and output problems and they include;

•Wide variety of peripherals.
  Delivering different amounts of data
  Running at different speed
  Running in a different format
•All devices are slower than CPU and RAM
• They need I/O modules
  -Interface to CPU and Memory
  -Interface to one or more peripherals
• The encoding of the transmitted word must be that which is employed by the I/O device.

• Operating Rates
  -The CPU and Main Memory operate at many times the speed of I/O devices
• Timing and Control
 -Exchange of status signals between CPU and device.
 -Rate of transmission from device to CPU or vice-versa.
• Communication Link (Word Length)
– There are at least 25 different word lengths used in computers. The word lengths vary from 4 to 128 bits.The separation (or combination) of words (because of word length) into characters, bytes or other units presents a "word assembly" problem.CA - XVII - I/O - 5WORD-LENGTH DIFFER