Useful Notes: Random Access Memory
Not to be confused with the album by Daft Punk. While the CPU is a heart of a computer system, moving the data to and from and processing it as required, this data still needs to be held somewhere. That's where RAM comes into play. RAM stands for Random Access Memory — any place in the memory can be written at any time without having to wait. This contrasts with sequential access memory, where you have to rewind or fast-forward a tape or wait for a certain time to access data. Most people simply call RAM "memory" now. It comprises the main operating part of the computer's storage hierarchy. Just as Clock Speed is misunderstood to be the only measure of Central Processing Unit power, capacity is thought to be the only important measurement in when it comes to Random Access Memory. Memory is not all about capacity. Unless a system or game is idle, memory will not stay with the same data indefinitely. It's constantly moving data on and off the memory chips to handle the ever changing data. In other words, capacity is important, but so is how fast it can move data on and off the chip. In situations where the machine has to multitask (such as PCs, PlayStation 3, and Xbox 360), capacity can increase performance, but the returns diminish quickly (i.e., if you double the RAM, it might really boost performance, but if you double it again, it won't do much). More available RAM is helpful for storing more data that you wish to use immediately. It prevents more frequent access to the slower hard drive/DVD/Blu-Ray disk, which to a processor takes an eternity. Like a CPU, memory speed is measured in Clock Speed in between latency. And latency tends to affect memory more than processors. This is because one also has to take into account the speed of the bus, the shared electrical pathway between components. With RAM embedded on the CPU die, there is a very short distance and a dedicated pathway that the bits can travel across, while RAM placed in other areas requires the bits to travel the shared bus, which may have other devices using it. This means factors such as the bus speed and the number of other devices requiring the bus can contribute to data-transfer latency. Even the physical length of the bus can become a non-trivial factor in how fast data can be moved in and out of RAM. In addition to clock speed, latency, and capacity, memory is also measured in bandwidth. Bandwidth is the amount of data that flows between the processors and the memory. Bandwidth tends to have a much higher maximum capacity than the memory capacity, typically 500 to 1000 times greater. This is unlikely to ever be all used up (why bandwidth size is called a "theoretical maximum"; it could reach that maximum, in theory). It's just to ensure the smoothest running between the memory and processors. How these measurements compare depends on the type or memory. One of the problems with memory and the CPU during the development of computers is something called the Memory Wall. While performance of the CPU from 1986 to 2000 improved annually at about 56%, RAM performance only improved by about 10% annually. Thus it's only a matter of time before RAM becomes too slow for the CPU, that is, the CPU will do its task and sit idle waiting for more data to or from RAM. However, while improvements in efficiency of the CPU (for example, Intel's Core 2 processors versus the Pentium D processors) have stalled this problem, physics essentially dictates unless memory performance starts improving, CPU performance will start suffering. A misunderstood aspect of memory is that more memory automatically equates to better performance. This probably started around in The '90s when "just good enough" computers were sold. Technology was improving at such a rapid pace that the amount of RAM in a recently purchased computer may not be enough to run a program a half year down the road. The amount of RAM available to a computer is a massive YMMV in terms of performance. But the test is actually simple to determine if a system would benefit from more. If RAM is constantly full and using the hard drive's swap filenote , the system could definitely benefit from more RAM. If RAM is barely being used, then the system isn't really using it so adding more won't help. This is changing on modern operating systems, however, where extra memory is passively used to hold extra data files for fast access by programs, filling up the longer the system is on. If the memory is needed for active use, then the cache is pushed out to make room. As a tangible example, imagine you're grocery shopping. You opt for the smaller basket at first. Later in life or at some point, you start to require more goods. If you continue to use the basket, it overflows and you have to complete the shopping trip and unload what you have back home and come back another time. However, if you use the much larger cart, you can fit more at once and do everything in one trip. But just because adding one shopping cart made your life easier doesn't mean adding another will. (Though you can "cache" groceries you may need for future use into the extra cart and set that aside, much like an operating system does for pre-fetching data that may be needed later.) There are several ways to classify the RAM types, but the two most used are the technological classification (that is, by the technology underlining each type), and usage classification, breaking the types by their purpose. Here they are: By technology: Historical Well before modern memory types became available, early machines still needed to store their data — even the ENIAC, which didn't even have storable program (it was controlled by sequentially wiring all the modules together) had some storage for data. Initially this was the very straightforward and obvious solution — static memory, that is, keeping the data in the electronic circuits named triggers, or flip-flops, that could remain in one of the two stable states. But because word size in those early machines was somewhere between 20 to 40 bits, and one flip-flop can hold at most two bits of information, while requiring at least four electronic valves at the time when the only available type of valve was a huge and fragile vacuum tube, having more than couple dozens of such "registers" was simply impractical. That's where everything got interesting. To hold bigger amounts of data several technologies were used, some of them being decidedly odd. Like storing the data as an acoustic waves (yes, bursts of sound) in mercury-filled tubes, or magnetic pulses on a rotating drum. Technically, these types of memory weren't even random-access, they were sequential, but they simulated RAM relatively well. Then there was a technology where the bits were stored as dots on the phosphor surface of a CRT — which had the advantage that the programmer could literally see the bits stored, which often helped in the software debugging. But most of these technologies were not terribly practical; they were expensive, slow and (especially in the case of mercury delay lines) environmentally dangerous. Dr. An Wang (then of IBM) proposed a solution which took the industry by storm — magnetic core memory. Core memory consisted of thousands of tiny (1-2 mm wide) donut-shaped magnetic cores, set on a grid of metal wires. By manipulating the voltages put on these wires, the state of any individual core could be read or written. Since there were no moving parts, as with a delay line or a drum, access time was much quicker. Core memory was also substantially denser than either delay-line or CRT memory, and used less power as well. It also held its content when the power was off, which was widely used at the time. In addition to their compact size (for example, a unit holding 1K, a rather generous amount of the time, was a flat frame only 20x20x1 cm square), they were also rather cheap. Cores had to be assembled by hand, even in their last days (early attempts to mechanize the process failed and were abandoned once semiconductor RAM appeared), so most manufacturers used the cheap labor of East Asian seamstresses and embroiderers (who had been made redundant by the widespread adoption of sewing machines) thus making it affordable. Most Mainframes and Minicomputers used core memory, and it was ingrained into the minds of the people who worked on them to such extent that even now you can meet a situation when the word "core" is used as a synonym for RAM, even though computers in general haven't used it since The '70s. Solid State RAM Solid state RAM was the technology that finally ended the core era. It was an outgrowth of the attempts to miniaturize electronic circuits. Transistors had replaced vacuum tubes in early computers relatively quickly, due to their smaller size, reliability (they had no glass envelopes to break or filaments to burn out) and much lower power consumption. However, even the smallest transistors at the time were about the size of a small pencil eraser, and it took hundreds of them to make a working computer, so computers still remained bulky and expensive. In The Fifties two engineers independently figured how to put several transistors and other electronic components on the same piece of semiconductor, and thus the integrated circuit was born. The sizes of the electronic circuits started to shrink almost overnight, and one of the first applications of them in the computer industry was for RAM.
- Static RAM, as mentioned above, is a type of memory where each bit is represented by a state of a certain type of circuit called a flip-flop. With one IC replacing several transistors and their attendant circuitry, static memory became much more affordable, and started appearing in larger and larger amounts. The main advantage of static memory is that it's very quick — basically, its speed is only limited by the speed of the physical processes inside the transistor, and these are extremely rapid. It also requires power only to write something, and takes only a token amount when reading or storing, so it dissipates almost no heat. But still, each bit of static memory takes two to four transistors to store, so it remains relatively bulky and expensive.
- Dynamic RAM, on the other hand, uses capacitors to store bits (it requires generally one capacitor and, maybe, one diode to store one bit, which takes much less silicon space), so it's much more compact and thus cheap. Unfortunately, capacitors tend to lose charge over time, so they have to be periodically recharged, usually by reading the memory and writing the same data again, called "memory refresh". This process takes either the attention of the CPU, or the additional support circuitry on the memory chip itself, and, to add insult to injury, the need to constantly refresh the memory contents means that when the power gets turned off, all memory gets completely erased — core, being magnetic, was completely non-volatile, and static RAM required so little power that it could be kept alive with a simple lithium watch battery. Still, the enormous density that DRAM offers makes it the most affordable and used type of the memory ever.
- Magnetic RAM is basically a return to core on a new level, where each ferrite donut of the old-style core is replaced by a ferrite grain in an IC. It has the density advantage of a DRAM (there is some penalty, but it's not that big), its speed is closer to static RAM, it's completely non-volatile and it can be written as fast at it is read (not to mention as many times as needed), negating most of the Flash Memory drawbacks. Unfortunately, due to Flash selling like ice-cream on a hot day, few producers could spare their fabs to produce it, and it requires significant motherboard redesign to boot. This and several technological bottlenecks seem to lock it in Development Hell for the time.
- On a side note, there's also an issue with security with non-volatile memory. For example, if a computer doing encryption had non-volatile memory, a clever hacker could turn off the machine, take out the memory, and do a dump without fear of losing the contents. For the same thing to happen with DRAM (it actually loses memory over time, not instantaneously), the person would have to dump the RAM chip in liquid nitrogen to slow the discharge process to a crawl.
- There's a new type of memory is on the horizon based on memristors. While theorized in the 1971 as the fourth passive two-terminal electrical component, it wasn't actually fabricated until 2008. Memristors have the property that resistance increases when current is flowed through one way, and decreases when current goes the other. This changes the voltage across the part, which can be used to read a 0 or 1. Since it's a passive part, it's very fast and requires no power to retain its state.
- Fast Page RAM - an evolution of regular DRAM, from the 286 era up until the early Pentium Era. It had a refresh rate of up to 70ns. A typical module of the era would hold up to 8MB of Fast Page RAM. They run at 66MHz speed.
- Extended Data Output (EDO) RAM - Starting from the middle of the Pentium Era, this RAM type emerged to replace Fast Page RAM. It is electronically backwards compatible with Fast Page RAM and runs at the same 66MHz speed as it's predecessor, but the refresh rate has been increased to 60ns. An enhanced version supporting Burst operations (BEDO RAM) was introduced late into the RAM type's life, but by then the market has already chosen SDRAM as it's successor due to SDRAM being the cheaper of the two. An EDO module can be up to 128MB in size.
- Single Data Rate (SDR) RAM - Introduced at 66MHz speed late in the Pentium's life and facing competition from both BEDO RAM and Rambus DRAM, this RAM type eventually emerged as the consumer's choice due to it's affordability, and is the direct predecessor of DDR RAM. It was constantly worked on, and when it was finally usurped by DDR RAM in the Pentium 4 era, it had gained speeds of up to 133MHz and a module can be up to 512MB in size.
- The original DDR RAM (sometimes retroactively called DDR1): 266MHz-400MHz, Module size ranges from 128MB up to 2GB
- DDR2 RAM: 533MHz-1066MHz, Modules sizes range from 512MB up to 4GB. Few motherboards and processors support driving the RAM at 1066MHz speed without overclocking, most maxes out at 800MHz.
- DDR3 RAM: 800MHz-2.4GHz, module size range from 1GB to 16GB, with 32GB modules on the roadmap. As with DDR2, latest batch of motherboards and CPUs only support driving the RAM at 2133MHz unless overclocked.
- DDR4 RAM: 1.6GHz-2.4GHz, with top speeds of up to 3.2GHz in the roadmap. Memory module size starts at 4GB. Currently most motherboards and CP Us will only drive the RAM at 2133MHz unless overclocked.