8,062 views
4 votes
4 votes
Consider a single-level cache with an access time of 2.5 ns, a line size of 64 bytes, and a hit ratio of H 0.95. Main memory uses a block transfer capability that has a first word (4 bytes) access time of 50 ns and an access time of 5 ns for each word thereafter.

a. What is the access time when there is a cache miss? Assume that the cache waits until the line has been fetched from main memory and then re-executes for a hit.

b. Suppose that increasing the line size to 128 bytes increases the H to 0.97. Does this reduce the average memory access time?

1 Answer

Best answer
8 votes
8 votes

a. Hierarchical access is mentioned in question. 

$T_{avg}=  time_{cache}+ \left(1-hit_{cache}\right)\left[time_{memory}\right]$

$=2.5+(1-.95)[125]$

as line size is 64 bytes there are 16 words in a cache line fetch and first word is of four bytes having access time 50 ns and remaining fifteen have access time 75 ns(i.e.,125 ns )

$=2.5 + 6.25$

$=8.75$


(b)

now line size increases ie 128 bytes as now there are 32 words .

first word access is 50 ns than after that 5 for each 31 words

$=50+155$

$=205$(block access time) 

now hit ratio is .97

$T_{avg}=2.5+(1-.97)[205]$

$=2.5 + 6.15$

$=8.65$

edited by

Related questions