Hit ratio in cache memory

Plz any body .....help me

Sameer Dubey @sameerz567
15 Nov 2014 10:46 pm

I think this organisation will have 50% hit ratio

It can be improved using direct mapped Cache

jamil @jishan
16 Nov 2014 08:05 am

yes but sameer brother plz explain 

Sameer Dubey @sameerz567
16 Nov 2014 09:02 am

See here it is clearly said that the block size of Cache as well as main memory is 4 bytes, and main...Therefore number of blocks in cache memory=(2^10)/(4)= 256...The cpu memory was two way interleaved means when means always 2B are read but block size is 4B so when the cpu will try to read 2B, 4B block will be transferred

and it is given that Cache is fully associative..now suppose in first block we have 4B say b1 b2 b3 b4, so it will try to read b1 b2, but entire block will be transferred, i.e when it will try to read b1 b2, b3 and b4 are also in cache, so next time when it will read b3 b4, it will be a hit as it is already in cache

The same thing will take place for every program for all others, for the loop part also, there is no prvision we can increase its hit...

therefore for every two reads there is a hit and a miss

so hit ratio=50%

But if we use direct mapped cache, the loops has 257 cache blocks, and in direct mapped cache, blocks have specific location in cache therefore, when the loop will repeat, blocks will be found again and again, and thus hit will increase

jamil @jishan
16 Nov 2014 11:01 am

lot of thanks my brother Sameer !!!!!