A set-associative cache consists of 64 lines, or slots, divided into four-line sets. Main memory contains 4K blocks of 128 words each. Show the format of main memory


CACHE MEMORY NUMERICAL

QUESTIONS:

  1. A set-associative cache consists of 64 lines, or slots, divided into four-line sets. Main memory contains 4K blocks of 128 words each. Show the format of main memory

Answer:

The cache is divided into 16 sets of 4 lines each. Therefore, 4 bits are needed to identify the set number. Main memory consists of 4K = 212 blocks. Therefore, the set plus tag lengths must be 12 bits and  therefore the tag length is 8 bits. Each block contains 128 words. Therefore, 7 bits are needed to specify the word.

 

TAG                    SET                    WORD

Main memory address =               8                           4                           7

 

  CLICK HERE FOR NEXT QUESTION