retagged by
4,798 views

2 Answers

Best answer
9 votes
9 votes

The tag bits signify how many blocks of main memory will be mapped to the same set as similar to same line in case of direct mapping..

So given no of lines(or blocks) in cache memory = 512

  Associativaity i.e. k   =   4

 So no of sets             = 512 / 4

                                 = 128

But no of blocks in main memory  = 8192

So no of blocks that will be mapped to same set  =  8192 / 128

                                                                        =  213 / 2

                                                                        =  64

Hence no of tag bits required                              =  log2(No of blocks mapped to same set)

                                                                        =  log264

                                                                        =  6 bits

Hence 6 should be the correct answer.. 

selected by

Related questions

0 votes
0 votes
2 answers
1
Tehreem asked Sep 22, 2015
1,000 views
If there is k-set associative cache, with total x cache blocks, and 2^n main memory locations, how is the mapping calculated?