LECTURE 10
LECTURE 10
and Architecture
(EET 2211)
Chapter 3
A Top-Level View of Computer Function and
Interconnection
• For example, most external devices are much slower than the
processor. Suppose that the processor is transferring data to a printer
using the instruction cycle scheme. After each write operation, the
processor must pause and remain idle until the printer catches up.
The length of this pause may be on the order of many hundreds or
even thousands of instruction cycles that do not involve memory.
Clearly, this is a very wasteful use of the processor.
6/2/2021 Computer Organization and Architecture 3
Classes of Interrupts
• The user program does not contain any special code to accommodate
interrupts; the processor and the operating system are responsible for
suspending the user program and then resuming it at the same point.
• A sequence of instructions, labeled 4 in the figure, to prepare for the actual I/O
operation. This may include copying the data to be output into a special buffer
and preparing the parameters for a device command.
• The actual I/O command. Without the use of interrupts, once this command is
issued, the program must wait for the I/O device to perform the requested
function (or periodically poll the device). The program might wait by simply
repeatedly performing a test operation to determine if the I/O operation is done.
*Because the I/O operation may take a relatively long time to complete, the I/O
program is hung up waiting for the operation to complete; hence, the user program
is stopped at the point of the WRITE call for some considerable period of time.
6/2/2021 Computer Organization and Architecture 12
Program Flow of Control and Program Timing with
Interrupts: Short I/O wait
• With interrupts, the processor can be engaged
in executing other instructions while an I/O
operation is in progress.
• A portion of the code (2a) executes (while the I/O operation is performed)
and then the interrupt occurs (upon the completion of the I/O operation).
• Fig.6(b) shows the timing for this situation with the use of interrupts.
• We can see that there is still a gain in efficiency because part of the
time during which the I/O operation is under way overlaps with the
execution of user instructions.