Author Options:

How does a computer "write" something... to memory, a registry, etc...? Answered

I know that every computer has a CPU.

I know that every CPU has it's own Instruction Set, or... set of things that it can do:

  • Compare
  • Add
  • Jump to
  • In
  • Out
  • etc...

I even know a fair amount about how a CPU interacts with RAM along the Data Bus and the Address Bus with Set wires etc, and how a CPU's ALU (Arithmetic Logic Unit) stores data temporarily in "registries" and uses "flags" to send things back to the Control Unit if the CPU.

So, I know a fair amount about "How a computer works." But... it is all theoretical. I have memorized words and ideas like "ALU" and "Registry" and even RAM. But there is one thing that I do not understand and cannot seem to find anywhere on the internet.

The verbs "write" and "store"...???

I know that a record cutter uses electrical current spread across metal plates with magnets that push a scoring tool into a soft "scratchable" medium to cut a long groove to make a record. Then a phonograph has a needle that that is likewise suspended between electrical currents with magnets that telegraph the grooves up a wire to replicate the sound through a horn (later a speaker).

But as far as I know... RAM or a CPU's registries can have binary "words" somehow written to them for storage. I know it is happening at 3-4 billion times per second, but even if you slow it down to one time per minute... how does a CPU "write" 00110100 to RAM? There are no magnets in RAM like on a hard drive. RAM has no physical material that can be changed to represent a zero or a one... like... wax, or vinyl, or magnets. I don't even know who I can ask this to... so I'm asking here.



Best Answer 1 year ago

Its stored in one of two ways. In a static RAM its stored by essentially setting a switch on or off, In DYNAMIC RAM, the kind inside your computer, its stored by filling up little capacitors. Of course, the capacitors leak, and you have to refresh the memory to keep the contents, which is done very rapidly by hardware in the computer.


Answer 1 year ago

"...by filling up capacitors." That's IT!!! You literally saved the day @steveastrouk. The first thing you said, about static RAM, and setting "switches," did not do it for me, because I think of a switch as a physical thing with a hinge that swings a piece of conductive material until it physically touches the other piece of conductive material, until a circuit is closed and electrons can flow through and across the conductive materials around the circuit. But neither the CPU nor RAM, at least not in my mind, have actual little microscopic hinged switches flipping and flopping from "connected" (on), to "not-connected," (off).

I CAN, however, see how an electrical current can flow to a series of capacitors and charge, let' say... every other one, to create 010101010101... that does not require any moving parts, and when that cell of memory is called upon, the CPU can see that it's capacitors are charged in a pattern of 010101010... and that translates into "flower," or whatever.

Do you mind, @steveastrouk, could you tell me where you learned this, or where I might be able to read more about how modern silicon CPUs or even basic transistors physically work? The problem is, kind of like with Iceng's answer, people seem to assume, when I ask how a CPU physically "works" that I want to jump right in to talking about bits, cells, memory addresses, reading, writing, loading, and storing... I am talking about... the most basic basic "how it works" as in...

X milli-amps of electricity enter the CPU on pin # 12 from the Y-wire, and that feeds the CPUs "clock." The clock is a (something) that "switches on and off" at a perfectly steady rate of 3,000,000,000 per second, and it "switches" on and of by the physical process of ... (what?)

As you can see... I still am not sure what the physical process is when people refer to the term of a switch "turning on and off". There is no physical "switch" or even one single moving part in a CPU... is there?


Answer 1 year ago

A transistor IS a switch. A write to a static memory is just turning on the switch, the switch turns on a little light bulb. The READ from a static memory is looking at the light bulb to see if its on or off.


1 year ago

The cpu loads an address to a register that controls 16 bits or lines which can select memory cells 00,000 to cell 65,535 say memory cell 7169 =bin 0001-1100-0000-0001 = hex 1C01

Then the the cpu uses another register to read = load 8 bits of data or write = store 8 bits of data from / to say memory cell 7169...

Say that memory cell contained a value of 4 then the cpu would read a 4 at cell 1C01.

Then the cpu might decrement the 4 to a 3 and write it back to the same memory.

Now the memory cell 1C01 would hold the value of 3 until changed..