Registers and RAM

Peter Christian Erastus
3 min readSep 17, 2023

Registers and RAM

Computers stores information using random access memory or RAM. RAM needs electricity to run and store information, while other types of memory called “persistent memory” can store information when there’s no power. How can computer store information?

Logic circuit only flows in one direction. But we can also create a circuit which loop back on themselves taking their output as inputs. The core of what a memory is a circuit that remember and store it’s inputs. For example, the “and-or latch” combines an OR , an AND, and a NOT gate to create a circuit that can store a single bit of information. It is called a latch because it “latches” onto a particular value and stays that way. The action of putting data into memory is called “writing” and the action of getting data from memory is called “reading”. A more advanced memory circuit is called a “gated latch” it has a switch or a “gate” called the “write enable” which needs to be activated to allow the writing of data in memory, storing it.

  • Storing data inside a Gated Latch
  • Data is stored

Of course, one bit of information is not very useful, but we’re not limited to just one latch. We can put them side by side. If we put 8 latches together we can store 8 bit of information. A group of latches operating together like this is called a Register it holds a single number, and the number of bits in a register is called it’s width. Computer today uses register which are 64 bits long. To write into them we first need to enable all of the latches. We then use the data wires to send in the information, then deactivate the write enable wire, storing the information.

Having all separate wires for each latch is wasteful, we can perform the exact same function of writing and reading memory more efficiently using a matrix of latches. If we activate one row and one column of the matrix only one latch will be activated at a time, saving the amount of wires needed. Using matrix also gave our individual latches an “Address”, since only one latch will be activated at any given time. For example a latch we just activated have the address of “row 12 and column 8” which can be represented in a 4-bit binary system, 12 which is “1100” and 8 which is “1000” combining them we get “11001000” which is the address. To handle addresses we need something called a “multiplexer” which convert our 4-bit address into the corresponding rows and columns of registers in our memory.

  • A 256-bit Memory

To store even more data we can scale up by putting a lot of memory in a row similar to the registers inside the memory.

  • A Row of 8 memory units

With this we can store 256 bytes of data on 256 different addresses. An important property of this type of memory is that we can access any memory location at any time and in a random order, hence the name “Random Access Memory” RAM.

Source : https://www.youtube.com/watch?v=fpnE6UAfbtU

Simak tulisan lain, mengenai dasar-dasar komputer di link berikut:

Logika Boolean & Gerbang Logika: https://blog.its.ac.id/5026231014/2023/09/17/boolean-logic-logic-gates-crash-course-computer-science/

Mewakili Angka dan Huruf dengan Biner: https://blog.its.ac.id/5026231138/2023/09/17/representing-numbers-and-letters-with-binary/

Register dan RAM: https://blog.its.ac.id/5026231150/2023/09/17/registers-and-ram-crash-course-computer-science/

--

--