Question:

Given the following cache parameters:

\[ \begin{array}{|c|c|} \hline \textbf{Tag} & 4 \, \text{bits} \\ \textbf{Index} & 12 \, \text{bits} \\ \textbf{Block Size} & 1 \, \text{byte} \\ \hline \end{array} \]

Find the size of the main memory and the size of the cache memory.

Show Hint

For a cache memory configuration, the cache size is determined by the number of sets and the block size. The main memory size depends on the tag, index, and block size.
Updated On: Feb 14, 2025
  • 64 KB, 4 KB
  • 128 KB, 8 KB
  • 256 KB, 16 KB
  • 512 KB, 32 KB
Hide Solution
collegedunia
Verified By Collegedunia

The Correct Option is A

Solution and Explanation

Step 1: Calculate the size of the cache memory.

The cache size is given by the formula: \[ \text{Cache Size} = \text{Number of Sets} \times \text{Block Size} \] - The number of sets is \( 2^{\text{Index bits}} = 2^{12} = 4096 \).
- The block size is 1 byte.


Thus, the cache size is: \[ \text{Cache Size} = 4096 \times 1 = 4096 \, \text{bytes} = 4 \, \text{KB}. \]

Step 2: Calculate the size of the main memory.

The size of the main memory is calculated as: \[ \text{Main Memory Size} = 2^{\text{Tag bits} + \text{Index bits} + \text{Block size bits}} = 2^{4 + 12 + 0} = 2^{16} = 65536 \, \text{bytes} = 64 \, \text{KB}. \]

Thus, the main memory size is \( 64 \, \text{KB} \) and the cache memory size is \( 4 \, \text{KB} \).
Was this answer helpful?
0
0

Top Questions on Programming in C

View More Questions