edited by
2,896 views
3 votes
3 votes

​​​​Consider two set-associative cache memory architectures: $\text{WBC}$, which uses the write back policy, and $\text{WTC}$, which uses the write through policy. Both of them use the $\text{LRU}$ (Least Recently Used) block replacement policy. The cache memory is connected to the main memory. Which of the following statements is/are TRUE?

  1. A read miss in $\text{WBC}$ never evicts a dirty block
  2. A read miss in $\text{WTC}$ never triggers a write back operation of a cache block to main memory
  3. A write hit in $\text{WBC}$ can modify the value of the dirty bit of a cache block 
  4. A write miss in $\text{WTC}$ always writes the victim cache block to main memory before loading the missed block to the cache 
edited by

2 Answers

2 votes
2 votes

The answer should be B,C
 

A. False

When we miss accessing data in the cache (either by reading or writing), we can choose whether or not to add that missed data into the cache. Sometimes, we might decide not to add it because the data already in the cache from another memory location is more useful or accessed more often.

Source of above info: https://cs.stackexchange.com/questions/133352/what-is-a-cache-write-miss

So, the statement is false because it says that a read miss in WBC "never" removes a dirty block, which is not always the case.

Option D in GATE 2022 Question

B. True

In the write-through policy, data is always kept synchronized. Therefore, we never need to perform a "write back" operation to remove any entry from the cache. This makes the option correct because it states that "never" triggers a write-back.

C. True

A write hit in WBC can modify the value of the dirty bit of a cache block.

If there's a write hit in WBC, it means we're writing directly into the cache. So, of course, we'll also change the dirty bit.

D. False
A write miss in WTC always writes the victim cache block to main memory before loading the missed block to the cache.

There are two blocks mentioned: a missed block and a victim block. The missed block is the one we want to access, while the victim block is the one replaced by LRU.

When there's a write miss in WTC, it means the data we're trying to write isn't in the cache. Now, we may want to load it into the cache, or we may not want to. Suppose we don't want to bring it into the cache; in that case, we can directly modify the main memory.

However, if we decide to bring it into the cache, then we may or may not need to replace the victim block depending on cache is already full or not

Answer:

Related questions

3.3k
views
2 answers
2 votes
Arjun asked Feb 16
3,336 views
A given program has $25 \%$ load/store instructions. Suppose the ideal $\text{CPI}$ (cycles per instruction) without any memory stalls is $2$. The program ... a perfect cache (i.e., with NO data or instruction cache misses) is __________.
4.8k
views
2 answers
5 votes
Arjun asked Feb 16
4,820 views
Consider a $5$-stage pipelined processor with Instruction Fetch (IF), Instruction Decode (ID), Execute (EX), Memory Access (MEM), and Register Writeback ... does not require any extra hardware to retrieve the data from the pipeline stages
4.5k
views
2 answers
7 votes
Arjun asked Feb 16
4,465 views
Which of the following statements about a relation $\mathbf{R}$ in first normal form $\text{(1NF)}$ is/are TRUE?$\mathbf{R}$ can have a multi- ... $\mathbf{R}$ cannot have more than one candidate key
3.5k
views
1 answers
2 votes
Arjun asked Feb 16
3,452 views
Let $L_1, L_2$ be two regular languages and $L_3$ a language which is not regular.Which of the following statements is/are always TRUE?$L_1=L_2$ if and only ... $\overline{L_1} \cup \overline{L_2}$ is regular