Q1. Assume that we have a processor with hardware cache memory. Assume that a program is run by the CPU and this generates 500,000 memory references, out of which 475,000 hits the cache memory. Assume that average memory access time is 70 ns and cache access time 20 ns, of which 10 ns are for look-up. Assume that the system follows the write-through policy.
a) Illustrate the hit ratio?
b) Illustrate the average memory reference time as seen by the CPU if:
i) All the memory references are read
ii) 80% of the memory references are read
iii) 90% of the memory references are read
Q2. Consider the given resource-allocation state comprising five processes and five resources. Total[j] specifies that the total number of instances of resource j (comprising both allocated and free instances). Alloc[i, j] symbolizes the number of instances of resource j presently assigned to process i. Req[i, j] symbolizes the number of instances of resource j that process i is presently requesting. Find out which processes (if any) are deadlocked.
Total = [11, 10, 6, 9, 6]
Alloc = [ [1, 0, 2, 4, 1], [0, 1, 0, 2, 3], [0, 0, 1, 0, 0], [0, 1, 0, 1, 0], [1, 0, 0, 1, 2] ]
Req = [ [1, 5, 4, 2, 2], [1, 0, 0, 7, 2], [8, 8, 2, 0, 0], [6, 6, 6, 6, 6], [7, 3, 0, 1, 0] ]