Cache Memory · Computer Organization and Architecture
68 questions · asked in 25 of 27 years (2000–2026)
MCQ 44 · MSQ 4 · NAT 201-mark 30 · 2-mark 38
2000Questions per year2026
Questions 11–15 of 68
Let WB and WT be two set associative cache organizations that use LRU algorithm for cache block replacement. WB is a write back cache and WT is a write through cache. Which of the following statements is/are FALSE?
One or more options are correct.
Answer: (A), (B), (D)
We need the FALSE statements.
(A) FALSE. A write through cache writes to memory on every write, so it needs no dirty bit. Only WB has one.
(B) FALSE. A write hit in WB only updates the cache and sets the dirty bit. Memory is updated later, when the block is evicted.
(C) TRUE. Memory is already up to date in WT, so evicting a block needs no transfer to memory.
(D) FALSE. The LRU victim chosen on a read miss in WB can be dirty.
Answer: (A), (B), (D)
(A) FALSE. A write through cache writes to memory on every write, so it needs no dirty bit. Only WB has one.
(B) FALSE. A write hit in WB only updates the cache and sets the dirty bit. Memory is updated later, when the block is evicted.
(C) TRUE. Memory is already up to date in WT, so evicting a block needs no transfer to memory.
(D) FALSE. The LRU victim chosen on a read miss in WB can be dirty.
Answer: (A), (B), (D)
A cache memory that has a hit rate of 0.8 has an access latency 10 ns and miss penalty 100 ns. An optimization is done on the cache to reduce the miss rate. However, the optimization results in an increase of cache access latency to 15 ns, whereas the miss penalty is not affected. The minimum hit rate (rounded off to two decimal places) needed after the optimization such that it should not increase the average memory access time is _____.
Answer: 0.85
Average memory access time is the hit latency plus the miss rate the miss penalty.
Before the optimization: ns.
After the optimization:
Answer: 0.85
Before the optimization: ns.
After the optimization:
Answer: 0.85
Consider a system with 2 KB direct mapped data cache with a block size of 64 bytes. The system has a physical address space of 64 KB and a word length of 16 bits. During the execution of a program, four data words P, Q, R, and S are accessed in that order 10 times (i.e., PQRSPQRS...). Hence, there are 40 accesses to data cache altogether. Assume that the data cache is initially empty and no other data words are accessed by the program. The addresses of the first bytes of P, Q, R, and S are 0xA248, 0xC28A, 0xCA8A, and 0xA262, respectively. For the execution of the above program, which of the following statements is/are TRUE with respect to the data cache?
One or more options are correct.
Answer: (A), (B), (D)
Number of lines = 2 KB / 64 B = 32. A 16-bit address splits into tag 5 bits, index 5 bits and offset 6 bits. Block number = address / 64, and line = block number mod 32.
- P = 0xA248 block 649 line 9
- Q = 0xC28A block 778 line 10
- R = 0xCA8A block 810 line 10
- S = 0xA262 block 649 line 9 (same block as P)
- S is always accessed after P has already loaded that block so every S access is a hit. True
- Only P and S use line 9 so P is never evicted. True
- Q and R use the same line 10 so every R access evicts Q. True
- At the end, the block of P (which holds S) and R are in the cache. So it is not "only R and S". False
Answer: Options 1, 2 and 4
- P = 0xA248 block 649 line 9
- Q = 0xC28A block 778 line 10
- R = 0xCA8A block 810 line 10
- S = 0xA262 block 649 line 9 (same block as P)
- S is always accessed after P has already loaded that block so every S access is a hit. True
- Only P and S use line 9 so P is never evicted. True
- Q and R use the same line 10 so every R access evicts Q. True
- At the end, the block of P (which holds S) and R are in the cache. So it is not "only R and S". False
Answer: Options 1, 2 and 4
Consider a computer system with a byte-addressable primary memory of size . Assume the computer system has a direct-mapped cache of size , and each cache block is of size 64 bytes.
The size of the tag field is __________ bits.
The size of the tag field is __________ bits.
Answer: 17
Number of cache lines = 32 KB / 64 B = 512 so the index is 9 bits. The block offset is 6 bits.
Tag = 32 9 6 = 17 bits
Answer: 17
Tag = 32 9 6 = 17 bits
Answer: 17
Consider a set-associative cache of size 2KB ( bytes) with cache block size of 64 bytes. Assume that the cache is byte-addressable and a 32 -bit address is used for accessing the cache. If the width of the tag field is 22 bits, the associativity of the cache is ______
Answer: 2
Block offset = bits. The tag has 22 bits the set index is 32 22 6 = 4 bits so there are 16 sets.
Number of lines = 2 KB / 64 B = 32. Associativity = 32 / 16 = 2.
Answer: 2
Number of lines = 2 KB / 64 B = 32. Associativity = 32 / 16 = 2.
Answer: 2
Keep practising