in CO and Architecture edited by
765 views
1 vote
1 vote

in CO and Architecture edited by
765 views

4 Comments

anu, we multiply with the number of cache entries( which i referred as cache lines ).

see https://gateoverflow.in/43311/gate2012-55 and follow the comment thread, i guess you will get my point.

Also check my comment above if you have any doubts regarding this question.

0
0
Are valid, modified and replacement bits also considered as tag bits?
0
0
bits in tag * no. of cache lines

number of cache lines  = which is 32 here i.e, 32 blocks are given.
0
0

1 Answer

4 votes
4 votes
Best answer

Given main memory size   =    4 GB

   Hence number of bits needed for CPU generated address  =   log2 (4 G)   =   32 bits [ Assuming byte addressable ]

Given cache memory size   =    64 KB 

  Number of cache lines       =    32

  Hence line size                 =    Cache memory size / Number of cache lines

                                         =    216 /  25

                                         =    211 B

Hence number of bits needed for line(block) offset   =  11 bits

Number of sets                   =   Number of lines / Associativity

                                         =   32 / 4    =   8

Number of bits needed for set index      =   log2 (Number of sets)

                                                          =   log2 8     

                                                          =   3

Hence number of tag bits                      =  Total address length - Set offset - Block offset

                                                           =  32  -  3  -  11

                                                           =  18 bits

And extra bits needed                            =  4  [ as mentioned in the question ]

Hence in cache controller number of bits associated for each cache line   =   18 + 4  =  22 bits

Hence total tag overhead in cache controller       =     Number of cache lines * Tag overhead for each line

                                                                       =     32 * 22

                                                                       =     704 bits

The options are wrongly framed in the question..

                                                       

selected by

4 Comments

Yes,if the question says so.
0
0
if nothing mentioned then we consider it with tag or offset ??
0
0
By default we will have to include as well as cache controller needs to have these additional information bits if mentioned in the question for each cache line.Hope u get it @student2018..
1
1

Related questions