Smart Computing ® Smart Computing ®
Top Subscribe Today | Contact Us | Register Now   
middle
Home | Tech Support | Q&A Board | Article Search | Subscribe & Shop   


RAM: The PC's Memory Middleman Email This
Print This
View My Personal Library

Computing Basics
January 1996 • Vol.7 Issue 1
Add To My Personal Library

RAM: The PC's Memory Middleman

Jump to first occurrence of: [RAM]

Remember the word "RAM" when your computer displays an "Insufficient Memory" error message. Despite your urges, this doesn't mean you should ram your monitor with your fist. It may, however, mean you need to add RAM to your computer.

RAM (random-access mem-ory) chips are to your computer what brain cells are to your head. Without enough of either, both you and your computer would be vegetables.

RAM's purpose is to serve as a temporary niche for data and instructions that must flow quickly in and out of the central processing unit (CPU) or microprocessor. CPUs (386, 486, and Pentium chips) are the equivalent of your brain's cerebral cortex where your "thinking" goes on. RAM gives the CPU "room" to think. All the data in RAM is equally accessible and can be plucked at random by the CPU as needed.

Like the times you crammed for exams in school and wished you had extra brain cells, computers never seem to have quite enough RAM. New programs incessantly increase their demands for available memory.

On the other hand, modern PCs are cranial giants compared to their predecessors. When the first computers were constructed in the 1940s, even though their vacuum tubes filled a room, their memories were only a handful of bytes. With integrated circuits (ICs), chips containing thousands of transistors, today's typical desktop personal computers have a million times more memory capacity than the world's largest computers 50 years ago.

The first, primitive computer memories were not random, but serial. What went in from a punched tape reader, for example, went out to the CPU in the sequence it arrived, regardless of whether that was an efficient order.

The first random-access memories came in the early 1950s with arrays of tiny (one-fiftieth of an inch across) magnetic "doughnuts." A web of wires magnetized a doughnut one direction or another to represent a bit. This magnetic core memory was the computer memory of choice until semiconductor-based (chip) memory prevailed in the 1970s. Magnetism remains vital to computers, however, since disk drives use it to permanently store data.



Tidbits About Bytes

To understand memory, you must understand how simplistically computers think. Computers cogitate with binary logic that renders everything into the elemental states of either on or off, one or zero. A one or a zero is a bit (an abbreviation for binary digit). Eight bits (some combination of ones and zeros) make a byte. A byte represents a normal typewritten character. For example, an uppercase B in standard binary code is 01000010.

A kilobyte (KB) is not, as you would expect, exactly one thousand bytes. Because of the binary system's arcane math, 1KB equals 1,024 (two to the tenth power) bytes. A megabyte (MB) equals 1,024KB or 1,048,576 bytes. In common usage, however, these numbers are often rounded off to 1,000 and 1,000,000.



Chips Off The Memory Block

The most common type of RAM chip, DRAM (Dynamic RAM), contains thousands of microscopic capacitors etched on a sliver of silicon. Capacitors are devices that temporarily store an electric charge after being connected to a power source. The capacitors in integrated circuit chips either store a charge (a one) or contain no charge (a zero).

Data is written into RAM by charging selected capacitors in the chip. Memory is the stored pattern of charges in the chips. Each bit has an address or location in memory (specified by columns and rows). When called to "remember" certain data, the specified addresses in the chips are read, and the data is sent to the CPU. When new data is written into RAM, the relevant portions of the old patterns are overwritten with the new pattern.

Because reading the charges drains away the stored charge and because the charges also naturally discharge over time, the chips must continuously read all the capacitors and rewrite data to them (but not send that data to the CPU). This process is called "refreshing" and causes these types of chips to be slower than Static RAM (SRAM) chips.

SRAM chips hold thousands of tiny, flip-flop transistors that act as on/off switches. When one of those transistors receives a control pulse, it turns on (one); send it another pulse, and it turns off (zero). SRAM needs no refreshing and, thus, is several times faster than DRAM. SRAM, however, is more expensive and less compact. It is used in special places where speed is critical.

If power is removed from either kind of RAM chip, all bits in the memory reset, losing all data.



RAM And "Memory"


Memory holds data between the CPU "work area" and the disk drive storage area. Note that disk drives and memory mimic each other with virtual memory and virtual drives.
PC users often use the terms RAM (referring to chips) and memory interchangeably. This is mostly, but not entirely, accurate.

Remember the debate among psychologists about where the human brain ends and the mind begins? RAM chips are like brain cells, and memory is like the mind. Memory is what occurs inside RAM chips.

On the other hand, although RAM composes the largest amount of "memory" in a computer, additional forms of memory exist. For example, CPU chips have some built-in memory space. Most video display adapter cards have memory chips that help drive the images on the monitors. Some computers have special dedicated cache memory chips. (For an explanation of cache, see the sidebar below.)

Another important memory chip that's easily confused with RAM is ROM (read-only memory). ROM contains permanent, preprogrammed instructions that users cannot alter. When a computer is turned on, instructions in a ROM chip tell the computer it's a computer and not an expensive toaster. ROM loads basic input and output instructions into RAM. After reading those instructions, the CPU knows how to test and communicate with various components (such as the keyboard and memory to ensure proper operation) and where to look on the hard drive to finish booting, or starting, up the operating system. Even within the RAM chips themselves, memory isn't a unified whole. Memory has different classifications according to DOS (disk operating system).



Managing Memory

Memory's divisions mean the amount of RAM you have is not synonymous with the amount of system "memory" available at any given time. For example, say your computer with 16MB of memory routinely runs half a dozen applications simultaneously in Windows 3.1. Then you buy a high-powered, DOS-based game such as Rebel Assault. The first time you try to run it, however, even as the only DOS program (which needs 4MB to run), you get an "insufficient memory" error. Don't you have four times the required memory? This kind of problem is common and reveals the perplexing puzzle that PC memory has become.

Computer memory once was simpler. The 64KB of memory that came standard in the first IBM PC seems ludicrously small to us now but was sufficient for the programs available at the time. Over the years, hardware and software rapidly became bigger and more powerful. To stay compatible with older programs, newer machines added new features but also remained true to old conventions, achieving backward compatibility.

Backward compatibility has resulted in a memory mess. Different portions of memory function in different ways and are used differently by various programs. Some programs can access only certain areas of memory even if your computer is stuffed with RAM.

To help you understand the complexity, let's diagram RAM. Be forewarned, however. It's not a simple picture. (Refer to the diagram on the next page while reading the following explanation.)

The all-important first megabyte of memory consists of 640KB of conventional memory and 340KB of upper memory. Conventional memory is critical because DOS and DOS programs run within that extremely cramped space. Upper memory is reserved for system use and contains display information for the monitor and device drivers (small programs that instruct the computer how to communicate with a device such as a printer or CD-ROM drive). Although reserved for system use, upper memory has free spaces, called upper memory blocks (UMBs), that can be used for storing small programs and information.

Inside upper memory is a 64KB area called the page frame. It is used with expanded memory.

Memory beyond the first 1MB is either expanded or extended memory, depending on the memory manager and program needs. DOS and CPUs lower than the 286 can't access this memory directly.

The expanded memory specification (EMS) divides space beyond 1MB into small chunks called banks that DOS can digest. Memory managers use their own smoke and mirrors to swap banks from expanded memory above 1MB with page frame memory below 1MB. DOS is fooled into thinking all the activity is taking place in normal memory.

Fewer programs are using EMS because the extended memory specification (XMS) is now the favorite. Instead of swapping memory like EMS, XMS, with the help of a memory manager, sidesteps the 1MB limitation and accesses all the megabytes available. XMS lets programs switch between Real mode and Protected mode as needed. Real mode is the sophisticated Pentium processor mimicking the archaic 8088 processor that powered the first PC. Protected mode lets Pentiums run at full capacity. Applications that run in Windows and some special DOS-extended programs operate in Protected mode.

The first 64KB in extended memory, the high memory area (HMA), is an interesting hybrid because DOS can break its own old rules and access this area in Real mode. In fact, DOS 5.0 and newer load much of the operating code into HMA instead of conventional memory, saving the precious space in conventional memory for applications.

Since Windows handles memory management for Windows-based applications, the worst memory problems occur with DOS-based applications. Obviously, computers need help to unsnarl these memory detours and traffic jams. Memory manager programs direct data in the most efficient routes.



Software & SIMMs

Before you leap out of your chair to go buy the first commercial memory manager program you find, know that you probably already have a memory manager residing on your computer. If you have MS-DOS 6.x, consult your manual about MemMaker, a program that automates the optimization of memory.

Upgrading to Windows 95 also enhances DOS-program performance because Win95 integrates DOS with the new Windows environment. Unless you have at least a 486 with 8MB of RAM, however, upgrading to Win95 isn't worth the bother. Many people upgrading to Win95 also will add RAM to maximize performance.

To upgrade RAM, you must obtain the memory module or chips with the correct type, number of pins, capacity, speed, and number of bits. All that depends on your computer, but let's start by examining an individual RAM chip.

The heart of a RAM chip is a tiny wafer of silicon that could hide under a pencil eraser. The delicate chip is put in a protective epoxy case that also anchors the leads (wires) connecting the chip to the circuit. The case and leads resemble a black, squarish centipede about an inch long. The leads of the chip plug into a socket or are soldered to a circuit board.

Early computers had individual chips plugged into banks of sockets on the motherboard. Banks are groups of chips that, when combined, equal the amount of data transmittable to the processor at one time (plus an error-checking bit called parity). Newer computers use memory modules, a number (often an entire bank) of discrete chips soldered onto a small, plug-in board. The compact module housings compress greater memory capacity into a smaller area, and they can be installed into a computer without using tools. Two types of packag es are the current standards.

SIMMs (single in-line memory modules) use edge connectors to plug into the main board. Like other, larger boards that plug into your computer, the circuit board trace extends to the edge of the module's board. SIMMs plug into matching edge-connector sockets. SIMMs are available in 30-pin or 72-pin modules with capacities ranging from 256KB to 16MB.

SIPPs (single in-line pin packages) are similar to SIMMs but have a row of round pins (instead of circuit board traces) that plug into the main board. SIPPs and SIMMs may have identical capacities, but different mounting hardware makes them incompatible (though adapters let SIPPs plug into SIMM connectors).

Chips and modules also are rated according to speed of access time (how fast a bit can be retrieved), such as 80 nanoseconds, and by the number of bits (plus parity) the chip or module processes at once, such as 9-bit.



Buying New Bytes

If you buy a new computer and wonder how much memory you'll need, the answer is many megabytes. You shouldn't buy a computer with less than 8MB. If you want to run more than one application at a time, less than 8MB will give you grief. If you're planning to use heavy-duty business or desktop publishing applications, get 16MB or more.

If you buy cheap, you will quickly need to add memory to your system. Why not let the factory install it before you bring a system home? With insufficient RAM, your program will be too cramped to work efficiently. With adequate RAM, your PC will crunch the biggest programs like RAMbo.

by Mark D. Stucky

Is It Memory Or Storage?

Memory and storage are often confused. New computers generally include memory (RAM) in multiples of four megabytes (MB) and hard drives containing hundreds of megabytes. If you know your computer has 8 of something and 220 of another, you have 8MB of RAM and 220MB of storage on a hard drive.

RAM is for short-term memory—the information you will need in the next few milliseconds or next few minutes. Disk drives are for long-term memory—what you will need tomorrow or next year.

RAM is volatile. Shut the power off for a second, and all the data is gone forever.

RAM is something like human consciousness. Go to sleep, and consciousness is gone. Upon waking, you remember what you did yesterday because your brain stores the memories that reboot when you wake up. RAM is filled with new instructions from storage when a computer is powered up (rebooted).

Even when power goes off, everything in storage remains just as it was since you last saved or deleted a file. Disk drives are semi-permanent. Information written to a disk will stay there for years unless it is overwritten by new data. A computer, however, can't directly process data stored on a disk. Any information on a diskette or hard drive must be loaded into memory before the computer can process it with its CPU.

Just when you thought you understood the difference between memory and storage, you'll discover blurring distinctions between the two. There is a technological twilight zone in which a computer sometimes thinks hard drive space is memory and sometimes thinks memory is storage space.

Storage Acting As Memory

Do you have so many things to keep track of that you're afraid of forgetting some? Suppose you could temporarily make some of your body's cells act like extra brain cells. Windows performs a similar trick with swap files.

With swap files, when RAM gets full and you need extra memory, some of the files in RAM that aren't being used in an application at the moment are written to the hard drive. This frees up RAM for files that are needed right then. As you continue to use your computer, RAM and the hard drive juggle (swap) the active and inactive files back and forth. Obtaining extra memory from space on the hard drive is called virtual memory.

The great advantage of this duty sharing is that you can use bigger files or more simultaneous applications than you could in RAM alone. Virtual memory's disadvantage is that it is much slower than memory in RAM. When you use a large amount of programs and data, you may notice the hard drive light flash on and off periodically even though you are not opening or saving any new files. You also may notice that the programs are running much slower than usual.

To regain maximum speed, close all applications or files that you don't absolutely need at the moment.

Memory Acting As Storage

Physical drives, being partially mechanical devices, are inherently much slower than the pure electronic speed of RAM. Inertia and mechanical integrity limit how fast read/write heads can move into position or how fast a hard disk can rotate.

But RAM can be made to electronically mimic physical drives so that a computer can be fooled into thinking it's reading from or writing to a disk drive when it is really reading from or writing to speedy RAM chips. This is called a RAM drive or virtual drive.

In the days when programs had to run from diskettes, some disk-intensive applications could be hideously slow. Loading a disk-intensive program into and operating from the virtual drive vastly sped up operation. The down side of this arrangement was that users had to save the final results in the virtual drive to a physical drive or lose all the work when the PC was shut off. Since saving was easily forgotten, and since any power interruption also erased everything, RAM drives never became popular among most users.

A popular nephew of the virtual drive is the cache. Several types of caches exist, but their common purpose is to serve as a transitional storage area between regular memory and some device. Hard drives, diskettes, and CD-ROMs are often cached. Windows 95 and SmartDrive in MS-DOS 6.x provide read and write caches for your drives.

In a read cache , when data is called from the disk, the disk caching software tries to become a fortune-teller and predict your computer's future needs. Along with the data requested, supplemental data (such as the data next on that particular drive track) that probably will be needed next is also loaded into the cache. If the cache "hits" and contains the next packet of information requested, reading from the memory chip is much faster than reading from the disk. If it's a "miss," the information must be loaded from the disk as if no cache had been used. Caches hit most of the time, which greatly reduces the time spent waiting for a disk to be read.

A write cache to a disk lets the CPU dump the information to be stored into the cache and then move on to other business. The cache takes over and writes the information to the disk while the CPU is already busy doing something else. This greatly enhances productivity during the saving of files. The disadvantage is if the power is interrupted (purposefully with the reset button or accidentally through a power failure), the information that has not yet been written to the disk will be lost.

Though memory cross-dressing as storage and storage cross-dressing as memory may be confusing, the division of labor maximizes computer performance.






Want more information about a topic you found of interest while reading this article? Type a word or phrase that identifies the topic and click "Search" to find relevant articles from within our editorial database.

Enter A Subject (key words or a phrase):
ALL Words (‘digital’ AND ‘photography’)
ANY Words (‘digital’ OR ‘photography’)
Exact Match ('digital photography'- all words MUST appear together)





Home     Copyright & Legal Information     Privacy Policy     Site Map     Contact Us

Copyright © 2009 Sandhills Publishing Company U.S.A. All rights reserved.