edited by
342 views
2 votes
2 votes

Assume a computer has a 32-bit address. Each block stores 64 bytes. A direct mapped cache has 512 blocks. In which block of cache would we look for each of the following addresses:

  1. 1A2BC012
  2. FFFF00FF
  3. 12345678
  4. C109D532
edited by

1 Answer

Best answer
2 votes
2 votes
Byte offset = log2(64)= 6bits

Bits to represent cache lines= log2(512)= 9bits

Tag bits= 32-(6+9)= 17 bits

 

1A2BC012 => consider C01 only to check for block of cache (1 letter represent – 4 bits)

C01 => (1100 0000 0001)

=> (00  0000  000)  (we have to take 9 bits from back after ignoring 6 bits of byte offset)

00 0000 00 = 0

 

FFFF00FF => 00F => 0000 0000 1111 => 00 0000 111 => 7

12345678 => 567 => 0101 0110 0111 => 01 0110 011 => 179

C109D532=> D53 => 1101 0101 0011 => 01 0101 001=> 169
selected by

Related questions

303
views
1 answers
2 votes
215
views
1 answers
1 votes
lovish_bhatia asked Dec 13, 2023
215 views
please explain this question
215
views
1 answers
2 votes
lovish_bhatia asked Aug 15, 2023
215 views
consider a system which supports 2-address and 1-address instructions. The system has 18 bits instructions. if there are 7 2-address instructions and 1152 1-address instructions, then what is the maximum size of memory supported by system?
701
views
0 answers
0 votes
TusharKumar asked Dec 23, 2022
701 views
the answer is 28