335 views
0 votes
0 votes
Consider two cache organisations.The first is 64KB 4 way associative with 64 byte block size.The second one is 64KB direct mapped cache.The size of address is 32 bits in both organisation.A 4 *1 MUX has latency of 0.8nsec which k bit comparator has latency of k/5 nsec.The difference between the hit latencies of both cache organisation

1 Answer

Best answer
2 votes
2 votes

Given address size     =     32 bits

Let us calculate number of tag bits in each cache :

a) For direct mapped cache :

No of bits needed for block offset  =  log2 (No of words in 1 block)   =  log264   =  6

No of bits needed for indexing (finding block no in cache)   =   log2(Cache size / cache block size)

                                                                                     =   log2(64 KB / 64 B)

                                                                                     =   10

Hence number of bits needed for tag                                =   32  -  6  -  10

                                                                                     =   16 bits

Hence latency  needed                                                   =   Tag comparator delay [ Mux delay is only for selecting a block given a set hence used in set associative cache only ]              =    k /  5

                                                                                    =    16 / 5    =  3.2 ns

b) For set associative cache : 

                                                Number of blocks          =    Cache size / Block size

                                                                                   =     64 KB / 64 B

                                                                                   =     210

                                   Hence   number of sets              =     Number of blocks / Associativity

                                                                                   =     210 / 22

                                                                                   =     28

                      Hence number of tag bits                        =     32  -  8  -  6

                                                                                   =    18  bits

                     Hence delay needed                                =     MUX delay + Tag comparator delay

                                                                                   =     0.8  +   (18 / 5)

                                                                                   =     4.4 ns

Hence difference in hit latencies of direct mapped and set associative cache  =   4.4  - 3.2 ns

                                                                                                                       =   1.2 ns 

   

selected by

Related questions

0 votes
0 votes
0 answers
1
Ray Tomlinson asked Aug 22, 2023
248 views
is this formula is correct if it is correct then in gate 2006 Question 75 why they not used this formulahttps://gateoverflow.in/43565/gate-cse-2006-question-75
0 votes
0 votes
0 answers
3
1 votes
1 votes
3 answers
4
Deepalitrapti asked Aug 10, 2018
1,240 views
Consider a direct mapped cache with 16 blocks with block size of 16 bytes. Initially the cache is empty. The following sequence of access of memory blocks:Ox80000, Ox8000...