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 6–10 of 68
For a direct-mapped cache, 4 bits are used for the tag field and 12 bits are used to index into a cache block. The size of each cache block is one byte. Assume that there is no other information stored for each cache block.
Which ONE of the following is the CORRECT option for the sizes of the main memory and the cache memory in this system (byte addressable), respectively?
Which ONE of the following is the CORRECT option for the sizes of the main memory and the cache memory in this system (byte addressable), respectively?
Answer: (A)
The block size byte . So the offset field has bits. The index is bits and the tag is bits. The total address width bits.
Main memory size bytes, which KB.
Cache size (number of lines) (block size) bytes, which KB.
Answer: 64 KB and 4 KB
Main memory size bytes, which KB.
Cache size (number of lines) (block size) bytes, which KB.
Answer: 64 KB and 4 KB
Given a computing system with two levels of cache (L1 and L2) and a main memory. The first level (L1) cache access time is 1 nanosecond (ns) and the "hit rate" for L1 cache is 90% while the processor is accessing the data from L1 cache. Whereas, for the second level (L2) cache, the "hit rate" is 80% and the "miss penalty" for transferring data from L2 cache to L1 cache is 10 ns. The "miss penalty" for the data to be transferred from main memory to L2 cache is 100 ns.
Then the average memory access time in this system in nanoseconds is ___________ . (rounded off to one decimal place)
Then the average memory access time in this system in nanoseconds is ___________ . (rounded off to one decimal place)
Answer: 4
The L1 access time ( ns) is always spent first, whatever happens next. L2 and main memory are used only after a miss. So the average access time must count three cases: an L1 hit, an L1 miss followed by an L2 hit, and a miss in both followed by main memory:
Here ns is the extra penalty to bring data from L2 to L1 (added to the L1 time already spent). ns is the further extra penalty to bring data from main memory (added to the L1 and L2 time already spent). The hit rates are .
Answer: 4.0
Here ns is the extra penalty to bring data from L2 to L1 (added to the L1 time already spent). ns is the further extra penalty to bring data from main memory (added to the L1 and L2 time already spent). The hit rates are .
Answer: 4.0
Consider two set-associative cache memory architectures: WBC, which uses the write back policy, and WTC, which uses the write through policy. Both of them use the LRU (Least Recently Used) block replacement policy. The cache memory is connected to the main memory. Which of the following statements is/are TRUE?
One or more options are correct.
Answer: (B), (C)
WBC is write back and WTC is write through. Check each statement:
(A) FALSE. On a read miss in WBC, the LRU victim can be dirty, and then it must be written back. The word "never" is wrong.
(B) TRUE. In WTC, main memory is always up to date, so a victim block never needs a write back.
(C) TRUE. A write hit in WBC changes only the cache, so the dirty bit can change from 0 to 1.
(D) FALSE. In WTC the victim block is never dirty, so it is not written to main memory before the new block is loaded.
Answer: (B), (C)
(A) FALSE. On a read miss in WBC, the LRU victim can be dirty, and then it must be written back. The word "never" is wrong.
(B) TRUE. In WTC, main memory is always up to date, so a victim block never needs a write back.
(C) TRUE. A write hit in WBC changes only the cache, so the dirty bit can change from 0 to 1.
(D) FALSE. In WTC the victim block is never dirty, so it is not written to main memory before the new block is loaded.
Answer: (B), (C)
A given program has 25% load/store instructions. Suppose the ideal CPI (cycles per instruction) without any memory stalls is 2. The program exhibits 2% miss rate on instruction cache and 8% miss rate on data cache. The miss penalty is 100 cycles. The speedup (rounded off to two decimal places) achieved with a perfect cache (i.e., with NO data or instruction cache misses) is _________
Answer: 3
Each instruction is fetched from the I-cache. Also, 25% of instructions use the D-cache for data.
Stall cycles for each instruction:
- I-cache:
- D-cache:
CPI with the real cache: . CPI with a perfect cache: .
Speedup:
Answer: 3
Stall cycles for each instruction:
- I-cache:
- D-cache:
CPI with the real cache: . CPI with a perfect cache: .
Speedup:
Answer: 3
An 8-way set associative cache of size 64 KB (1 KB = 1024 bytes) is used in a system with 32-bit address. The address is sub-divided into TAG, INDEX, and BLOCK OFFSET.
The number of bits in the TAG is ____.
The number of bits in the TAG is ____.
Answer: 19
One way has a size of bytes.
The INDEX bits and the OFFSET bits together are used to address one way. So they add up to 13 bits. The block size does not matter here.
Number of TAG bits:
Answer: 19
The INDEX bits and the OFFSET bits together are used to address one way. So they add up to 13 bits. The block size does not matter here.
Number of TAG bits:
Answer: 19
Keep practising