RAM

RAM, or random access memory, is used in the PC for its primary memory. RAM is where all active programs and data are stored so that they are readily available and easily accessed by the CPU and other components of the PC. When you execute a program on your PC, a copy of the program is copied into RAM from whatever secondary storage it is on, usually the hard disk. Once it is in RAM, the instructions that make upthe program are passed one at a time to the CPU for execution. Any data the program accepts or reads from a disk is also stored in RAM.

There are several reasons that RAM is used in a PC, but perhaps the most important is that RAM can transfer data to and from the CPU much faster than all secondary storage devices. Without RAM, all programs instructions and data would be read from the disk drive, slowing the computer to a crawl. With RAM speeds as fast, if not faster, than the speed of the CPU, the entire PC operates much more efficiently.

RAM is a group of integrated circuits (ICs or chips) that contain small electronic components (called capacitors) that store binary 1s and 0s (see Chapter 2). A variety of memory chips can be used for RAM, but some are better suited to storing large amounts of data, fit better in the space available in the PC, and are less expensive. However, not all memory applications in the PC need to store a large amount of data, so most PCs use three different layers of memory: primary memory, level 1 (L1) cache, and level 2 (L2) cache. RAM, in its common usage, refers to the primary memory layer of the PC’s memory.

Random Access

Random access refers to the ability to access a single storage location in RAM without touching the locations that neighbour it. A good illustration is the difference between a cassette tape and a music CD. If you wish to listen to the third song on a cassette tape, you must fast forward over the first two songs on the tape. This is called sequential or serial access. Everything is accessed in its physical sequence or in series. To listen to the third song on a music CD, however, you merely indicate that you wish to move to track 3, and bingo—there you are. This is called direct or random access. You pick where you’d like to go randomly and then go directly there. Accessing something, a program or data, in RAM is very much like the music CD, except that your choices are millions of individual storage locations (bytes), each of which can be addressed directly by your programs.

Volatile versus Non-volatile

ROM was described earlier as being non-volatile, meaning that it holds its contents without a power source. The opposite of non-volatile is volatile. Volatile memory cannot hold its contents, the data, or programs placed on it without an active power source, such as a wall socket or battery. RAM is a volatile form or memory and when it loses its power, it loses its contents. If you have ever lost everything you were working on when a power failure hit, someone tripped over the power cord, or you had to reboot the PC, then you’ve experienced the downside of volatile memory.

So, why is volatile memory used in the PC? Why not just use non-volatile memory? If you were to use EEPROMs or any of the newer types of SRAM (see the section “RAM Types” later in this section), the cost for the amount of memory you need to run the high-graphic and feature-rich software of today would exceed that of the entire rest of the PC, including all of the options and bells and whistles you could add. Volatile RAM is inexpensive, readily available, easily expanded, and, as long as you protect your system against power problems, it is error- and trouble-free for the most part.