The cache memory is one of the fastest memory. Though it is costlier than the main memory but more useful than the registers. The cache memory basically acts as a buffer between the main memory and the CPU. Moreover, it synchronizes with the speed of the CPU. Besides, it stores the data and instructions which the CPU uses more frequently so that it does not have to access the main memory again and again. Therefore the average time to access the main memory decreases.
It is placed between the main memory and the CPU. Moreover, for any data, the CPU first checks the cache and then the main memory.
Basic Operations
Its basic operations are as follows:
The CPU first checks any required data in the cache. Furthermore, it does not access the main memory if that data is present in the cache.
On the other hand, if the data is not present in the cache then it accesses the main memory.
The block of words that the CPU accesses currently is transferred from the main memory to the cache for quick access in the future.
The hit ratio defines the performance of the cache memory.
ADVERTISEMENT
Advantages of Cache Memory
The advantages are as follows:
It is faster than the main memory.
The access time is quite less in comparison to the main memory.
The speed of accessing data increases hence, the CPU works faster.
Moreover, the performance of the CPU also becomes better.
The recent data stores in the cache and therefore, the outputs are faster.
Disadvantages of Cache Memory
The disadvantages are as follows:
It is quite expensive.
The storage capacity is limited.
留言