Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

4. A computer has two peripheral input/output devices VO, and /O2. Data transfer

ID: 3916743 • Letter: 4

Question

4. A computer has two peripheral input/output devices VO, and /O2. Data transfer is organized via interrupt system. Device IO is served by interrupt service routine PROG1 and device 1O2 by routine PROG2. Execution time for PROG1 is 2 msec and for PROG2 is 20 msec. Time to start response on interrupt request is 1 msec and to return to the interrupted program is also 1 msec. a. Let processor executing main program receive an interrupt request from O2 Processor starts transition to proper interrupt service routine. At this moment the processor receives another interrupt request from 1/O1. Nested interrupts are not alowed. Determine time delay of servicing of interrupt request from IO Time. Delay1-1+20+1-22 msec - b. For the same system now interrupt request is received from I/O, first and then from LO2. Determine time delay of servicing of interrupt request from LO2 Time. Delay-2 = 1+2+1 = 4 msec c. Now assume priorities have been assigned to peripheral devices. I/O1 has higher priority. Let main program is interrupted by request from I/O2 and then it is interrupted by request from I/O,. Nested interrupts are alowed. How long does it take for PROG2 to be executed? Exec_Time_1 1+20+1+1+2+1 26 msec d. Priority of peripheral devices have been changed. /O2 has higher priority. In this case main program is interrupted by request from /O1 and while PROG1 was being does it take for PROGI to be executed? Exec_Time 2 1+2+1+1+20+1 26 msec

Explanation / Answer

Time to start response on interrupt request is 1 ms, and return to the interrupt program is also 1 ms.(This is common for the both interrupt service routines PROG1 and PROG2.)

part a) There are no nested interrupts(IT IS IMPORTANT). It means that when a processor receives a request for an interrupt service routine it process the current interrupt service routine and then only process the remaining interrupt service routines.

For part a) processor received request for I/O2 and started executing this routine.In the meantime the processor received another request for I/O1 .To start process the I/O1 the processor should complete the execution of I/O2 .For completing I/O2 the total time required is : time to start the response + Execution time for PROG2 + time to return to the interrupt .

i.e Total time = 1+ 20 + 1 =22 ms. Therefore to start execute the PROG1. the total delay is 22 ms.(The completion time of PROG1.)

PART b) This is the reverse case for part a. So the total time required to execute PROG1 is : time to start the response + Execution time for PROG1 + time to return to the interrupt .

i.e, Total time = 1+ 2+ 1 =4 ms. Therefore the time delay for executing the PROG2 is 4 ms.

PART c) Nested interrupts are allowed and priorities have been assigned to peripherals. Assigning priorities means if a processor executing some service and it received a request for a service with higher priority then the processor stops executing the present service routine and starts executing the higher priority one. After completing the higher priority service only the processor resumes the stopped service routines and completes it.

For part c Processor executing the I/O2 and it received interrupt from I/O1 which is having a higher priority. So to complete I/O2 the processor should complete the I/O1.

Therefore total execution time = time for executing I/O2 + time for executing I/O1 .

total execution time= (1+20+1)+(1+2+1) = 26 ms.

part d) It is a reverse case for part c.

Therefore total execution time = time for executing I/O1 + time for executing I/O2.

total execution time = (1+2+1)+(1+20+1)= 26 ms.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote