in CO and Architecture edited by
294 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
in CO and Architecture edited by
294 views

1 comment

when I do the calculation
I’m getting the no. of Tag bits=14, no. of index bits=block offset bits=9.
How can we even map as these are not in multiples of 4????
0
0

1 Answer

2 votes
2 votes
Best answer
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

2 Comments

the answer of first address is wrong as of bit counting the resulting 9 bits from C012 after ignoring 6 bits from back then it would be 

100000000

and answer willl be 256

0
0

yes you are right i have missed 1 bit in every answer

  1. 100 0000 00 => 256
  1. 000 0000 11 => 3
  1. 101 0110 01 => 345
  1. 101 0101 00 => 340
1
1