A computer uses a small direct-mapped cache between the main memory and the processor. The cache has four 16-bit words, and each word has an associated 13-bit tag, as shown in Figure P5.2a. When a miss occurs during a read operation, the requested word is read from the main memory and sent to the processor. At the same time, it is copied into the cache, and its block number is stored in the associated tag. Consider the following loop in a program where all instructions and operands are 16 bits long:
LOOP Add (R1)+,
R0 Decrement R2
BNE LOOP
Assume that, before this loop is entered, registers R0, R1, and R2 contain 0, 054E, and 3, respectively. Also assume that the main memory contains the data shown in Figure P5.2b, where all entries are given in hexadecimal notation. The loop starts at location LOOP = 02EC
(a)Show the contents of the cache at the end of each pass through the loop.
(b) Assume the access time of main memory is $10\tau$ and that of the cache is $1\tau$. Calculate the execution time for each pass. Ignore the time taken by the processor between memory cycles.