Friday, 15 January 2021

Computer Memory : Cache Memory and Its Significance

 

Cache Memory:

 

Use of main memory helps in minimising disk processor speed mismatch to a large extent because the rate of data fetching by a computer’s CPU from its main memory is about hundred times faster than that from a high-speed secondary storage like disc.

 

However, even with the use of main memory, memory processor speed mismatch becomes a bottleneck in the speed with which the CPU can process instructions because there is a 1 to 10 speed mismatch between the processor and memory. That is, the rate at which data can be fetched from memory is about 10 times slower than the rate at which CPU can process data.

 

Obviously, the overall performance of a processor can be improved greatly by minimising the memory processor speed mismatch. Cache memory is commonly used for this purpose.

 

It is an extremely fast, small memory between CPU and main memory whose access time is closer to the processing speed of CPU. It acts as a high speed buffer between CPU and main memory and is used to temporarily store very active data and instructions during processing.

 

Since cache memory is faster than main memory, processing speed is improved by making the data and instructions needed for current processing available in the cache.

 

Cache memory is placed in between the CPU and the RAM. Cache memory is a fast memory, faster than the RAM. When the CPU needs an instruction or data during processing, it first looks in the cache. If the information is present in the cache, it is called a cache hit, and the data or instruction is retrieved from the cache. If the information is not present in cache, then it is called a cache miss and the information is then retrieved from RAM.

 

The content of cache is decided by the cache controller (a circuit on the motherboard). The most recently accessed information or instructions help the controller to guess the RAM locations that may be accessed next.

 

To get good system performance, the number of hits must far outnumber the misses. The two main factors that affect the performance of cache are its size and level (L1, L2 and L3).


Cache illustration


Cache memory is built into the processor, and may also be located next to it on a separate chip between the CPU and RAM. Cache built into the CPU is faster than separate cache, running at the speed of the microprocessor itself.

 

However, separate cache is roughly twice as fast as RAM. The CPU has a built-in Level 1 (L1) cache and Level2 (L2) cache, as shown in above fig. In addition to the built-in L1 and L2 cache, some CPUs have a separate cache chip on the motherboard. This cache on the motherboard is called Level 3 (L3) cache.

 

Nowadays, high-end processor comes with built-in L3 cache, like in Intel core i7. The L1, L2 and L3 cache store the most recently run instructions, the next ones and the possible ones, respectively. Typically, CPUs have cache size varying from 256KB (L1), 6 MB (L2), to 12MB (L3) cache.

 

Cache memory is very expensive, so it is smaller in size. Generally, computers have cache memory of sizes 256 KB to 2 MB.

 

Cache memory


 


No comments:

Post a Comment