How Random Access Memory (RAM) Works
Random access memory (RAM) is the best known form of
computer memory. But the way it works and what the different terms mean can be
very confusing. In this edition of How Stuff Works, you'll learn what RAM is,
what kind you should buy and how to install it.
RAM is considered "random access" because you can access any memory cell directly if you know the row and column that intersect at that cell. The opposite of RAM is serial access memory (SAM). SAM stores data as a series of memory cells that can only be accessed sequentially (like a cassette tape). If the data is not in the current location, each memory cell is checked until the needed data is found. SAM works very well for memory buffers, where the data is normally stored in the order it will be used. A good example is the texture buffer memory on a video card.
How RAM Works
A capacitor is like a small bucket that is able to store electrons. To store a 1 in the memory cell, the bucket is filled with electrons. To store a 0, it is emptied. The problem with the capacitor's bucket is that it has a leak. In a matter of a few milliseconds a full bucket becomes empty. Therefore, for dynamic memory to work, either the CPU or the memory controller has to come along and recharge all of the capacitors holding a 1 before they discharge. To do this, the memory controller reads the memory and then writes it right back. This refresh operation happens automatically thousands of times per second.
The capacitor in a dynamic RAM memory cell is like a leaky bucket.
Memory cells are etched onto a silicon wafer in an array of columns (bitlines) and rows (wordlines). The intersection of a bitline and wordline constitutes the address of the memory cell.
DRAM works by sending a charge through the appropriate column (CAS) to activate the transistor at each bit in the column. When writing, the row lines contain the state the capacitor should take on. When reading, the sense-amplifier determines the level of charge in the capacitor. If it is more than 50% it reads it as a 1, otherwise as a zero. The counter tracks the refresh sequence based on which rows have been accessed in what order. The length of time necessary to do all this is so short that it is expressed in nanoseconds (billionths of a second). A memory chip rating of 70ns means that it takes 70 nanoseconds to completely read and recharge each cell.
Memory cells alone would be worthless without some way to get information in and out of them. So the memory cells have a whole support infrastructure of other specialized circuits. These circuits perform functions such as:
Static RAM uses a completely different technology. In static RAM, a form of flip-flop holds each bit of memory (see How Boolean Gates Work for detail on flip-flops). A flip-flop for a memory cell takes 4 or 6 transistors along with some wiring, but never has to be refreshed. This makes static RAM significantly faster than dynamic RAM. However, because it has more parts, a static memory cell takes a lot more space on a chip than a dynamic memory cell. Therefore you get less memory per chip, and that makes static RAM a lot more expensive.
So static RAM is fast and expensive, and dynamic RAM is less expensive and slower. Therefore static RAM is used to create the CPU's speed-sensitive cache, while dynamic RAM forms the larger system RAM space.
From the top, here are SIMM, DIMM and SODIMM memory modules.
Memory chips are normally only available as part of a card called a module. You've probably seen memory listed as 8x32 or 4x16. These numbers represent the number of the chips multiplied by the capacity of each individual chip, which is measured in megabit (Mb), or one million bits. Take the result and divide it by eight to get the number of megabytes on that module. For example, 4x32 means that the module has four 32-megabit chips. Multiply 4 by 32 and you get 128 megabits. Since we know a byte has eight bits, we need to divide our result of 128 by 8. Our result is 16 megabytes!
The type of board and connector used for RAM in desktop computers has evolved over the past few years. The first types were proprietary, meaning that different computer manufacturers developed memory boards that would only work with their specific systems. Then came SIMM, which stands for single in-line memory module. This memory board used a 30-pin connector and was about 3.5 inches by .75 inches (about 9 centimeters by 2 centimeters) in size. In most computers, you had to install SIMMs in pairs of equal capacity and speed. This is because the width of the bus is more than a single SIMM. For example, you would install two 8 megabyte (MB) SIMMs to get 16 megabytes total RAM. Each SIMM could send 8 bits of data at one time while the system bus could handle 16 bits at a time. Later SIMM boards, slightly larger at 4.25 inches by 1 inch (about 11 centimeters by 2.5 centimeters), used a 72-pin connector for increased bandwidth and allowed for up to 256MB of RAM.
As processors grew in speed and bandwidth capability, the industry adopted a new standard in dual in-line memory module (DIMM). With a whopping 168-pin connector and a size of 5.4 inches by 1 inch (about 14 centimeters by 2.5 centimeters), DIMMs range in capacity from 8MB to 128MB per module and can be installed singly instead of in pairs. Most PC memory modules operate at 3.3 volts while Mac systems typically use 5 volts. A new standard, Rambus in-line memory module (RIMM), is comparable in size and pin configuration to DIMM but uses a special memory bus to greatly increase speed.
Many brands of notebook computers use proprietary memory modules, but several manufacturers use RAM based on the small outline dual in-line memory module (SODIMM) configuration. SODIMM cards are small, about 2 inches by 1 inch (5 centimeters by 2.5 centimeters), and have 144 pins. Capacity ranges from 16MB to 256MB per module. An interesting fact about the Apple iMac desktop computer is that it uses SODIMMs instead of the traditional DIMMs.
The problem with parity is that it discovers errors but does nothing to correct them. If a byte of data does not match its parity bit, then the data are discarded and the system tries again. Computers in critical positions need a higher level of fault tolerance. High-end servers often have a form of error-checking known as error correction code (ECC). Like parity, ECC uses additional bits to monitor the data in each byte. The difference is that ECC uses several bits for error checking -- how many depends on the width of the bus -- instead of one. ECC memory uses a special algorithm not only to detect single bit errors, but actually correct them as well. ECC memory will also detect instances when more than one bit of data in a byte fails. Such failures are very rare, and they are not correctable, even with ECC.
The majority of computers sold today use nonparity memory chips. These chips do not provide any type of built-in error checking but instead rely on the memory controller for error detection.
Common RAM Memory Types
How Much Do You Need?
If your system responds slowly or accesses the hard drive constantly, then you need to add more RAM. If you are running Windows 95/98, you need a bare minimum of 32MB, and your computer will work much better with 64MB. Windows NT/2000 needs at least 64MB, and it will take everything you can throw at it, so you'll probably want 128MB or more.
Linux works happily on a system with only 4MB RAM. If you plan to add X-Windows or do much serious work, however, you'll probably want 64MB. Apple Mac OS based systems will work with 16MB, but you should probably have a minimum of 32MB.
The amount of RAM listed for each system above is estimated for normal usage -- accessing the Internet, word processing, standard home/office applications and light entertainment. If you do computer aided design (CAD), 3-D modeling/animation or heavy data processing or if you are a serious gamer, then you will most likely need more RAM. You may also need more RAM if your computer acts as a server of some sort (Web pages, database, application, FTP or network).
Another question is how much VRAM you want on your video card. Almost all cards that you can buy today have at least 8MB of RAM. This is normally enough to operate in a typical office environment. You should probably invest in a 32MB graphics card if you want to do any of the following:
How to Install RAM
In the previous section, we discussed how much RAM is needed in most
situations. RAM is usually sold in multiples of16 megabytes: 16, 32, 64, 128 and
256. This means that if you currently have a system with 64MB RAM and you want
at least 100MB RAM total, then you will probably need to add another 64MB
You will also need to know what type of RAM is required. Some computers require very specific types of RAM to operate. For example, your computer may only work with 60ns-70ns parity EDO RAM. Most computers are not quite that restrictive, but they do have limitations. For optimal performance, the RAM you add to your computer must also match the existing RAM in speed, parity and type. The most common type available today is SDRAM.
Before you open your computer, check to make sure you won't be voiding the warranty. Some manufacturers seal the case and request that the customer have an authorized technician install RAM. If you're set to open the case, turn off and unplug the computer. Ground yourself by using an anti-static pad or wrist strap to discharge any static electricity. Depending on your computer, you may need a screwdriver or nut-driver to open the case. Many systems sold today come in toolless cases that use thumbscrews or a simple latch.
The actual installation of the memory module does not normally require any tools. RAM is installed in a series of slots on the motherboard known as the memory bank. The memory module is notched at one end so you won't be able to insert it in the wrong direction. For SIMMs and some DIMMs, you install the module by placing it in the slot at approximately a 45 degree angle. Then push it forward until it is perpendicular to the motherboard and the small metal clips at each end snap into place. If the clips do not catch properly, check to make sure the notch is at the right end and the card is firmly seated. Many DIMMs do not have metal clips; they rely on friction to hold them in place. Again, just make sure the module is firmly seated in the slot.
Once the module is installed, close the case, plug the computer back in and power it up. When the computer starts the POST, it should automatically recognize the memory. That's all there is to it!
Send mail to
questions or comments about this web site.