If you want to learn what is RAM memory and how Ram memory works. Pay attention to these keys that we give you in this article so that this essential component of a PC has no secrets for you.
What is RAM memory? How It Works?
RAM (Random Access Memory) is used to store data when a computer is on, unlike a hard drive, which can hold data while it’s off.
Also, RAM allows fast access to data for reading and writing, so the computer loads data from it instead of directly from a hard drive.
Random access memory (RAM) is a type of data storage used by computers, usually located on the motherboard.
See Also:
Random access is a form of computer storage that can be read and written, that is, accessed. Typically used for storage of job data and machine code.
And, this hardware component, which is used to temporarily store the processes or programs that are executed on a computer, such as a video game, an application, etc.
Random access memory, or RAM, must contain both the operating system (or at least basic resource management software) and programs. In this way, they will be accessible by the CPU.
And, despite being a smaller memory in capacity, it is faster, since it is SDRAM type. This brings great benefits in terms of performance.
If you have too many programs open, your computer exchanges data between RAM and the hard drive (virtual memory).
When you open a program or turn on the computer, data is temporarily moved from the hard drive to RAM, which holds it to allow the CPU (or central processor) to handle it.
But only if the RAM is being fed with power, but if the computer is turned off everything will be erased, it is not like that in the hard disk, that’s why both are necessary.
Every time your computer needs to run an application or program, RAM is used to finish the task. When a computer boots up, parts of the operating system and drivers are loaded into memory, as well as essential routines for creating file space, booting the OS itself, etc.
This allows the CPU to handle instructions more quickly and efficiently and speeds up the boot process.
In other words, computer systems use RAM as a buffer, which helps access critical data with lower access latency than if it had to be fetched from secondary memory.
Access to RAM memory should be really fast compared to conventional hard drives, and somewhat faster in the case of newer SSDs.
Access times within RAM are independent of addresses, that is, each storage location within memory is as easy to reach as the others, and takes the same amount of time.
On the other hand, it is important that the I/O system, or input and output, can also be understood as a memory.
In the input system, data coming from the input devices or peripherals will be read. Data will be written to the output system so that it can be interpreted by peripherals or output devices.
See Also: RAM Memory Problems | How to Identify and Fix them
For example, the CPU will see a keyboard and monitor as memory. On the monitor it “writes” information to display it on the screen, and on the keyboard it “reads” the keystrokes to interpret what the user is indicating.
RAM Operation
Imagine that you have to prepare a recipe, since you are the chef of a restaurant, and that we are going to make this analogy:
- Sponge cake recipe will be the program to run
- You are going to be the CPU
- The ingredients will be the data
- Cookware will be the instructions
- The pantry/kitchen cabinets will be the RAM
- The supermarket will be the hard drive
- And the countertop will be the cache
- The I/O system, or entry and exit, will be made up of the waiters, who will be the ones who take the orders to the kitchen or those who take the finished dishes to the diner.
In order to make the recipe you will need the ingredients and the utensils. And what you will start to do is go to the supermarket to buy everything you need (tongue, bowl, whisk…) and you will also go to the pantry to bring the ingredients (egg, milk, flour…).
Of course, during this process you will not be able to do anything more than that, and it involves a significant loss of time.
On the other hand, if you have all the utensils and ingredients close by, in the pantry and on your kitchen cabinets, then you will not have to go so far, and you will be able to access them quickly.
Also, if you are going to use the ingredients or utensils more than once, you can leave them next to you, on the counter, which would give you even quicker access.
See Also: How to change RAM memory on PC
Unfortunately, neither your furniture, nor pantry, nor worktop is infinite enough to store everything for all recipes, so the supermarket will always be essential, but you should try to go as few times as possible to speed up the recipe. This is how modern computers work.
Before this architecture, computers had to go to the hard disk to access the program data, that is, to secondary memory.
This meant a fairly significant time penalty, given the high access latency in these devices, even more so before the invention of SSDs.
It’s like having to go to the supermarket for each ingredient or each utensil, which would make the recipe almost eternal.
Increasing the capacity of your counter can make things go faster, but it could also make it harder to access ingredients and utensils.
Imagine a larger countertop, with more objects on its surface. It would be more difficult to find them, right?
For that reason, CPU designers don’t just add more and more cache, since that could also affect performance.
However, you must imagine something else to fully understand how RAM works. And it is that, you cannot always have everything at hand in the kitchen furniture or on the countertop.
In addition, when you make a different recipe, you will need to take other different objects that you will also have to have on hand.
And, you should also put yourself in the case that every time the kitchen is turned off, the furniture and countertop will be emptied as if by magic.
Instead, everything will remain in the supermarket where you can go for the next recipe. This is the volatility of the cache and RAM in a computer, and the permanence of data in secondary memory.
The role of the CPU and the Operating System
On the other hand, and continuing with the previous analogy, we must highlight the role of the CPU and the operating system in everything related to the operation of RAM memory.
During the preparation of the recipe, you will be taking the utensils and the ingredients you need.
With the utensils you apply some process to the ingredients (cut, peel, beat, mix, heat…) according to the steps of the recipe.
On the other hand, more advanced cooks may do several things at once, instead of following the recipe step by step. And they may even alter the recipe steps to suit you. However, the result of the recipe should be the same. This is how a modern CPU works with speculation, parallelism, and other techniques to increase performance.
For example, imagine you are heating milk. Meanwhile, instead of standing still, you can beat the eggs. Thus, once the milk is hot, you can have the eggs ready for the next step.
If you did it sequentially, you would follow the preparation of the recipe step by step and until you finish one task you do not move on to the other.
See Also: What is STT RAM Memory
Of course, both in one way of proceeding and in the other, the result must be the same, a cake.
For this reason, the entire memory system must be dynamic, and be able to supply what is needed at all times, even if an order established in the recipe is not followed.
Regarding multi-threaded technologies, such as SMT, another analogy could also be made. Imagine that:
- Each step of the recipe is a thread or thread
- The entire recipe is a process
As each recipe is made up of several steps, until all the steps are executed, the recipe will not be completed. As I said, the steps can be altered as needed.
For example, imagine that step 3 depends on step 2, but step 4 does not depend on anything. Also, step 2 can be done while you do something else, so you could do step 4 first while step 2.
If we introduce the work of the operating system into all, we can also highlight that its kernel will be in charge of the dynamism.
Through a planner it will fill or replace the necessary ingredients and utensils in the cupboards so that they are more at hand and according to the recipe that is being made at any given time.
Adding the possibility that you can prepare several recipes at the same time, then the operating system will be like an orchestra conductor telling you which recipe is needed with the highest priority.
For example, a priority process could be the first course, while the cake, which is for dessert, could be postponed.
In addition, on the other hand, it is likely that some diner (user) does not want a dish, and the director of everything will have to cancel said recipe process.
Now with these left resources for the cook he can insert another recipe in the gap left by the canceled one.
Well, this is how a system works around RAM memory, explained in culinary terms so that it can be well understood.
I hope you liked this analogy and that after reading this you can have a clearer idea of how a computer works.
Zahid Khan Jadoon is an Interior Decorator, Designer and a specialized Chef and loves to write about home appliances and food. Right now he is running his interior designing business along with a managing a restaurant. Also in his spare time he loves to write about home and kitchen appliances.