eli5 how does RAM work?

228 views

So as far as I understand Random Access Memory lets us access any stored in it data regardless where it’s stored and with the same speed.

I just don’t understand what makes that physically possible. Data is being transfered through electrons at approximately the speed of light through the wires. But how do you connect the wires to access all of the data everywhere in RAM at the same time?
Is the data being broken down into bits over all the RAM units – making the data collection process longer as you have to gather all the data particles or is there something I’m missing.

If I got any of my facts wrong feel free to correct me.

In: 7

7 Answers

Anonymous 0 Comments

Lets step back to olden times when they called RAM “core” memory, back in the 60s. Back then each “bit” of memory was a literal iron ring. If you recall from high school science, if you wrap a wire around a piece of metal you can induce a magnetic charge in it. If you make that piece of metal a ring, the magnetic charge will persist in it. So each bit would have a wire to charge it (make it a 1), another to discharge it (make it a 0) and a wire to read whether its a 1 or a 0.

Now, each bit of RAM is the same type of thing, but instead of a physical iron core, its a collection of logic gates made out of transistors. THe problem with transistor circuits is that they’re essentially analog (at this level anyway). And you need a constant supply of electricity to make them run: they work on the principal of using one small flow of electrons to enable or disable a much larger flow of elections (the ones that hold a 1 or 0 value). Some electrical components like capacitors can receive and hold a charge, but those are big and they don’t work fast enough for our purposes here.

So essentially every bit of RAM needs to be constantly refreshed or driven by a small trickle of electricity for its value to be maintained. Compared to the massive electron flows required to actually process instructions and data in a CPU or a GPU, this is relatively minor – thus portable computers have sleep mode; essentially the contents of RAM remain but everything else shuts off.

So now we come to how the memory is “read”. RAM is addressed in entire bytes (actually much larger than this, in multi-byte words etc. but whatever). TO read the bytes at the address you want you simply provide the address in question to your memory chip. THe electrons of the address you provide enable or disable a circuit connection that connects the source 3 or 5V DC from the power supply to the invidiual bit circuits; if that bit is a 1, the 3/5V of the power supply will flow through to the corresponding input/output line where you’re reading the value of that bit _from_. To read a different memory address, simply change the 1’s and 0’s of the address on your input lines, send a 1 to the “read” line of the memory chip and wait the required few nanoseconds for the circuits to be hooked up and the source VDC to flow through to the output lines where you read your value. Rinse and repeat.

CPUs, GPUs and other chips in your computer nowadays have super fast direct interfaces with the system memory this whole process happens amazingly fast, but essentially what they’re doing is reading this word of RAM – then the next, then the next, until a programming instruction causes the CPU to jump to a completely different address of memory. But all software programs are instructions for the CPU to be done sequentially until a comparison is made that causes the CPU to “jump” to a completely different address in memory.

You are viewing 1 out of 7 answers, click here to view all answers.