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 36–40 of 68
The memory access time is 1 nanosecond for a read operation with a hit in cache, 5 nanoseconds for a read operation with a miss in cache, 2 nanoseconds for a write operation with a hit in cache and 10 nanoseconds for a write operation with a miss in cache. Execution of a sequence of instructions involves 100 instruction fetch operations, 60 memory operand read operations and 40 memory operand write operations. The cache hit-ratio is 0.9. The average memory access time (in nanoseconds) in executing the sequence of instructions is __________.
Answer: 1.68
Total reads = 100 instruction fetches + 60 operand reads = 160. Total writes = 40.
- Average read time = 0.9 1 + 0.1 5 = 1.4 ns
- Average write time = 0.9 2 + 0.1 10 = 2.8 ns
Overall average:
Answer: 1.68
- Average read time = 0.9 1 + 0.1 5 = 1.4 ns
- Average write time = 0.9 2 + 0.1 10 = 2.8 ns
Overall average:
Answer: 1.68
In a k-way set associative cache, the cache is divided into v sets, each of which consists of k lines. The lines of a set are placed in sequence one after another. The lines in set s are sequenced before the lines in set (s+1). The main memory blocks are numbered 0 onwards. The main memory block numbered j must be mapped to any one of the cache lines from
Answer: (A)
Main memory block j is placed in set j mod v. The cache lines of set s start at sk and go up to sk + (k 1).
Answer: (j mod v)*k to (j mod v)*k + (k1)
Answer: (j mod v)*k to (j mod v)*k + (k1)
A computer has a 256 KByte, 4-way set associative, write back data cache with block size of 32 Bytes. The processor sends 32 bit addresses to the cache controller. Each cache tag directory entry contains, in addition to address tag, 2 valid bits, 1 modified bit and 1 replacement bit.
The size of the cache tag directory is
The size of the cache tag directory is
Answer: (A)
Blocks: blocks.
Sets: 4-way, so sets, which needs 11 index bits.
Offset: block size 32 B, so 5 bits.
Tag: bits.
Each directory entry has the tag plus 2 valid bits, 1 modified bit and 1 replacement bit: bits. There is one entry per block.
Directory size bits Kbits.
Answer: (A) 160 Kbits
Sets: 4-way, so sets, which needs 11 index bits.
Offset: block size 32 B, so 5 bits.
Tag: bits.
Each directory entry has the tag plus 2 valid bits, 1 modified bit and 1 replacement bit: bits. There is one entry per block.
Directory size bits Kbits.
Answer: (A) 160 Kbits
A computer has a 256 KByte, 4-way set associative, write back data cache with block size of 32 Bytes. The processor sends 32 bit addresses to the cache controller. Each cache tag directory entry contains, in addition to address tag, 2 valid bits, 1 modified bit and 1 replacement bit.
The number of bits in the tag field of an address is
The number of bits in the tag field of an address is
Answer: (C)
Steps:
- Number of blocks = 256 KB / 32 B = 8192. Number of sets = 8192 / 4 = 2048 so the index is 11 bits.
- The offset is 5 bits.
Tag bits = 32 11 5 = 16 bits
Answer: 16
- Number of blocks = 256 KB / 32 B = 8192. Number of sets = 8192 / 4 = 2048 so the index is 11 bits.
- The offset is 5 bits.
Tag bits = 32 11 5 = 16 bits
Answer: 16
An 8KB direct mapped write-back cache is organized as multiple blocks, each of size 32-bytes. The processor generates 32-bit addresses. The cache controller maintains the tag information for each cache block comprising of the following. 1 Valid bit 1 Modified bit As many bits as the minimum needed to identify the memory block mapped in the cache. What is the total size of memory needed at the cache controller to store metadata
(tags) for the cache?
Answer: (D)
Steps:
- Number of blocks = 8 KB / 32 B = 256 so index = 8 bits and offset = 5 bits
- Tag bits = 32 8 5 = 19 bits
- Bits for each block: 19 + 1 (valid) + 1 (modified) = 21 bits
Total size = 256 21 = 5376 bits
Answer: 5376 bits
- Number of blocks = 8 KB / 32 B = 256 so index = 8 bits and offset = 5 bits
- Tag bits = 32 8 5 = 19 bits
- Bits for each block: 19 + 1 (valid) + 1 (modified) = 21 bits
Total size = 256 21 = 5376 bits
Answer: 5376 bits
Keep practising