Cache Memory:
We know that CPUs are faster than memories. Day by day engineers are doing a lot of hardworking to make the chip smallest. They inputting more and more circuits on a single chip and thus they make a CPU so faster. As well as memory designers are also using various of technology to increase the memory capacity but they are not able to make its speed. Actually, the problem is not technology. The engineers are trying to build a memory which will as fast as CPU. But here a problem comes. If we want a high-speed memory then we have to locate it on the CPU and this is not an impossible task. But to locate it on CPU the total size will highly increase. To solve this kind of problem engineers are combining a small amount of fast memory with a large amount of slow memory. And we want huge facilities at a reliable price. And here the concept of cache memory comes. Basically, there are three types of memory is our computer. These are Hard drive, RAM and cache memory.
Cache comes from the French word cacher which means to hide. We can say that cache memory is a storage memory which can store top uses computer programs with a higher speed. It is a volatile memory. It is the fastest memory portion in a computer. But its storing capacity is very low respect to others memory. There are three types of cache memory:
1. Level 1(L1) cache or Primary cache.
2. Level 2(L2) or Secondary cache.
3. Level 3(L3) or Main Memory.
1. Level 1 or Primary Cache:
L1 is the fastest cache memory which stays inside the processor. But it is very small than other cache memory. The storing capacity of L1 cache is between 2KB to 64 KB.
2. Level 2 or Secondary Cache:
L2 cache can stay inside the processers or others IC chips in processor. But where they stay is not a great matter because these chips are connected by a bus and it is quite fast to process. The storing capacity is between 256KB to 512KB.
3. Level 3 or Main Memory:
L3 cache is the separate memory which speed is much more than a RAM. And its storing capacity is between 1MB to 8 MB.
Basically, cache memory stores our daily important data command. When we give a command to the processor then it gets so many commands and to read or write any data. Here cache memory takes a major role. It stores our frequently used data which we need almost every time to operate the computer. Now when we give a command to computer then it will not go to RAM. First, it will check the cache memory and will take the instruction to process. Otherwise, it will go to RAM to pick up the instruction. So thus cache memory helps the processor to work fast. But sometimes when we give a command to the computer and it fails to find the instruction on the cache memory then again it goes to RAM to find that instruction. In that time the processor does delay which is known as cache latency. Thus cache memory works.