1
19kviews
A block set associative cache consist of 64 blocks divided in 4 block sets. The main memory contains 4096 blocks, each 128 words of 16 bit length.
  1. How many bits are there in main memory address?

  2. How many bits are there in cache memory address (tags, set and word fields)?

1 Answer
4
5.1kviews

Given,

Number of blocks in cache memory = 64

Number of blocks in each set of cache = 4

Main memory size = 4096 blocks = $ 2^{12} $

Block size = 128 words = $ 2^7 $ words

Bits in Main Memory Address

Size of main memory = 4096 blocks = $ 2^{12} $

= $ 2^{12} * 2^7 $

= $ 2^{19} $

Hence there will be 19 bits in the main memory

Bits in Cache Memory Address (TAG, SET and Word Fields)

Size of main memory = 4096 blocks = $ 2^{12} $

Hence the tag and set field combine will have 12 bits

TAG + SET = 12 bits

Number of sets = 64/4 = 16

SET = The cache is divided into 16 = $ 2^4 $ sets

SET = 4 bits

TAG = 12 bits - 4 bits = 8 bits

Each block consist of 128 words = $ 2 ^ 7 $ words

Hence the Word Field length will be 7 bits

Please log in to add an answer.