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 21–25 of 68
The size of the physical address space of a processor is bytes. The word length is bytes. The capacity of cache memory is Bytes. The size of each cache block is words. For a K-way set-associative cache memory, the length (in number of bits) of the tag field is
Answer: (B)
The block has words of bytes, so it is bytes. The block offset therefore has bits.
Number of blocks in the cache .
With K blocks in each set, number of sets .
So the set index has bits.
The address has P bits, so
M and W cancel, so options (C) and (D), which still contain them, are wrong. Option (A) has the sign of wrong: more ways mean fewer sets, a shorter index, and so a longer tag.
Answer: (B)
Number of blocks in the cache .
With K blocks in each set, number of sets .
So the set index has bits.
The address has P bits, so
M and W cancel, so options (C) and (D), which still contain them, are wrong. Option (A) has the sign of wrong: more ways mean fewer sets, a shorter index, and so a longer tag.
Answer: (B)
Consider a two-level cache hierarchy with L1 and L2 caches. An application incurs 1.4 memory accesses per instruction on average. For this application, the miss rate of L1 cache 0.1, the L2 cache experiences, on average, 7 misses per 1000 instructions. The miss rate of L2 expressed correct to two decimal places is ___________.
Answer: 0.05
Take 1000 instructions. The memory accesses are 1400. The L1 misses are 0.1 1400 = 140. All 140 of these go to L2, and L2 misses 7 of them.
L2 miss rate = 7 / 140 = 0.05
Answer: 0.05
L2 miss rate = 7 / 140 = 0.05
Answer: 0.05
Consider a 2-way set associative cache with 256 blocks and uses LRU replacement, Initially the cache is empty. Conflict misses are those misses which occur due the contention of multiple blocks for the same cache set. Compulsory misses occur due to first time access to the block. The following sequence of accesses to memory blocks.
(0,128,256,128,0,128,256,128,1,129,257,129,1,129,257,129)
is repeated 10 times. The number of conflict misses experienced by the cache is ___________.
(0,128,256,128,0,128,256,128,1,129,257,129,1,129,257,129)
is repeated 10 times. The number of conflict misses experienced by the cache is ___________.
Answer: 76
The cache has 128 sets (2-way). Blocks 0, 128 and 256 map to set 0. Blocks 1, 129 and 257 map to set 1. In each round, set 0 sees this sequence: 0, 128, 256, 128, 0, 128, 256, 128.
- Round 1: 0, 128 and 256 are compulsory misses. After that, 0 and 256 miss again (conflict) 2 conflict misses.
- Every later round: 0 and 256 keep evicting each other, and 128 stays in the cache 4 conflict misses.
Set 0: 2 + 9 4 = 38. Set 1 behaves in the same way, so it also gives 38. Total = 76
Answer: 76
- Round 1: 0, 128 and 256 are compulsory misses. After that, 0 and 256 miss again (conflict) 2 conflict misses.
- Every later round: 0 and 256 keep evicting each other, and 128 stays in the cache 4 conflict misses.
Set 0: 2 + 9 4 = 38. Set 1 behaves in the same way, so it also gives 38. Total = 76
Answer: 76
A cache memory unit with capacity of N words and block size of B words is to be designed. If it is designed as a direct mapped cache, the length of the TAG field is 10 bits. If the cache unit is now designed as a 16-way set-associative cache, the length of the TAG field is ______bits.
Answer: 14
A direct mapped cache has N/B lines. A 16-way set-associative cache has (N/B)/16 sets. This means there are 16 = times fewer sets the index loses 4 bits, and these 4 bits go to the tag.
Tag = 10 + 4 = 14 bits
Answer: 14
Tag = 10 + 4 = 14 bits
Answer: 14
In a two-level cache system, the access times of and caches are 1 and 8 clock cycles, respectively. The miss penalty from L2 cache to main memory is 18 clock cycles . The miss rate of cache is twice that of . The average memory access time (AMAT) of this cache system is 2 cycles. This miss rates of and respectively are :
Answer: (A)
AMAT = using :
Solve for L2 miss rate:
Find L1 miss rate:
Answer: 0.111 and 0.056
Solve for L2 miss rate:
Find L1 miss rate:
Answer: 0.111 and 0.056
Keep practising