Explain the following concepts with a simple example for eac
Solution
a. Spatial locality:
A measure of spatial locality that predicts sensitivity of catche miss bandwidth to line size depends on catche size. If a particular memory location is referred at a particular time, then it is likely that near by memory location will be referred in the near feature. In this case it is common to attempt to guess the size and shape of the area around the current reference for which it is to prepare faster access.
Example: It is obvious that an instruction stream will exhibit considerable spatial locality in the absence of jumps the next instruction to be executed is the one immediately following the current one.
Temporal locality:
A measure of temporal locality that predicts sensitivity of cache bandwidth to the line size must depends on cache size. If at one particular point memory location is seen it is likely that the same location will be referred near future. Temporal locality is a special case of spatial locality namely when the lacation is identical to the present location.
Example: A cache is a simple example of temporal locality, it is specially designed faster for smaller memory area and it is used to keep recently referrence data and data near the referrenced data.
2. The simplest example of temporal locality is instructions in loop.
