Cache memory | Definition and concept
Cache
memory is a special memory that acts between main memory and CPU (Central
Processing Unit). Cache memory is a fast memory, managed entirely by hardware.
Cache memory is not visible to CPU. It contains most recently data used by the
CPU. It uses SRAM technology, which is faster but costly.
If
CPU request an element, then this element is first search in Cache memory but
if element is not present in cache memory, then this element is search in main
memory. If this element is again not present in main memory, this condition is
called page fault.
The
efficiency of cache memory is measured by cache
hit ratio.
Cache hit : If CPU request an data and this data
exists in cache memory, then it is called cache hit and no involvements of main
memory is required to complete the operation.
Cache miss : If CPU request an data and this data
does not exists in cache memory, then such situation is called cache miss.
Cache memory operates
on two major principles of locality:
Temporal locality: Data which have been used most
recently by CPU is more likely to be used again.
Spatial locality: If the data is referenced, it is
very likely that nearby data will be accessed soon.
Cache levels
In
a system, more than one cache can be used. These caches are organised into
levels from one to four.
Need
of levelling
Larger
cache memory is very costly. It has very hit rate but longer latency (delay).
Multilevel cache generally operates by checking the smallest cache first. If it
hits, processor processes at very speed and if misses, then next larger cache
will be checked and so on for last higher level cache.
Level
1 ranges from 8 kb to 64 kb, level 2 ranges from 64 kb to 8 mb, level 3 ranges
from 4 mb to 256 mb, level 3 is also known as victim cache and level 4 is
greater than 512 mb and known as remote cache.
Cache
1.
Inclusive cache: Inclusive cache means that content
of level 1 cache memory are also available in level 2. We can say that level 1
is subset of level 2.
2.
Exclusive cache: Exclusive cache means that the data
is stored in one cache level only.
0 comments:
Post a Comment