Sunday, 16 December 2012

Input/Output

INPUT and OUTPUT


Definition:

•A bus is a shared communication link, which uses one set of wires to connect multiple subsystems.
• I/O is very much architecture/system dependent
• I/O requires cooperation between
  – processor that issues I/O command (read, write etc.)
  -  buses that provide the interconnection between processor, memory      and I/O devices
  – I/O controllers that handle the specifics of control of each device and      interfacing
  – devices that store data or signal events


TYPE AND CHARACTERISTIC OF INPUT/OUTPUT:


Input devices
-Keyboard :  The data and instructions are input by typing on the keyboard. The          message typed on the keyboard reaches the memory unit of a computer.
-Mouse      :   It’s a pointing device. The mouse is rolled over the mouse pad, which in         turn controls the movement of the cursor in the screen.
Output devices
-Speaker :    High definition, or low distortion, to create a dynamic impact.
-Printer :      Produces a representation of an electronic document on physical media


Example of Input/Output :


qInput devices              qOutput devices

keyboard:-                    Speaker:-






Mouse:-                     Printer:-
















HANDLING I/O INTERRUPT:


Interrupts: alternative to polling
  - I/O device generates interrupt when status changes, data   ready
  - OS handles interrupts just like exceptions (e.g., page faults)
  - Identity of interrupting I/O device recorded in ECR
• I/O interrupts are asynchronous
  - Not associated with any one
  - Don’t need to be handled immediately
• I/O interrupts are prioritized
  - Synchronous interrupts (e.g., page faults) have highest priority
  - High-bandwidth I/O devices have higher priority than low

INTERRUPT OVERHEAD:


Parameters
  - 500 MHz CPU
  - Interrupt handler takes 400 cycles
  - Data transfer takes 100 cycles
  - 4 MB/s, 16 B interface disk transfers data only 5% of         time
Data transfer (x) time
  0.05 * (4M B/s)/(16 B/xfer)*[(100 c/xfer)/(500M c/s)] =           0.25%
Overhead for polling?
  (4M B/s)/(16 B/poll) * [(400 c/poll)/(500M c/s)] = 20%
Overhead for interrupts?
  + 0.05 * (4M B/s)/(16 B/poll) * [(400 c/poll)/(500M c/s)] =    1%

No comments:

Post a Comment