recategorized by
1,022 views
0 votes
0 votes
To use cache memory, main memory is divided into cache lines, typically $32$ or $64$ bytes long. An entire cache line is cached at once. What is the advantage of caching an entire line instead of a single byte or word at a time?
recategorized by

2 Answers

2 votes
2 votes
An entire blocks of data (cache line )is copied from memory to the cache because the principle of locality tells us that once a byte is accessed, it is very likely that a nearby data will be needed soon.

principal of locality of reference does not always hold..But USUALLY holds.

So, By taking the complete contiguous address as a cache block ,reduce the chance for Cache miss.. directly improve the CPU performance.
1 votes
1 votes

Answer: An entire cache line is cached at once just to take advantage of the locality of reference since the memory access posses the principle of locality of reference. The locality of reference says if memory is accessed then the probability of accessing the nearby locations again is very high. So, by caching a complete cache line the probability of cache hit is increased.

Related questions

0 votes
0 votes
0 answers
2
admin asked Oct 23, 2019
195 views
What is the difference between kernel and user mode? Explain how having two distinct modes aids in designing an operating system.
0 votes
0 votes
0 answers
3
admin asked Oct 23, 2019
398 views
There are several design goals in building an operating system, for example, resource utilization, timeliness, robustness, and so on. Give an example of two design goals ...