Home  »  ArticlesProgrammingTechnology   »   Easy Understanding of the CPU Cache

Easy Understanding of the CPU Cache

If you have ever bought a CPU… Okay, let me make things simpler. If you have ever read the specifications of a CPU you’ll notice a feature item called CPU Cache. You will find it has a Cache figure like L1 (or Level 1), L2, L3 with values like 23 KB, 64 KB, 8 MB, 16 MB and the like depending on the type and error when the CPU was manufactured.

When you drill down to the metal, computers basically work by manipulating data in memory. This involves reading and writing data into memory and working on it in various ways in the process.

There are several types of memory in a computer which fall into three ranges. These include storage. In general terms you don’t want to refer to this as memory, reasons will be seen later. Storage is made up of Hard Disk Drives (HDD), Solid State Drives (SSD) and Optical Drives such as CDs, DVDs, and Blueray disks. Then there’s flash storage such as USB drives, SD memory and more. There is cloud storage and the list could go on and on.

Then there is RAM or Random Access Memory. This is the memory that the computer uses to store data for running processes and applications. For now, the details are beyond the scope of this article.

Finally, we will mention the CPU cache this is similar to RAM in functionality but unlike RAM this memory is built into the CPU. Depending on the CPU model you can have several levels of Cache mostly between one and three.

Why CPU Cache is Important

RAM is designed to speed up the response of computers in their normal operations. Moving data in and out of RAM is far much faster than it is which mass storage media such as Hard Disks and other media. Without this, your CPU would be wasting valuable time and resources just waiting for data from storage.

Even though this sounds nice, there is still a catch. With CPUs being ever so fast, apparently, there are bottlenecks that make RAM to still be a magnitude slower than the CPU. These bottlenecks boil down to the journey the data has to take between the RAM through the motherboard to the CPU. This takes time. Albeit nanoseconds but it is still considered slow. The solution? CPU Cache.

By CPUs implementing their own cache, they can avoid the aforementioned bottlenecks. With complex algorithms that determine what runs of the different levels of cache, important bits of data can be processed in the cache. Because the cache is usually a small amount, large data-sets and structure can be worked off the RAM.

Basically, the majority of the computations for the operations of a computer can be handled off the CPU cache and that’s where the computer leverages on either of the levels of cache to squeeze out as much performance as possible.

Found this article interesting? Follow Brightwhiz on Facebook, Twitter, and YouTube to read and watch more content we post.

Available under:
Articles, Programming, Technology