Consider a system with a processor and a 4 KB direct mapped cache with block size of 16 bytes. The system has a 16 MB physical memory. Four words P, Q, R, and S are accessed by the processor in the same order 10 times. That is, there are a total of 40 memory references in the sequence P, Q, R, S, P, Q, R, S, …….
Assume that the cache memory is initially empty. The physical addresses of the words are given below (1 word = 1 byte).
P: 0x845B32, Q: 0x845B26, R: 0x845B36, S: 0x846B32
Which of the following statements is/are true?
Note: 1K=$2^{10}$ and 1M=$2^{20}$
This solution analyzes memory accesses in a direct mapped cache system to determine the correctness of given statements about cache hits and misses.
First, we determine the cache parameters based on the given information:
We break down the physical addresses to determine their tag, index, and offset components. The least significant 4 bits are the offset, the next 8 bits are the index, and the most significant 12 bits are the tag.
| Word | Physical Address (Hex) | Binary Address (24 bits) | Tag (12 bits) | Index (8 bits) | Offset (4 bits) | Index (Decimal) | Tag (Hex) |
|---|---|---|---|---|---|---|---|
| P | 0x845B32 | $1000 0100 0101 1011 0011 0010$ | $1000 0100 0101$ | $1011 0011$ | $0010$ | 179 (0xB3) | 0x845 |
| Q | 0x845B26 | $1000 0100 0101 1011 0010 0110$ | $1000 0100 0101$ | $1011 0010$ | $0110$ | 178 (0xB2) | 0x845 |
| R | 0x845B36 | $1000 0100 0101 1011 0011 0110$ | $1000 0100 0101$ | $1011 0011$ | $0110$ | 179 (0xB3) | 0x845 |
| S | 0x846B32 | $1000 0100 0110 1011 0011 0010$ | $1000 0100 0110$ | $1011 0011$ | $0010$ | 179 (0xB3) | 0x846 |
The sequence P, Q, R, S is accessed 10 times. The cache is initially empty. We analyze the behavior for each statement.
Based on the analysis, statements A and B are true.
In advanced microprocessors, cache memories are used to
A hierarchical memory system that uses cache memory has cache access time of 50 nano seconds, main memory access time of 300 nano seconds, 75% of memory requests are for read, hit ratio of 0.8 for read access and the write-through scheme is used. What will be the average access time of the system both for read and write requests ?