Can someone help me with this problem please, I am lost and need it asap! Thanks
ID: 3803827 • Letter: C
Question
Can someone help me with this problem please, I am lost and need it asap! Thanks in advance!
Consider a memory system with a two-level hierarchy with a cache M1 and main memory M2. The size of the main memory, M2 is 256 bytes with block size of 16 bytes. The size of the cache, M1 is 64 bytes with the same block size of 16 bytes. The word length is 4 bytes, implying 4 words per block. A certain trace program generates the following sequence of word addresses,0, 8, 16, 1, 24, 21, 20, 3, 32, 61, 31, 19, 16, 60, 28, 21, 8, 11, 19, 22, 28, 42, 55, 58, 59 Note, every time a new block is accessed by the cache, up to 4 words are received implying that if block 0 is accessed from the main memory then 0, 1, 2, 3 words are obtained, if block 1 is accessed from the main memory, words 4, 5, 6, 7 are obtained, if block 2 is accessed from the main memory words 8, 9, 10, 11 are obtained and so on. The addresses given above are word addresses, not memory block addresses. Assume that the access time is 2 clocks from the cache (M1) and 50 clocks from main memory (M2), the transfer rate is 4 bytes per clock and that 25% of the transfers are dirty. The base CPI of a perfect memory system is 1.75. (a) Consider a fully associative cache with LRU replacement policy. Determine the hit ratio. What is the average memory access time? (b) Consider a direct mapped cache. Determine the hit ratio. What is the average memory access time?Explanation / Answer
3
hit ratio= nombert of hits/total sequence=10/25=0.40
time for a miss=time to access main memory+4*time to transfer+time to access cache +1*
transfer=50+40*1+2+1=57clocks
time for a hit=3clocks
total time=15*time for a miss+10*time for a hit +15*57+10*3=885clocks
average time=total time/25=35.4clocks
b)
25
26
58
59
m
h
hit ratio=no.of hits/total sequence=0.36
total time=16*time for a miss+9*time for a hit=939clocks
average time=total time/25=37.56clocks
S.NO SEQUENCE Cache cache cache cache hit/miss 1 0 0,1,2,3 m 2 8 8,9,10,11 m3
16 16,17,18,19 m 4 1 0,1,2,3 h 5 24 24,25,26,27 m 6 21 20,21,22,23 m 7 20 20,21,22,23 h 8 3 0,1,2,3 h 9 32 32,33,34,35 m 10 61 60,61,62,63 m 11 31 28,29,30,31 m 12 19 16,17,18,19 m 13 16 16,17,18,19 h 14 60 60,61,62,63 h 15 28 28,29,30,31 h 16 21 20,21,22,23 m 17 8 8,9,10,11 m 18 11 8,9,10,11 h 19 19 16,17,18,19 m 20 22 20,21,22,23 h 21 28 28,29,30,31 h 22 42 40,41,42,43 m 23 55 52,53,54,55 m 24 58 56,57,58,59 m 25 59 56,57,58,59 hRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.