Whether you want to have a better understanding of how a CPU works, or you want to know why your game lost all data during a power outage, your main focus should be the CPU’s computation storage.
So, where does CPU store its computations? It primarily uses registers to store computations, but there are other components as well, which require detailed analysis.
Okay, don’t fret. We know all the computer shenanigans are hard to understand, but there’s no rule stating that it can’t be easy and fun. Join us as we break down where the CPU stores its computations in an easy way.
What’s a CPU?
Would it be wise to know where a CPU stores its data without knowing what a CPU is? That’d be like playing football without knowing the rules.
A CPU, AKA central processing unit, is the computer’s brain. Just like humans, computers also have a brain that controls everything. From accessing data to storing and executing, a CPU either directly performs it or commands other functions to do it or maybe a combination of both.
Do you see that big fan in the middle of your computer motherboard? Yes, that’s where the CPU is. It’s mainly built with silicone and has billions of micro transistors and many pins.
Fun fact: CPU manufacturers have now come up with architectures as small as 5 nanometers. That enables them to use more transistors and allows them to store data faster. So, now that we know what a CPU is and what it looks like, we can get down to the real business.
Why does the CPU Need to Store Data or Computations?
The CPU stores its computations on either its internal registers, cache, or the main memory. Storing is necessary to access or execute data faster.
If the CPU didn’t store computations in this way, it’d have to fetch data from the HDD every time, and HDDs are incredibly slow, though SSDs are a good bit faster. Without these registers or other forms of fast memory, you’d surely throw your PC out of the window.
Where does the CPU Store Its Computations?
All the active data you have on your computer are stored in the RAM, registers, and cache. CPU uses these three to store computations.
But why use three? Why not use only one? Wouldn’t that be much faster? Glad you asked that question. We’ll be answering all these questions below.
We’re starting with CPU registers because these things are the fastest in terms of storing data or computations.
Since they’re blazing fast, they also require a complex manufacturing process, which increases the cost to produce them. Not only that, but CPU data registers are significantly smaller than the other forms of storage in computers.
We think you can connect the dots now. Yes, the CPU relies on CPU registers to store data or computations. Since registers are the fastest, your CPU can quickly finish its task.
To be more specific, your processor is so fast that it can complete a computation at the speed of more than one operation per clock cycle. It’s way better than using CPU cache or RAM. It’s worth noting that in some contexts, registers and the cache are treated as a single component.
Now, do you remember how your saved game got lost when you switched on the PC after the power outage?
That’s because a CPU register isn’t a non-volatile memory or storage. This means that your processor will only store temporary data or computations while the computer is powered on. The moment your PC shuts down, those computations will be lost. You could also call it temporary memory.
If it wasn’t already bewildering, there’re multiple registers embedded on the CPU chip. Each of them is unique and performs different tasks at the command of the central unit.
Index registers, memory address registers, memory buffer register(s), and data registers are some common ones. Some of them are read-only, and some of them are write-only.
Here’s a quick look at a few types of registers:
Memory Address Register
As the name says, a memory address register keeps track of your memory addresses.
Memory Data Register
This one also does what its name implies. It uses the address register to find the location of your data and then temporarily store other data for CPU operations.
An accumulator collects the results of the CPU computations.
There’re other internal registers, but these three are the most used ones. Some registers complete arithmetic tasks and other complex piece calculations.
After your CPU is done with the registers, it stores its computations in the CPU cache. This is because the processor cache is the second-fastest memory on your computer.
The main similarity between the data cache and registers is that they’re located on the CPU chip, and are smaller than the system ram.
If you ever went CPU shopping, you’ve surely seen those fancy ads about big cache capacities. CPU manufacturers talk about CPU cache stats all the time.
You can divide this cache into three parts labeled as “levels.” So, basically, the three parts are level 1, level 2, and level 3, commonly referred to as L1, L2, and L3.
Level 1 is the fastest data cache, but the smallest. Level 2 is a bit bigger than level 1, but is also slower. Makes sense, right?
Give me some examples
For example, the latest Core i7 12700K has an L1 cache of 80K, an L2 cache of 1.25MB, and an L3 cache of 25MB. Unlike older designs, modern CPUs have big caches, making them incredibly fast.
Like registers, the CPU cache tells the main memory to send computations and then executes them. The cache is still slower than registers, though.
Keen to learn more about CPU cache? Watch this video:
RAM, or random access memory, is the computer’s primary system memory and temporary storage. It’s temporary memory because it loses its data once you turn off the PC. You saw those stick-like modules on the right side of your motherboard, right? Yes, those are RAM.
Unlike cache or registers, you can add, remove or extend it. Feel like increasing the speed of your computer? Just get more RAM. Maybe upgrade from 8GB to 16 or 32GB. Of course, more RAM doesn’t always mean that you’ll have a faster computer. It depends on the tasks.
All your data is first stored on the HDD. Once you open an application, it’s then loaded into the ram. Once the data is loaded, now your CPU can access this data or do whatever you command it to do. Usually, it accesses those data in order, but those data can also be randomly accessed, hence the name “random access memory.”
As previously pointed out, the system memory isn’t as fast as registers or the cache. Ergo there’s a bit of delay. This delay is called “memory latency”. Of course, you won’t often notice this delay, but it’s there.
Have you ever wondered why your computer becomes slow once you open too many applications? If your memory is too low, it might not be able to run all the computations. Think of it as limited counter space to work on a physical project.
For example, you can’t easily run multiple chrome tabs and photoshop simultaneously on 2GB ram. This is when installing more ram can boost the speed and multitasking capacity of your PC.
But wait! Yes, there’s always a “but.” The speed of the RAM/memory depends on two things: latency and MHz, or clock speed. Unfortunately, blindly adding more ram might not give you the expected boost of speed.
If you look up your RAM/memory model on the internet, you’ll notice that there’re a few technical things written on the back.
The first and the most advertised one is the speed. This speed is measured in MHz (Megahertz), though is creeping into the Gigahertz range lately. Nowadays, you’ll find RAMs as fast as 4800 GHz. The greater the MHz, the faster it can finish its computations.
The second thing you’ll have to keep in mind is the latency. This one is written in formats like 16-18-18-36. Just to make it simple, always go for the lowest numbers because that will give you the lowest delay.
For example, a 14-14-14-34 will have lower latency than 16-18-18-26. Of course, lower-latency RAMs can break your bank.
Now let’s talk about DDR or double data rate. As the name suggests, DDR sends double data compared to non-DDR memories. For example, DDR4 memory will send more data than DRR3 memory. So, you can just swap your DDR3 for DDR4, right?
For starters, each of the DDR memories has different bottom notches. This means you can’t physically fit a DDR3 on a DDR4 motherboard slot. Even if you somehow could fit it, your CPU won’t support it because each CPU architecture has a specifically supported set of RAM types.
Like we said, the answer to “where does CPU store its computations” isn’t that difficult to understand.
While you can’t really save your computations when the power goes out without intrusive 3rd party software, what you can do is show off your newly-gained knowledge about your CPU and how it stores computations.
However, to sum it all up, computers use three different things for storing data or computations. The register sits on top of the computation storage pyramid while the ram sits at the bottom. That’s not really a bad thing because every component serves its purpose.