Fill This Form To Receive Instant Help
Homework answers / question archive / Stevens Institute Of Technology CS 550 Chapter 9 Input / Output 1)Which of the following is not a requirement for a computer system to handle I/O in a sufficient and effective manner? Peripheral devices must be individually addressable
Stevens Institute Of Technology
CS 550
Chapter 9 Input / Output
1)Which of the following is not a requirement for a computer system to handle I/O in a sufficient and effective manner?
Discussion questions
…………………………………………………………………………………………………………………
To get started, here is an example for 2 programs and 2 interrupts.
EXAMPLE: 2 programs and 2 interrupts:
Program one gets interrupted at the 42nd clock cycle (arbitrarily chosen), and the interrupt gets serviced leaving 8 clock cycles to be completed (8 +42 = 50 cycles):
|<--------42cycles-------->|<--5cycles-->|<---25cycles---->|<--5cycles-->|<----8cycles-------------- >|
|<--------Prog1 start----->|<----swap-->|<---interrupt---->|<--swap----->|<--Prog1 complete->|
After swapping program two into the CPU, program two gets interrupted at the 12th cycle (arbitrarily chosen), and the interrupt gets serviced leaving 38 clock cycles (12 +38 = 50 cycles):
|<--5cycles-->|<---12cycles-->|<--5cycles-->|<---25cycles---->|<--5cycles-->|-------38cycles---------- >|
|<--swap--->|<---Prog2 start->|<----swap--->|<---interrupt---->|<--swap-->|<-Prog2 complete---- >|
The total number of clock cycles used to swap out the PCB is 3n-1, where n is the number of programs. Total number of Clock cycles to swap out the PCB = (3n-1)* 5 = 5*5 = 25
Total number of Program clock cycles = n*50 = 2*50 = 100. Total number of Interrupt clock cycles = n*25 = 2*25 = 50.
Percent of CPU clock cycles used for processing 2 programs = 100/(25 +100+ 50) = 100/175 or 57.1%.
Now, calculate the percent of the CPU clock cycles are used for processing 100 programs were each program gets interrupted only once.