For a direct-mapped cache, bits are used for the tag field and 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?
View worked solution
Answer: A
To find the sizes of the main memory and the cache memory, we analyze the fields of the physical address in a direct-mapped cache system.
1. Physical Address Format
For a direct-mapped cache, the physical address is divided into three fields:
2. Calculating the Fields
- Block Offset: The system is byte-addressable, and the size of each cache block is byte.
- Index Field: Given as bits (used to select/index the cache block).
- Tag Field: Given as bits.
3. Main Memory Size
The total number of bits in the physical address is:
Since the system is byte-addressable, the Main Memory size is:
4. Cache Memory Size
The number of lines (or blocks) in the cache is determined by the index bits:
The cache memory size (data capacity) is:
Thus, the main memory size is KB and the cache memory size is KB, which corresponds to Option A.
Free practice · Your answers on this page are not saved.
