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?
****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.)...
consider a device to register osmotic pressure, in which it is placed a solution containing 20...
consider a device to register osmotic pressure, in which it is placed a solution containing 20 grams of hemoglobin in a liter of solution in the right compartment and pure water in the left compartment is placed. Explain the phenomenon that occurs and determine the molecular weight of the hemoglobin if at equilibrium, the water height of the right column is 77.8 mm above the left column if the temperature remains at 35 ° C
Problem 2. Give an example of an open set O such that the boundary of the...
Problem 2. Give an example of an open set O such that the boundary of the closure of O has positive Lebesque measure. (Hint: try to play with the union of open intervals taken out of [0, 1] during the construction of Cantor set on... ODD steps.)
1.give some examples about I/O components in an embedded system 2.Describe hardware components for a mini...
1.give some examples about I/O components in an embedded system 2.Describe hardware components for a mini embedded system with OS 3.What are embedded system basic requirements? 4.What is ARM processor architecture?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT