Question

Explain the difference between temporal and spatial locality of reference

Explain the difference between temporal and spatial locality of reference
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Answer:----------

Difference between temporal and spatial locality of reference:------------

Spatial locality:--------Spatial locality refers to the tendency of execution to involve a number of clustered memory locations. A program also tends to access data locations sequentially.

Temporal locality :----------Temporal locality refers to the tendency for a processor to access memory locations that have been used recently, eg when a loop is executed, the processor executes the same instructions repeatedly.

Good temporal locality ⇒ cache miss traffic decreases fast when cache size increases

Good spatial locality ⇒ cache miss traffic does not increase much when line size increases

HitA(M,L) – Hit rate (fraction of accesses that are cache hits) for sequence A of accesses for a (LRU, fully associative) cache of size M, with cache lines of length L (L divides M).

  • MissA(M,L) = 1-HITA(M,L) – Miss rate
  • MTA(M,L) = L × MissA(M,L) – Miss traffic

Good temporal locality = MTA(M,L) decreases fast when M increases
Good spatial locality = MTA(M,L) does not increase much when L increases (the miss rate decreases almost by a factor of L)

Add a comment
Know the answer?
Add Answer to:
Explain the difference between temporal and spatial locality of reference
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT