home : articles : What is RAM?

This article is a description of the different types of RAM for the average (non-technical) person. If the terms SRAM, DRAM and flash memory conjure an alphabet kaleidoscope then this article will help you make some sense of these terms.

Why Memory?

One of the most important fundamental features of any computing system is the ability to store data to memory, recall the data, and overwrite the data. By memory, we mean the ability to store things, recall them and change them if necessary, referring by analogy to our concept of human memory. For example, I may store your first name, recall it when I see you, and change it when you decide to change your name. This ability to store and manipulate memory is fundamental to computers. In fact, it is a fundamental tenet of computing that all you need to build a computer is memory and the ability to perform certain basic operations on the numbers stored in that memory.

What number format?

In the case of computers, all data are stored in the form of numbers. Whether it's the color of a pixel on the screen, the coordinates of a character in a game, or the amplitude of a sound wave that can be transformed to music. Everything is a number. In modern times, people calculate and record numbers using the base 10 numbering system, that is, we use the digits from 0 to 9 to create numbers. But, using ten digits is not strictly necessary. Imagine aliens that have only 6 fingers instead of 10 like us. They might use only the digits from 0 to 5. Although they refer to the number 10 as ten, it is actually equal in value to our number 6. The alien numbering system use base 6. So the number 10 in the base 6 system (denoted 106) is equal to 6 in our base 10 system (610) [1].

In computing, we use the simple numbering system of base 2, which consists of only the digits 0 and 1. What could be simpler? So 10 in base 2 (102) is equal to 2 in base 10 (210), and 112 = 310, 1002 = 410, etc. We can create arbitrarily large numbers in base 2 just as in base 10. For example, 101100102 is equal to 17810. If changing base seems confusing, the only result you need remember is that we can encode numbers using only the digits 0 and 1.

The reason we use binary numbers in computing is that electrical circuits that operate on binary numbers are easy to build and they are very robust. The electrical circuits are simple because we can represent the digit 0 with 0 Volts and represent the number 1 with the maximum voltage, say 5 Volts. If it was possible to simply look at the memory in a chip and see the voltages, we would be easily able to read off the binary numbers. Instead of seeing the voltages with our eyes, we read the stored voltages using other electrical circuits. Binary numbers are robust because even if there is some noise, design error, or failure in our circuit, it is still very likely that we can read the correct number. Imagine that due to a manufacturing fault, a 1 showed up as 4.5 Volts rather than 5 Volts. It's quite easy to see that this voltage represents a 1.

Static vs. Dynamic

There are two basic ways of storing a one or a zero. You can store a binary digit statically or dynamically. What circuit designers mean by static is that as long as power is applied, the data are retained by the memory. In contrast, data stored dynamically slowly drains away over time, and so must be periodically refreshed. Imagine a bathtub as a way to store a one or a zero. A full bathtub represents a one and an empty bathtub represents a zero. A bathtub that has no leaks is a static bathtub. A bathtub that slowly leaks and requires you to periodically check it and top it up in the case of a full bathtub (storing a one), would be a dynamic bathtub.

Static memory, in addition to the advantage of not requiring refresh, is very fast. This speed comes with the price of higher chip area per bit. In semiconductors, the price of a chip depends on its area and so higher area results in a higher cost. The main type of static memory used today is called static random-access memory (SRAM) [2]. SRAM is primarily embedded in chips and processors, where we can take advantage of its high speed. In computer processors, SRAM is used to implement cache memory; a fast local copy of memory like a photocopy of a few pages of a reference book from the library.

The main memory in processors (the reference book in the library) is implemented using dynamic random-access memory (DRAM), which, of course, is dynamic. When someone asks how much memory your computer has, they are asking how much DRAM is in the system. DRAM is much cheaper than SRAM but is not as fast, which is why computer designers add a small amount of faster (and more expensive) SRAM cache memory to speed up the overall operation.

Random-access memory (RAM) is a generic term that refers to both SRAM and DRAM or, indeed, any type of memory where you can arbitrarily (randomly) access stored data. This random access is in contrast to serial-access memory where you must retrieve stored data in order. Imagine having to recall your whole life from birth just to remember what you had for lunch yesterday. Because of its limitations, serial access memory is used only in very specialized applications.

Nonvolatile Memory

Volatility refers to whether a memory holds its data once the power is turned off. Nonvolatile memory can hold its data when the power turns off, whereas volatile memory loses its data. It turns out that all nonvolatile data is also static, since if it holds its data while the power is off, it certainly maintains its data while the power is on. Ideally, all memory would be nonvolatile, but today's nonvolatile memory has a higher cost than volatile DRAM and SRAM, so we use it only in applications where the nonvolatility gives a large benefit. One famous example is the iPod Nano, which uses flash memory [3], the most popular type of nonvolatile memory, to store and playback music.

Nonvolatile memory stores data by modifying the structure of matter such that some electrical property is changed. The matter's structure is retained after removing power, so the data remains almost indefinitely. On the other hand, volatile memory stores data by temporarily accumulating electrons in a location. Since holding electrons in place requires energy, the electrons discharge after removing power, destroying the data.

Perhaps the simplest mechanism for nonvolatile memory is the one used in phase-change RAM (PRAM). A bit of material is melted by a large current and cooled by removing the current, forming a crystal. The rate of cooling, controlled by the rate of removal of the current, determines whether the material forms into one of two different crystalline structures. The two crystalline structures have different conductivities, which electrically distinguishes the two states. We associate a binary 0 with one structure and a binary 1 with the other structure.

What you need to know

This article provides the basics of memory in today's computing chips. To summarize:

  1. RAM is a generic term refering to any type of random-access memory.
  2. A computer's main memory is DRAM which is dynamic. DRAM has low area and is therefore cheap.
  3. Inside the central processing unit (CPU), the cache memory is made of SRAM which is faster and has higher area (and is more expensive) than DRAM.
  4. Devices that hold data after the power is removed like iPods and USB keys have nonvolatile memory (usually flash memory). This memory is the most expensive of all.

Notes

[1] When using a base other than base 10, we usually read to the number 10 as “one-zero” to avoid confusion.

[2] Random-access refers to the ability to access any data location in any order. Some simpler type of memories offer only sequential access, so that you have to access the data locations in a fixed order.

[3] Flash memory is so dominant in the nonvolatile memory landscape that it's often used as a synonym for nonvolatile memory. Other types of nonvolatile memory include ferroelectric memory (FeRAM), magnetoresistive RAM (MRAM), and phase-change RAM (PRAM).

(This article first posted June 2006.)


Other articles by | Article RSS Feed