COMPUTER SCIENCE AND ENGINEERING
COMPILER DESIGN
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
Spatial locality
|
|
Temporal locality
|
|
Referential locality
|
|
Cache memory
|
Detailed explanation-1: -Temporal locality is the tendency of programs to use data items over and again during the course of their execution. This is the founding principle behind caches and gives a clear guide to an appropriate data-management heuristic.
Detailed explanation-2: -Temporal locality means current data or instruction that is being fetched may be needed soon. So we should store that data or instruction in the cache memory so that we can avoid again searching in main memory for the same data.
Detailed explanation-3: –The principle of spatial locality says that if a program accesses one memory address, there is a good chance that it will also access other nearby addresses. The principle of temporal locality says that if a program accesses one memory address, there is a good chance that it will access the same address again.
Detailed explanation-4: -Locality of reference refers to a phenomenon in which a computer program tends to access same set of memory locations for a particular time period. In other words, Locality of Reference refers to the tendency of the computer program to access instructions whose addresses are near one another.
Detailed explanation-5: -Notice that in every single instruction, the filing clerk needs to access the total card. This is an example of temporal locality because it involves accessing the same piece of data frequently over a short period of time.