in CO and Architecture retagged by
801 views
8 votes
8 votes

A computer has a $32$-bit address bus with a direct mapped cache, using $4$ bits for block offset, $16$ tag bits, and $12$ index bits.

Which of the following address pairs can be placed in the cache simultaneously?

  1. $\textsf{3AC6 F45 6}$ and $\textsf{26A3 545 6}$
  2. $\textsf{3F08 C30 4}$ and $\textsf{3F08 C37 1}$
  3. $\textsf{5E3C 768 0}$ and $\textsf{8F3C 768 A}$
  4. $\textsf{2233 445 5}$ and $\textsf{2233 445 C}$
in CO and Architecture retagged by
801 views

1 comment

$ \large{\colorbox{yellow}{Detailed video solution of this question with direct time stamp}}$
All India Mock Test 3 - Solutions Part 2

0
0

1 Answer

8 votes
8 votes

edited by

7 Comments

@Sachin Mittal 1 Satisfied with option D as index+tag bits are matching, how option A and B are correct as in both options tag+index bits are not matching?

0
0
ques says which can be in the cache SIMULTANEOUSLY, so if they belong to the same index then they cannot be in the cache simultaneously in direct mapped, thats why A ,B correct, they will map to different cache index so no prb.
1
1

@DevDh what if it were like 2-way-set-associative cache? In this case what will be answer?

0
0
in that case we will have 2 ^ 12 blocks in the cache (from direct mapped index we get this) then, since it is 2 way, we will calculate the no. of “sets” = 2^12 / 2^1 = 2^11 now we have 11 bits that tell us set no. ignoring the offset (LSB 4 bits) now , just convert the options into the binary to check if any of the addresses match, BUT ! since each set is 2 way even if they match they can exist simultaneously in the cache, so yeah? hope this calculations correct
0
0

In options A and B, we have different tag and index values and hence they will be mapped to different cache lines ---> they can be present in the cache simultaneously.

For option D, tag and index bits are exactly the same, only offset bits are different and hence these addresses are of the same block!

4
4

What does it mean by

Having Same Tag part and Different Tag part for two addresses if nothing else is given.

What does this Tag part represent? @GO Classes 

0
0
Actually the question is asking for simultaneous transfer of the given address from main memory to cache.So simultaneous transfer is possible only for 2 cases-

1-Given address are present in same block(means same tag and same cache index)->matches option D

2-Given address are present in 2 different blocks who are never going to be placed in same cache index(means different index no)->matches option A and B.
5
5
Answer:

Related questions