Read/Write Memory

This is usually called RAM. Which is odd, because RAM is an acronym for Random Access Memory. Ok, not so odd when we think about the history. A lot of the early memory technologies (all of them?  I'm not sure... I'm not THAT old) were NOT random access. They were sequential access. You couldn't just read/write any word in memory. Instead you had to wait for it to "come around again" and read it or write it when it did. Whether that was in a delay tube, or on the surface of a rotating magnetic drum/tape/disk.  Even today with a hard disk you have to wait for the platter to spin around to where the data you want is located.  That's why 7200 rpm spinning hard drives are more responsive that 5400 rpm ones.

Interestingly Mask ROMs, EPROMs, etc. are all random access. You provide an address, and read the value stored there. In fact all semiconductor memory is random access.

So what does RAM really mean for us? It's memory that we can write as well as read. Flash starts to blur that differentiation, but flash is still relatively slow. RAM is fast. The drawback is that it isn't persistent. When the power goes away, so does the data. That's why a system will have some RAM for working storage (data being manipulated), and some ROM/flash for more permanent storage (the OS, firmware, or applications). In a larger system like a server, workstation, or laptop, there is often a disk of some sort. 

We looked at magnetic core in the history section of this guide. That was an early form of RAM. Data could be written and read "in place", i.e. without removing it from the system that was using it. Semiconductor RAM replaced core as the standard memory technology very quickly: is was smaller, cheaper, and production was automated rather than largely manual.

There are two types of RAM that we will consider: static and dynamic.

Static RAM

As implied by the name, static RAM just sits there remembering what you put in it until you remove the power. It uses a flip-flop to store each bit. That means that each memory cell (i.e. each bit) is fairly large, typically 4 or 6 transistors, so there doesn't tend to be too many on a chip. The big advantage is that nothing extra has to be done for them to hold their contents, which means simpler support circuitry, which means that static ram is easy to work with. If you only need a small amount of read-write storage, then it's much easier and overall efficient to use a bit of static RAM. Back in the day, I made heavy use of the 6116 2Kx8 static RAM chip. That chip stored 2K bytes. Those chips were in 26 pin, wide (.6in) dual-inline (DIP) packages.  Today, you can get the same chip in a narrow 24-pin DIP. Think about that, 2K of RAM in a chip that's almost as big as a through-hole ATmega328 (a 28 pin narrow DIP). The '328 contains 2K of ram in addition to the CPU, Flash, and all the IO, timers, etc. 

components_8K_Static_RAM.jpg
8K Static RAM board from Processor Technology, circa 1976. Retailed for $300 USD (equivalent to ~ $1300 USD today)

Dynamic RAM

Something dynamic is always changing, and dynamic RAM is no different. Where static RAM uses a flip-flop to store bits, dynamic RAM  uses 1 capacitor and 1 transistor for each bit. This is drastically smaller that a bit in static RAM, so dynamic RAM chips tend to have many more bits on them. This makes them cheaper and denser than static RAM (per bit). As computers became more powerful, with bigger address spaces, having more RAM was desirable. Since dynamic RAM was denser than static RAM, it became the standard memory technology for all computers larger than embedded 8-bit systems. For example, my current workstation has 16Gb sticks of dynamic RAM, each one the size of about 8 state of the art static RAM ICs which have a capacity of 2M each (so that's 16G of dynamic RAM in the same space as 16M of static RAM... that's 3 orders of magnitude difference in capacity).

The downside of dynamic RAM is the same thing that gives it it's major advantage: it uses just a capacitor and transistor to store each bit. Capacitors have the habit of discharging over time, and each dymanic RAM cell uses a very small one (meaning it holds very little charge, which dissipates quickly). In order to retain the data, it has to be refreshed frequently. Thankfully, entire sections of the data array* can be refreshed at the same time. Special, additional circuitry is required to do this, but there have been some clever designs to minimize that. The Apple ][ (all praise Woz the great) made use of it's video hardware to do RAM refresh for free, as a by-product of fetching data to be displayed**. The Z80 CPU (a contemporary of the Apple ]['s 6502) had built-in dynamic RAM refresh support that took care of much of the hardware needed.

RAM technology has advance a lot since them, but the concepts are more or less the same.

components_16K_Dynamic_RAM.jpg
16K dynamic RAM board from Processor Technology, circa 1977. Retailed for $529 USD (equivalent to ~ $2174 today)

Have a look at those two memory boards. The static RAM board is almost entirely RAM chips (the regular block of 4x16 identical chips) with a small amount of support circuitry.  Compare that with the dynamic RAM board: the top two rows are mostly RAM chips (except for the 5 in the middle). The other two rows are support circuitry.

For comparison, below is one stick containing 16G of dynamic RAM. It's smaller than 14cm x 4cm and costs about $825 USD for 4 of them on Amazon today.

* The bits in a dynamic RAM chip are typically arranged in a more or less square array. An entire row of the array can be refreshed at once. For example, the 4116 used in many 8-bit era computers contains 16K bits arranged in a 128x128 array.

** If you want a master class in digital design, study the Apple ][. "The Apple ][ Circuit Description" by Winston Gayler (published by Howard W. Sams & Co) is the go to walk through and analysis of the Apple ][ hardware.

This guide was first published on May 02, 2018. It was last updated on May 02, 2018. This page (Read/Write Memory) was last updated on Oct 23, 2019.