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

20. (5) A computer has a cache, main memory, and a disk used for virtual memory.

ID: 3743740 • Letter: 2

Question

20. (5) A computer has a cache, main memory, and a disk used for virtual memory. If a word is in the cache, 20 ns are required to access it. If it is in main memory, but not in cache, 60 ns are needed to load it into the cache. And then the reference is started again. If the word is not in main memory, 12 milliseconds (1 millisecond 108 ns) are required to fetch it from disk, followed by 60 ns to get it into the cache. If the cache hit ratio is 0.9, and the main memory hit ratio is 0.6, what is the average time in ns required to access a referenced w on this system? You must show how you arrived at your answer. If you just write down your final answer, you will not receive any credit. 21. (2) What is the function of a device driver?

Explanation / Answer

suppose there is 100 access reference made.
So according to the data give:
100*.9=90 reference will be from cache as cache hit ratio is .9
(100-90)*.6=6 references will be Main memory as Main memory hit ratio is .6
so( 100-90-6)=4 references will be to Disk.

Now,
total time taken per cache reference is 20ns.
For 90 reference it will be 90*20=1800 ns

for main memory, 60 ns taken for each reference.
so for 6 references, it will be 6*60=360ns

For disk, 12*10^6 ns required for each reference and 60 ns for getting it into cache.
so for each reference it will be (12*10^6+60) =12000060 ns
for 4 references it will be 48000240 ns

for all 100 references, total time = 1800+360+48000240= 48002400 ns
avg time = 48002400/100=480024 ns = 0.480024ms

-----------------------------------------------------------

Device driver:

Inside computer, a device driver is a program that interacts with a specific component of the computer like Video card, wireless card, sound card, usb devices etc. Any device connected to a computer will be having a driver that links between OS and other application and the component hardware. Any driver connects with the device through the computer bus or communications subsystem with that the hardware is connected. Drivers are hardware dependent and specific to operating system.

Its primary functionality is to act as a translator for OS instructions to the device for which it is meant for. In Windows OS, you can check the drivers by going to device manager and then device properties.

It also handle interrupts generated by hardware interface.