9 - Top Level of Computer Function and Interconnection
9 - Top Level of Computer Function and Interconnection
Computer Organization
and Architecture
Chapter 3
Top Level View of Computer
Function and Interconnection
Top Level View of Computer Function and
Interconnection
5 50
I/O
command
Done
2 2 600
5 4 50
I/O operation
END 400
CPU wait
Write 5 50
3 600
3
Total=2500us
1 1 300
1 4 4 50
4 I/O operation concurrent
Write
I/O operation
CPU wait 2a 400
with processor execution
5 5 50
I/O
command 2b 200
2a Done 4 50
2 I/O operation concurrent
END
3a 400
with processor execution
X 4
5 50
2b Interrupt I/O operation
CPU wait
3b 200
Handler Total=1700us
5
Write
5
3a 3
END
X Total=2500us
3b I/O wait 5 4 3 2 1 Code Segment
1 1 300
1 4 4 50
4
Write
I/O wait
2 600 I/O operation concurrent
with processor execution
I/O Then processor waits
command
Done 200
I/O wait
5
5 50
2 END 4 50
2
Interrupt
3 600
I/O operation concurrent
with processor execution
Handler 4 Then processor waits
END
3 Total=3300us
Instruction m
Instruction Cycle
To accommodate interrupts, an interrupt cycle is added to the
instruction cycle
Interrupts
disabled
Fetch Next Execute Check for interrupt;
Start Instruction Instruction Interrupts process interrupt
enabled
Halt
Interrupt Y
occurs here
Interrupt X
Enable interrupts Interrupt
occurs here
Handler Y
Disable interrupts
Enable interrupts
Multiple Interrupts
The drawback to the preceding approach is that it does not take into
account relative priority or time-critical needs
when input arrives from the communications line, it may need to be
absorbed rapidly to make room for more input.
If the first batch of input has not been processed before the second
batch arrives, data may be lost
A second approach is to define priorities for interrupts and to allow
an interrupt of higher priority to interrupt a lower-priority interrupt
Interrupt
Handler X
Higher
User Program Priority
Interrupt Y
occurs here Interrupt
Handler Y
Interrupt X
occurs here
Multiple Interrupts
Consider a system with three I/O devices: a printer, a disk, and a
communications line, with priorities of 2, 4, and 5, respectively
disk Comm printer user
4 5 2 0 Priority
User Program 20 15 10 0 Time
10 10 10 50 duration
Disk
printer
𝒕 =𝟏𝟎 Comm
𝒕 =𝟏𝟓 𝒕 =𝟐𝟎
𝒕 =𝟐𝟓
Disk ISR
𝒕=𝟒𝟎
𝒕 =𝟑𝟓
I/O Function and DMA
The role of I/O is discussed in detail in Chapter 7
I/O instructions similar to memory reference instruction is
used to exchange data with I/O device
In some cases, it is desirable to allow I/O exchanges to occur
directly with memory.
In such a case, the processor grants to an I/O module the
authority to read from or write to memory
During such a transfer, the I/O module issues read or write
commands to memory directly.
This operation is known as direct memory access (DMA)
It is a very useful technique for massive data transfer