Input Output Organization

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 15

University Institute of Engineering

DEPARTMENT OF COMPUTER SCIENCE


& ENGINEERING
Bachelor of Engineering (Computer Science & Engineering)
Subject Name: Computer Organization & Architecture
Subject Code: CST-252

INPUT OUTPUT ORGANIZATION DISCOVER . LEARN . EMPOWER


Topics covered
• Asynchronous Data transfer:

• Source Initiated

• Destination Initiated

• Handshaking

• Programmed I/O

• Interrupts DMA, and IOP

2
SYNCHRONOUS/ASYNCHRONOUS
DATA TRANSFER
• Synchronous transfers usually occur when peripherals are located within the same computer as the CPU because their close
proximity allows them to share a common clock and because data does not have to travel very far physically, which
becomes a concern at a higher clock frequencies.

• A computer can make use of asynchronous data transfers when synchronous transfers are not viable.

• Asynchronous transfers use control signals and their associated hardware to coordinate the movement of data. These data
transfer do not require that the source and destination use the same system clock.

• There are four types of asynchronous data transfers.

3
TYPES OF ASYNCHRONOUS DATA
TRANSFER
• Source initiated without handshaking

• Destination initiated without handshaking

• Source initiated with handshaking

• Destination initiated with handshaking

4
CPU HANDSHAKING
• For some devices, particularly electromechanical devices, do not require the same amount of time for every transfer, they
can use handshaking to coordinate their transfers.
• Handshaking uses an additional control signal to indicate that data is ready or has been read in.
SOURCE INITIATED WITHOUT HANDSHAKING
• The source outputs its data.
• Then strobes a control signal for a set amount of time.
• The destination device reads in the data during this time.
• The source device next desserts the strobe and stops outputting data.
DESTINATION INITIATED WITHOUT HANDSHAKING
• The destination device transmits a data strobe signal to the source device which, after a brief delay, makes data available.
• The destination device reads in this data
• The destination device deserts the data strobe.

5
Contd..
SOURCE INITIATED WITH HANDSHAKING

• The source sets the data request signal high.

• Makes valid data available to the destination device

• The destination device reads in data.

• The destination device sends a data acknowledge signal to the source.

• The source sets its data request line low and stops sending data.

• The destination then resets its data acknowledge signal.

DESTINATION INITIATED WITH HANDSHAKING

• Similar to that of the source-initiated data transfer using handshaking, except that the data-acknowledge signal is replaced
by a data-ready signal.
6
PROGRAMMED INPUT OUTPUT
• Definition:

Programmed I/O is exactly what its name implies: A program instruction causes the CPU to input or output data.

• Programmed I/O can be either isolated or memory mapped.

• Isolated I/O uses separate instructions to access I/O ports.

• Memory-mapped I/O treats I/O ports as memory locations.

7
INTERRUPTS
• In program-controlled I/O, the program enters a wait loop in which it repeatedly tests the device status. During the period,
the processor is not performing any useful computation.
• However, in many situations other tasks can be performed while waiting for an I/O device to become ready.
• Let the device alert the processor.
Enabling and Disabling Interrupts

• Since the interrupt request can come at any time, it may alter the sequence of events from that envisaged by the
programmer.
• Interrupts must be controlled.

• The interrupt request signal will be active until it learns that the processor has responded to its request. This must be
handled to avoid successive interruptions.
 Let the interrupt be disabled/enabled in the interrupt-service routine.
 Let the processor automatically disable interrupts before starting the execution of the interrupt-service routine.
8
Use of Interrupts in Operating Systems
• The OS and the application program pass control back and forth using software interrupts.

• Supervisor mode / user mode

• Multitasking (time-slicing)

• Process – running, runnable, blocked

• Program state

9
DIRECT MEMORY ACCESS (DMA)
• Think about the overhead in both polling and interrupting mechanisms when a large block of data need to be transferred

between the processor and the I/O device.

• A special control unit may be provided to allow transfer of a block of data directly between an external device and the main

memory, without continuous intervention by the processor – direct memory access (DMA).

• The DMA controller provides the memory address and all the bus signals needed for data transfer, increment the memory

address for successive words, and keep track of the number of transfers.

10
DMA Procedure
• Processor sends the starting address, the number of data, and the direction of transfer to DMA controller.

• Processor suspends the application program requesting DMA, starts DMA transfer, and starts another program.

• After the DMA transfer is done, DMA controller sends an interrupt signal to the processor.

• The processor puts the suspended program in the Runnable state.

11
DMA Register

Figure: Registers in DMA Interface

12
APPLICATIONS

• Computer organization and architecture course deals with instruction set architecture, micro architecture and efficient

implementation of micro architecture.

• Understanding the computer architecture concepts is essential for students interested in hardware, processor design,

compilers, and operating systems. 

13
REFERENCES
Text Books:
• Carpinelli J.D,” Computer systems organization &Architecture”, Fourth Edition, Addison Wesley.
• Patterson and Hennessy, “Computer Architecture” , Fifth Edition Morgaon Kauffman.

Reference Books:
• J.P. Hayes, “Computer Architecture and Organization”, Third Edition.
• Mano, M., “Computer System Architecture”, Third Edition, Prentice Hall.
• Stallings, W., “Computer Organization and Architecture”, Eighth Edition, Pearson Education.

14
THANK YOU

You might also like