Explain about Cache memory?
https://www.computersprofessor.com/2016/04/explain-about-cache-memory.html
Cache
Memory
|
Cache
memory is an intermediate form of storage between the ultra-fast registers
and the RAM. The CPU uses cache memory to store instructions and data that
are repeatedly required to execute programs, thereby improving the overall
system speed and increasing the performance of the computer. Maintaining
frequency accessed data and instructions in the cache helps in avoiding the
need to access the slower DRAM repeatedly.
Cache
memory is widely used for memory caching. Cache memory is basically a portion
of memory made of high speed static RAM (SRAM) instead of the slower and
cheaper DRAM which is used for main memory.
Some
memory caches are in-built in the architecture of microprocessors. For
example, the Intel 80486 microprocessor has an 8K memory cache, and the
Pentium has a 16K cache. Such internal caches are often called level 1 (L1)
caches. Modern PCs also come with external cache memory, called level 2(L2)
caches, which are built into the motherboard outside the CPU. Although L2
caches are composed of SRAM, they are much larger in size than L1 caches
level 3 (L3), which is not normally used, is an extra cache that has a much
larger size than L1 and L2 caches, but is slower than them (but faster than
RAM).
Working
of the Cache Memory
The
CPU first checks whether the data or instruction is available in the cache
memory. If it is not present there, the CPU reads the data or instructions
from the main memory into the processor registers and also copies it into the
cache memory. When the same piece of data/instruction is needed again, the
CPU reads it from the cache memory instead of the main memory.
|