Machine-translated by Google. Questions are authored in English.
Top

Discussion

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?

  • A.64 KB and 4 KB
  • B.128 KB and 16 KB
  • C.64 KB and 8 KB
  • D.128 KB and 6 KB

Answer: A

The sizes are 64 KB of main memory and 4 KB of cache.

With one-byte blocks there is no offset field, so the address consists of the tag and the index only:

\[ \begin{aligned} \text{address bits} &= 4 + 12 = 16 \\ \text{main memory} &= 2^{16}\ \text{B} = 64\ \text{KB} \\ \text{cache} &= 2^{12} \times 1\ \text{B} = 4\ \text{KB} \end{aligned} \]

The cache has one block per index value, 212 blocks of one byte each, and the question says nothing else (tags or valid bits) is counted. 128 KB would need a 17-bit address, and caches of 8 KB, 16 KB or 6 KB do not match a 12-bit index with one-byte blocks.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.