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 31–35 of 68
Consider a machine with a byte addressable main memory of bytes, block size of 16 bytes and a direct mapped cache having cache lines. Let the addresses of two consecutive bytes in main memory be and . What are the tag and cache line address (in hex) for main memory address ?
Answer: (A)
The address has 20 bits. Offset = 4 bits (block is 16 bytes). Line = 12 bits ( lines). Tag = 20 16 = 4 bits.
E201F = E | 201 | F tag = E, line = 201
Answer: E, 201
E201F = E | 201 | F tag = E, line = 201
Answer: E, 201
An access sequence of cache block addresses is of length N and contains n unique block addresses. The number of unique block addresses between two consecutive accesses to the same block address is bounded above K. What is the miss ratio if the access sequence is passed through a cache of associativity Ak exercising least-recently-used replacement policy?
Answer: (A)
Between two accesses to the same block, at most k other blocks are used. With LRU, the cache keeps A k blocks per set. So a block is never removed before it is used again. Only the first access to each of the n distinct blocks is a miss.
Miss ratio = n / N
Answer: n/N
Miss ratio = n / N
Answer: n/N
A 4-way set-associative cache memory unit with a capacity of 16 KB is built using a block size of 8 words. The word length is 32 bits. The size of the physical address space is 4 GB. The number of bits for the TAG field is _____
Answer: 20
Go through each part:
- One block has 8 words, so 8 4 B = 32 B the offset is 5 bits
- Number of blocks = 16 KB / 32 B = 512, and number of sets = 512 / 4 = 128 the index is 7 bits
- The address space is 4 GB the address is 32 bits
TAG = 32 7 5 = 20 bits
Answer: 20
- One block has 8 words, so 8 4 B = 32 B the offset is 5 bits
- Number of blocks = 16 KB / 32 B = 512, and number of sets = 512 / 4 = 128 the index is 7 bits
- The address space is 4 GB the address is 32 bits
TAG = 32 7 5 = 20 bits
Answer: 20
In designing a computer's cache system, the cache block (or cache line) size is an important Parameter. Which one of the following statements is correct in this context?
Answer: (D)
Check each statement:
(A) False. A smaller block brings in fewer neighbouring words, so it uses spatial locality less, not better.
(B) False. A smaller block gives more blocks, so there are more tags in total, and the tag does not get smaller. So tag overhead is higher, not lower.
(C) False. More or larger tags mean more bits to store and compare. This does not make a hit faster.
(D) True. On a miss only a small block is moved from memory, so the miss penalty is lower.
Answer: (D)
(A) False. A smaller block brings in fewer neighbouring words, so it uses spatial locality less, not better.
(B) False. A smaller block gives more blocks, so there are more tags in total, and the tag does not get smaller. So tag overhead is higher, not lower.
(C) False. More or larger tags mean more bits to store and compare. This does not make a hit faster.
(D) True. On a miss only a small block is moved from memory, so the miss penalty is lower.
Answer: (D)
If the associativity of a processor cache is doubled while keeping the capacity and block size unchanged, which one of the following is guaranteed to be NOT affected?
Answer: (D)
When associativity is doubled, the cache has half as many sets. The index becomes 1 bit smaller, the tag becomes 1 bit larger, and the way multiplexer needs twice as many inputs.
The width of the data bus between the processor and main memory does not depend on how the cache is organised.
Answer: Width of processor to main memory data bus
The width of the data bus between the processor and main memory does not depend on how the cache is organised.
Answer: Width of processor to main memory data bus
Keep practising