Today is an electrical and electronic world in which we can store data in the memory. Memory is also of different types in which main memory and secondary memory people know basically. Apart from these two types of memory, there is a very important type of memory known as CACHE memory. Pronounced as cash, the cache is a special high-speed storage mechanism. It can be either a reserved section of main memory of an independent high speed storage device. Whenever some data is required, the CPU first looks in the cache, if it is there or not. If the data is found in cache, CPU does not access memory and hence the process becomes very fast.
A memory cache, sometimes called a cache store of RAM cache, is a portion of memory made of high-speed static RAM (SRAM) instead of the slower and cheaper dynamic RAM (DRAM) used for main memory. Memory caching is effective because most programs access the same data or instructions over and over. By keeping as much of this information as possible in SRAM, the computer avoids accessing the slower DRAM.
Examples
Some memory cache is built in to the architecture of microprocessors. The Intel 80486 microprocessor, for example, contains an 8K memory cache, and the Pentium has 16K cache. Such internal caches are often called level 1 (L1) caches. Most moderns PCs also come with internal cache memory. And level 2 (L2) caches. These caches sit between the CPU and DRAM. Like L1 caches, L2 caches are composed of SRAM but they are much larger.
Principle
Disk caching works under the same principle as memory caching, but instead of using high-speed SRAM, a disk cache uses conventional main memory. The most recently accessed data from the disk as well as adjacent sectors is stored in a memory buffer. When a program needs to access data from the disk, it first checks the disk cache to see if the data there. Disk caching can drastically improve the performance of application, because accessing a byte of data in RAM can be thousands of times faster than accessing a byte on a hard disk.
When data is found on cache, it is called cache hit, and the effectiveness of a cache is judged by hit rate. Many cache system use a technique known as smart caching, in which the system can recognize certain types of frequently used data. The strategies for determining which information should be kept in the cache constitute some of the more interesting problems in computer science.
Types of cache memory
There are two types of cache memory – level 1 (L1) cache and level 2 (L2) cache.
The L1 cache is built inside the CPU package while the L2 is external to CPU and resided on the motherboard. Typical L2 cache memory sizes are – 64/128 KB in 386DX systems, 128/256 KB in 486 systems and 256/512 KB in Pentium systems. In sixth generation processor from pro onwards, both L1 and L2 cache have been integrated within the CPU packages to reduce access time and improve system performance further. The L2 cache on motherboard works at motherboard bus speed while the L1 cache inside the CPU clock speed. For example, in a Pentium II 450 MHz system the L2 cache works at 225 MHz more over in Pentium III we find in-die 256 KB of L2 cache that works at the same clock speed of the CPU, which means minimum possible wait time and maximum system performance.
The internal L1 cache has been a feature from 486 onwards. 486 processors have a combined L1 8 KB instruction and data cache, while classic Pentium processors have16 KB of L1 cache and Dcache, each of capacity 32 KB. Since theL1 cache is on-die, it is on die, it operates at the same clock speed of the CPU.