A. In the write-through policy, only the cache is updated
B. In the write-back policy, both cache and main memory are updated
C. Cache coherence problems exist in multiprocessors with private caches because of the need to share writable data
D. Cache coherence problem can be solved by means of hardware-only scheme
Choose the correct answer from the options given below:
Let's analyze each statement regarding cache memory policies and cache coherence.
The write-through policy is a method for handling write operations in a cache system. In this policy, when a write operation occurs, the data is written to both the cache and the main memory simultaneously. The statement claims that only the cache is updated, which contradicts the fundamental principle of the write-through policy. Therefore, statement A is false.
The write-back policy (also known as write-deferred) handles write operations differently. When a write occurs, the data is written only to the cache line, and that cache line is marked as 'dirty' (modified). The updated data is written back to the main memory only when the modified cache line is about to be replaced or flushed. The statement asserts that both cache and main memory are updated, implying an immediate update to main memory, which is characteristic of write-through, not write-back. Therefore, statement B is false.
In a multiprocessor system where each processor has its own private cache, multiple copies of the same main memory block can exist across different caches. When these processors need to share writable data, a problem arises. If one processor modifies the data in its private cache, other processors might continue to use the older, stale version of the data from their caches, leading to inconsistencies. This issue is known as the cache coherence problem. Statement C correctly identifies this scenario. Therefore, statement C is true.
The cache coherence problem requires mechanisms to ensure all caches have a consistent view of memory. Various techniques exist to address this. Hardware-only schemes are a common approach. Protocols like the MESI (Modified, Exclusive, Shared, Invalid) protocol, snooping protocols (where caches monitor bus transactions), and directory-based protocols are implemented using hardware logic to detect potential coherence violations and enforce consistency. While software techniques can also play a role, hardware solutions are effective and widely used. Therefore, statement D is true.
Based on the analysis:
The true statements are C and D.
In advanced microprocessors, cache memories are used to
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}$
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 ?