A few days ago I was emailed by someone who had a few questions about upgrading an old laptop they’ve had for several years. They were very certain that they needed a larger hard drive but had heard of “RAM” (Random Access Memory) and didn’t know if it was something different or the same as a “hard drive”. This is a common mistake many make. To help remedy mistakes like this I like to create simple analogies to help explain how a computer works so they are easier to understand. In this particular case I like to use the human body for comparison.
So let’s imagine that instead of a computer we were talking about the human body. The parts between the human body and computers that would roughly equal each other would be:
CPU = The math-crunching part of your brain.
RAM = Your short term memory. Stuff in here is being thought about right now and is instantly available to the CPU if needed.
Hard Drive = Not so much a part of your brain as it is a thick book being held in your hand. Like a book, it requires you to actually LOOK at it to get information out of it, which requires you to also use your other hand to thumb through its thousands of pages and use a pencil and eraser to add or remove information from it; lots of physical hand movement going on here. It is similar to your own long-term memory. Information stays here after you shut the computer off or go to sleep, but takes longer to recall and longer to write into than RAM.
For reference, here is a short video showing off the inside of a hard drive while it is working. Think about the book and your hands thumbing through and writing/erasing pages while watching this video:
In computers, RAM consists of little chips that do not contain any moving parts but can store information temporarily while the computer is powered on. Data can be read from and written into RAM in a matter of nanoseconds at rates as fast as or faster than a gigabyte per second, primarily because there are no moving parts, just like the CPU (or the human brain). In a very real way, RAM and the CPU are like different parts of a brain that work in concert to produce results quickly.
When a computer is told to load a program, it has to copy that program it into RAM for later use. In the human body, “loading a program” would be kind of like opening that thick book I mentioned earlier to a chapter like, oh I don’t know, “Chess: Instructions and Rules.” If you can remember all the instructions and rules right after reading them for the first time, then you can play the game without any need to stop and read the manual every time it’s your turn. Likewise, if a computer is able to load a program into RAM completely, then it won’t have much need to access the hard drive after it’s been loaded.
In the old days, if you didn’t have enough RAM to load your software into, it simply wouldn’t run at all. This isn’t true these days because modern operating systems use a feature called “Virtual Memory” (or “swap space”) where free space on the hard drive is used as a sort of simulated fake RAM. This would be kind of like taking that book, turning it to the back where the pages are blank, and taking notes… a LOT of notes. This leads to the dreaded hard drive “grind” (that sound you hear when the hard drives is constantly doing something; that KRRRRRRRR sound) where the hard drive is so overwhelmed with reading and writing information that the entire system slows to a crawl while it waits for the hard drive to finish whatever it’s doing. In humans, this would be kind of like trying to do taxes for 20 corporations at the same time; you’d practically wish you were dead.
Fortunately, RAM can be easily upgraded and these days it’s one of the most economic ways to improve your computers performance and postpone its obsolescence. With more RAM, your computer can load larger, more complex programs and relieve your hard drive from the daunting task of pretending to be RAM.
Sunday, August 22nd, 2010