Question

In: Computer Science

Problem 2. Interrupt-driven I/O (20 pt.) Consider a system employing interrupt-driven I/O for a particular device...

Problem 2. Interrupt-driven I/O (20 pt.)

Consider a system employing interrupt-driven I/O for a particular device that transfers data at an average of 2000 bytes/sec on a continuous basis.

a. Assume that interrupt processing takes about 200 usec (i.e., the time to jump to the interrupt service routine (ISR), execute it, and return to the main program). Determine what fraction of processor time is consumed by this I/O device if it interrupts for every byte.

b. Now assume that the device has two 8-byte buffers and interrupts the processor when one of the buffers is full. Naturally, interrupt processing takes longer because the ISR must transfer 8 bytes. While executing the ISR, the processor takes about 10 usec for the transfer of each byte. Determine what fraction of processor time is consumed by this I/O device in this case.

Solutions

Expert Solution

For the given data, consider a system employing interrupt driven I/O for a particular device transfer data at an average is 2000 bytes/sec = 2000 interrupts per second.

It's converted to usec (1 =10^-6 sec)

Then,

1/(2000* 10^-6) = 500usec

a)

The device generates 200 usec. So time required for interrupt processing = 200 used.

Assume that the interrupt processing takes about 100 usec. If each interrupt consumes 100 usec , then the fraction of processor time = interrupt processing/ time interval for an interrupt

=100/200

= 0.5

b) In this case , the time interval between interrupt= 8 * 200 = 1600usec.

Each interrupt now requires 100 usec for the first character add the time for transferring each remaining character (8-1=7 characters)

That is 100*1+10*7= 170 sec.

Therefore, the fraction of the processor time for

= time required for interrupt processing/ interval between the interrupts

=170/1600

=0.10


Related Solutions

How does an interrupt capable I/O device improve systemefficiency?
How does an interrupt capable I/O device improve system efficiency?
Consider a device driver that manages the I/O to a specific device. Multiple threads in the...
Consider a device driver that manages the I/O to a specific device. Multiple threads in the system need to read information from the device. The device can only support one I/O command at a time. Previous I/O commands must complete before a new one is issued. Assume the device can be read using a readDevice( what ) method. Write a read( what ) method to be called by any thread in the system that wants to read something from the...
1 ) Which of the followings is not a goal of the I/O software?    A. Device...
1 ) Which of the followings is not a goal of the I/O software?    A. Device independence B. Uniform naming C. Buffering D. Error handling E. Cost reduction 2) According to the data rate, which of the following is not true? A. SONET OC-768 network is faster than Gigabit Ethernet B. FireWire 800 is slower than USB 3.0 C. SCSI Ultra 5 bus is faster than Thunderbolt 2 bus D. Keyboard is slower than mouse 3) Which of the following...
What is the criterion problem is in I/O psychology? How criteria are defined in I/O psychology?...
What is the criterion problem is in I/O psychology? How criteria are defined in I/O psychology? What are the criteria for criteria? What is the difference between the conceptual criterion and the actual criterion.? How to differentiate between criterion contamination and criterion deficiency? What are the differences between objective and subjective criteria?
Write a C program using system call I/O to ****NOTE YOU MUST USE SYSTEM CALL I/O,...
Write a C program using system call I/O to ****NOTE YOU MUST USE SYSTEM CALL I/O, meaning STANDARD I/O IS NOT ALLOWED a) open an existing text file passed to your program as a command-line argument, then b) display the content of the file, c) ask the user what information he/she wants to append d) receive the info from the user via keyboard e) append the info received in d) to the end of the file f) display the updated...
****NOTE YOU MUST USE SYSTEM CALL I/O, meaning STANDARD I/O IS NOT ALLOWED THIS MEANS THAT...
****NOTE YOU MUST USE SYSTEM CALL I/O, meaning STANDARD I/O IS NOT ALLOWED THIS MEANS THAT YOU CANT USE fopen, fclose , etc *******You are ONLY ALLOWED TO USE SYSTEM CALL I/O such as read, write, open and close (System I/O functions) Write a C program using system call I/O to determine how many lines there are in a text file.
****NOTE YOU MUST USE SYSTEM CALL I/O, meaning STANDARD I/O IS NOT ALLOWED THIS MEANS THAT...
****NOTE YOU MUST USE SYSTEM CALL I/O, meaning STANDARD I/O IS NOT ALLOWED THIS MEANS THAT YOU CANT USE fopen, fclose , etc *****You are ONLY ALLOWED TO USE SYSTEM CALL I/O such as read, write, open and close (System I/O functions) Write a C program using system call I/O to a) open an existing text file passed to your program as a command-line argument, then b) display the content of the file, c) ask the user what information he/she...
Problem 4 (20 pt.) Given the following dataset: ? ? ? Class 2.5 1.5 3.5 -...
Problem 4 (20 pt.) Given the following dataset: ? ? ? Class 2.5 1.5 3.5 - 0.5 1.0 1.5 + 0.5 0.5 1.0 + 2.0 2.5 2.5 + 1.0 2.0 3.0 - 2.0 3.0 1.5 - Supposethatyouwanttoclassifyanobservation?=(?.?, ?.?, ?.?)using?-NearestNeighbors with Euclidean distance as the proximity metric. Answer the following questions: (8 pts.) What is the distance between ? and every observation in the dataset? (3 pts.) What is the predicted class label for ? if ? = ?? (3 pts.)...
****NOTE YOU MUST USE SYSTEM CALL I/O, meaning STANDARD I/O IS NOT ALLOWED Write a C...
****NOTE YOU MUST USE SYSTEM CALL I/O, meaning STANDARD I/O IS NOT ALLOWED Write a C program using system call I/O to determine how many lines there are in a text file.
Course: Computer Architecture (Theme: Input-Output) A computer consists of a processor and an I/O device D...
Course: Computer Architecture (Theme: Input-Output) A computer consists of a processor and an I/O device D connected to main memory M via a shared bus with a data bus width of one word. The processor can execute a max of 2 MIPS. An average instruction requires 5 machine cycles, 3 of which use the memory bus. A memory read/write operation uses 1 m/c cycle. Suppose that the processor is continuously executing “background” programs that require 96% of the instruction rate...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT