1,980 views
2 votes
2 votes
A byte-addressable computer has a small data cache capable of holding eight 32 bit words each cache block consists of one 32 bit word. When a given program is executed the processor reads data sequentially from the following hex addresses :200,204,208,20C,2F4,2F0,200,204,218,21C,24C,2F4 this pattern is repeated four times. Assume that cache is initially empty. If direct mapping is used compute the hit ratio

2 Answers

0 votes
0 votes

In this question , we have given that the Number of Blocks =  eight 32-bit word  (means) = 8 x 32 = 256 block 

which means Address bits required to store the 256 blocks = 3 bit.

No. of locations in One block 32-bit since memory is byte-addressable hence = 32/8 byte = 4 Byte  

which means address bits required to store the 4 Byte = 2 bit.

As given in the question the hex address is = 12 bit long, So, Moemory Address is also 12bit long

 

Bite representation of hex number 

              tag   block no. location

              7 bit      3b   2b

200 -   0010000 000 00

204 -   0010000 001 00

208 -   0010000 010 00

20C -  0010000 011 00

2F4 -  0010111 101 00

2F0 -  0010111 100 00

218 -  0010000 110 00

21C -  0010000 111 00

24C -  0010010 011 00

so,  3-bit represent the block number

 

 

 

 

 

 

 

 

Now, In First there are total  miss       = 9 miss

          In secound  20C, 24C will miss = 2 miss 

          In third again  20C, 24C will miss = 2 miss 

          In forth again 20C, 24C will miss = 2 miss

total Number of miss = 15 miss

Percentage of miss ratio is = ((15/48)x100)

                                                = 31.25%

Percentage of hit ratio = (100-31.25) 

                                        = 68.75% ~ 69%

Related questions

0 votes
0 votes
1 answer
1
Mrityudoot asked Jun 5, 2023
609 views
In a 2 level hierarchy, the cache has an access time of 15 ns and the main memory has an access time of 110 ns, the hit rate of the cache is 90%. If the block size of the...
0 votes
0 votes
1 answer
3
0 votes
0 votes
0 answers
4
aditi19 asked Dec 5, 2018
297 views
https://gateoverflow.in/494/gate2008-71can someone explain how indexes of the array elements have been calculated?