What is the RAM's job with the CPU?

bnday23

Commendable
Apr 11, 2016
1
0
1,510
I know the RAM is the computer's temporary storage but I am trying to figure out what exactly it has to do with the processor?
 
Solution
The processor processes data and instructions. The ram holds those instructions and is capable of feeding info to the processor more rapidly than storage whether it's a hard drive or ssd. Basically like a buffer. A cpu processes data so rapidly that it would take ages to read that info from the hard drive in real time. Data moves from the storage drive to ram and frequently used info stays in ram so the cpu doesn't have to wait for the storage drive to find it all over again.

Imagine cooking, the hard drive is like when you begin and go to your recipe box, take out a recipe you want to cook, go to the cabinets to get the cookware and measuring cups and things. If each time you went to do the next step of the recipe you had to go back...
The processor processes data and instructions. The ram holds those instructions and is capable of feeding info to the processor more rapidly than storage whether it's a hard drive or ssd. Basically like a buffer. A cpu processes data so rapidly that it would take ages to read that info from the hard drive in real time. Data moves from the storage drive to ram and frequently used info stays in ram so the cpu doesn't have to wait for the storage drive to find it all over again.

Imagine cooking, the hard drive is like when you begin and go to your recipe box, take out a recipe you want to cook, go to the cabinets to get the cookware and measuring cups and things. If each time you went to do the next step of the recipe you had to go back to the recipe box and get the recipe, go back to the cupboards to get the same measuring cup you just used it would take you a long time. Much longer than having the recipe on the counter where all you had to do was glance over at it. Or a measuring cup right next to your mixing bowl ready to go.

Ram works much the same way. Even if you change recipes you're likely to use some of the same items over again in the next recipe. The same applies to applications. Even ram is a bottleneck despite being much faster than file storage which is why for immediate code storage the cpu uses various cache (L1, L2, L3 etc) which holds the data to be processed right next to the cpu ready to go.

Computers would be much slower if there were no cache on the cpu die and the cpu had to rely solely on ram to keep the processing cores fed with data. As fast as ssd's are, ram is 5-6x faster reading/writing data than an ssd.
 
Solution
RAM is an acronym for Random Access Memory. What this means is that the CPU can read any memory location just by loading its address. Indeed this is how the computer boots itself. It reads a hard coded memory location that is occupied by the Basic Input and Output System (BIOS) which directs it how it should proceed in a step by step process to load everything needed to run the computer. Even though the Bios is usually called ROM (Read Only Memory), it is also a form of RAM. It's just that it keeps all of its values when the power is shut off. The CPU can not operate on any data that is not in its registers. The RAM needs to contain both the program being run and the data being manipulated. All of these instructions and all this data needs to be kept as close to the CPU as possible in the most efficient order that can be managed. RAM is called memory as opposed to storage for historic and common sense linguistic reasons. When the power is turned off to memory, the contents are lost.

This is in sharp contrast to storage. Programs and data in storage do not change when the computer is powered down. Historically speaking, the types of devices used to store programs and data were not directly addressable by the CPU. In particular one could not got to one and only one address in the storage. Instead one was forced to move entire blocks of data into memory before it could be randomly accessed. The size of the blocks have varied over time and from manufacturer to manufacturer.

In our modern (we hope) times there are multiple tiers of memory that get faster the closer one gets to the registers. There are multiple tiers of storage that get slower the further they get from the CPU. synphul has already mentioned at least 4 tiers of memory in his answer. I hope this helps you.
 

TRENDING THREADS