in CO and Architecture retagged by
612 views
0 votes
0 votes
Consider a single level cache with an access time of 2.5ns, a line of 64B and a hit ratio of 0.95. Main memory uses a block transfer capability that has a first word i.e. 4B access time of 50ns and after that 5ns for each word access. If cache waits until block is copied from MM to the cache and then access from cache,the access time is________(in ns) (upto 3 decimal places)
in CO and Architecture retagged by
612 views

14 Comments

I am getting 8.875ns as the answer. But soln says 8.75ns.
The equation that i used is:
Access time= 0.95(2.5)+ 0.05(2.5+50+15*5+2.5)=8.875ns
Am I correct?
1
1
Correct answer is 8.75ns.

You should not consider access time of cache twice. This is because once you have access to the block and even if it is a miss then you still have the access to the block. Block is being transferred in background while cache is in waiting state. Once the transfer is completed cache simply gives you corresponding word.
1
1

But to find out whether there is a miss in the cache, we need 2.5ns..next it is mentioned in the question that

If cache waits until block is copied from MM to the cache and then access from cache

So that means that 125 ns is needed to fetch the block from MM and then again 2.5ns is needed to access the block from cache..isnt it?

Where am i going wrong?

0
0
First, the address bus takes us to the desired cache-line in cache (this will take 2.5 ns including the search time). If there is a miss this means the required word is not present in the respective cache-line, but keep in mind that we are already on this cache-line and we are just waiting for the block to be arrived on this line.. Now when required block will be transferred (this will take memory access time i.e. 50ns + 15*5 ns) then the required word will be on that line on which we are already standing. Now we will just take the desired word through data bus. Thus, there will be no need to access the cache twice. Also since in question they haven't mentioned the WRITE OPERATION TIME in cache and not also the COPYING DELAY, so we'll just ignore these delays.

And keep in mind, that there are various methods for hierarchical access. It varies from book to book. This question doesn't explain detailed scenario. Don't panic. In Gate exam. they will clearly describe the scenario and they will also advise to ignore some delays accordingly in the question.
0
0

with respect to me

Access time= 0.95(2.5)+ 0.05(2.5+50+15*5+2.5)=8.875ns

This is a correct approach 

0
0
i have one question,

when we transfer the word from main memory to cache we need to transfer 16 words of 4B. for that why aren't using 16*2.5
0
0

If cache waits until block is copied from MM to the cache and then access from cache,the access time is

That highlighted part is asking to take data from cache.

I think after writing into cache (after complete transfer) we will be at cache itself then why again do we need to access cache ? Magma Somoshree Datta 5

0
0

Hemanth_13 i guess the searching time in cache to find out whether its a hit or a miss is considered to be negligible unless it is specified in question. So here formula should be:

Access time=h(cache access time)+(1-h)(time to fetch the block from MM+cache access time to access the block)

0
0

garimanand

when we transfer the word from main memory to cache we need to transfer 16 words of 4B. for that why aren't using 16*2.5

Because while transfering a block from MM to cache, we need to use consider the access time of MM since MM is being accessed as a result of the miss, And after the miss penalty, we need to consider the access time of cache to access the block of data that has been fetched from MM as a result of the miss. Moreover it is mentioned in question that:

. 4B access time of 50ns and after that 5ns for each word access.

 

0
0
i know this 50ns for word in mm and 5 for other 15. but we have to copy these blocks of 4B in cache too. and for that we have to access the cache for 16 times . i dont understand ?? please clear this doubt,
0
0

garimanand No it doesnt work this way..We consider the entire time of fetching the block from MM and putting it into the cache as miss penalty..we consider the cache access time only when we want to access a word in cache..See Astitva Srivastava's comment on this answer.

0
0

 i guess the searching time in cache to find out whether its a hit or a miss is considered to be negligible unless it is specified in question. So here formula should be:

But we generally take Cache access time in case of miss , but in write through policy we don't specifically take cache access time because we consider it to be a parallel write .

0
0
Ohk i get it ,thanks
0
0

sorry I didn't read the comment

so

Access time= 0.95(2.5)+ 0.05(2.5+50+15*5+2.5)=8.875ns  this approach is correct right  ???

0
0

Please log in or register to answer this question.

Related questions