Consider a cache of 4 lines of 16 bytes each.Main memory is divided into blocks of 16 bytes each.That is, block 0 has bytes with addresses 0 through 15, and so om. Now consider a program that accesses memory in the following sequence of addresses.

Once:63 through 70

Loop ten times: 15 through 32; 80 through 95

a. Suppose the cache is organized as direct mapped. Memory blocks 0,4 and so on are assigned to line 1; blocks 1,5, are so on. Compute the hit ratio.

b. Suppose the cache is organized as two-way set associative, with two sets of two lines each. Even-numbered blocks are assigned to set 0 and odd-numbered blocks are assigned to set . Compute the hit ratio for the two-way set-associative cache using the least recently used replacement scheme.