course TOC

3.3. Internal Hardware

Memory

Computer memory refers to the devices that are used to store data on an electronic computer. There are two basic types of memory: volatile (or temporary), and non-volatile (or permanent).

RAM or Primary Memory

RAM stands for Random Access Memory. It is the primary storage for the computer. All programs, including the operating system, and any data they are using must be in RAM for the computer to access them. Whenever I hear the term, I think, "DAM, why'd they call it RAM?" It is called random because the computer can directly access any location in RAM (using its memory "address"), though we rarely have call to access memory randomly. Thus, Direct Access Memory would have been a better name.

By comparison, a tape (video or audio) is a sequential medium. Accessing a particular note in a song is virtually impossible and requires scanning forward to find it. An audio editing program working on a song in RAM can and does directly access any point you want in the song. (Specifying it might be a problem, but consider cutting a section out to use as a ring tone. Once you specify the end points, the program goes directly to the indicated beginning and end.)

RAM is volatile, or temporary, storage. When the computer is booted, the operating system is loaded into RAM. Any applications you use are located in RAM, along with the data the application may use. A loss of power means that everything in RAM is lost. Data that you did not save (any changes you have made recently) are lost. To help protect you from this loss many applications automatically save a working copy to the (permanent) storage on the hard disk at regular intervals. (You can then recover most of your work.)

The amount of RAM a system has is among the key specifications you will look at when considering to buy (or upgrade) a computer system. Without sufficient RAM, the computer will work poorly, or not all. RAM is typically measured in gigabytes (GB), and the more you have (within reason), the better your system is likely to work (and the more it will cost).

depiction of direct access to RAM
OS, application (Audacity) and data in RAM, with direct access depicted for a particular clip
By Paul Mullins: constructed image

Speed and Types of RAM

Most computers use dynamic RAM (as opposed to the more expensive, but faster static RAM) for main memory in the computer. Currently, computers tend to use DDR-1, DDR-2 or DDR-3 RAM chips. All are a type of synchronous dynamic RAM (SDRAM) with each generation becoming progressively faster. Obviously, for the best performance, you want DDR-3. All forms of RAM are fast compared to disk drives and other mass storage devices, outperforming them by a factor of 1,000 times or more. (Solid State Drives are a special case discussed below.)

RAM chips are manufactured as circuit boards (dual in-line memory modules) that are slotted into the motherboard.

DDRAM
DDRAM memory modules
public domain image


DIMM slots
3 (SDRAM) DIMM slots
public domain image

Cache

Cache memory is very similar to RAM. It is faster, but more expensive, than RAM, so it is generally available in much smaller size than main memory. You will recall that level 1 cache is located in the CPU. Other levels are generally larger than their predecessor and located near the CPU. Cache memory is volatile, or temporary, storage — the intention is for it to be very temporary storage.

Virtual memory

Both the operating system and all of your applications (along with their data) need to be in RAM for you to use them. What happens when RAM fills up? Or, a related problem, there isn't a big enough chunk of RAM available to fit an entire application into?

Virtual memory solves these problems using a special (swap or page) file on the hard disk. Pieces (called a page) of an application that is not currently being used can be moved temporarily to the swap file, making more room available in physical RAM. When that part of the program is needed, it is taken from the swap file and placed back into RAM, possibly displacing some other page from RAM. The two pages are said to have been "swapped".

This scheme allows the computer to pretend that it has much more RAM than it actually does, at a significant performance cost. RAM is about 1,000 times faster than the hard disk, so the process of swapping pages slows the system down. In the worst case, called thrashing, the computer is spending an inordinate amount of its time simply moving pages back and forth from RAM to the swap file. The only practical remedy for this situation is to add additional physical RAM – or quit using so many apps at the same time.

Virtual memory
Depiction of virtual memory
By Ehamberg (Own work) [CC-BY-SA-3.0 or GFDL], via Wikimedia Commons

ROM

ROM refers to a Read Only Memory chip that cannot be written on or erased by the computer user without taking special action. ROM is non-volatile, so contents are not lost when power to the computer is no longer available. [src]

Initially, ROM was truly read only (hence the name). Any program it stored was "hard wired" at the time of manufacture. This evolved into erasable programmable ROM (EPROM) chips, as shown at right. These devices allowed (at least some amount of) the programming to be erased and changed or "flashed". Eventually, this technology evolved into the portable flash drives that are so ubiquitous today and the new solid state drives.

The ROM chip contains all of the information needed to start the computer. The BIOS (or Basic Input/Output System) checks to make sure all the necessary hardware is attached and working. It then begins loading the operating system found on the hard disk, in a special location, into RAM. This is often done in two steps, with the initial phase called the bootstrap. Once the operating system is fully loaded into RAM, control is turned over to the OS to complete the boot process. The final steps in booting include starting necessary system utilities, programs you have scheduled to be loaded at boot time, and configuring the applications to run on your system.

This boot process, which starts at the flip of a switch, has a mechanical analogy in the (many different) Rube Goldberg machine(s). This step from hardware, i.e. a big paperweight, to an operating computer is the real "magic" of computing.

Eprom
The first INTEL EPROM, the 1702 (1971)
By Author : Poil 01:10, 17 Apr 2005 (UTC) (Author personal collection.) [GFDL or CC-BY-SA-3.0], via Wikimedia Commons

Efi boot process
Boot process with EFI on Intel Macs
By Prolinesurfer (created myself with inkscape) [GFDL, CC-BY-SA-3.0 or CC-BY-SA-2.5-2.0-1.0], via Wikimedia Commons
video icon #36 BIOS Basics video icon #38 Flashing/updating BIOS search icon rube goldberg machines videos

SSD: Solid State Drives

A solid state drive utilizes flash memory technology, similar to the flash drive we carry around and the computer's ROM, to replace or augment the traditional hard disk drive. The MacBook Air uses SSD technology with no hard disk. Where the hard disk has been referred to in the descriptions, we can simply substitute the SSD in its place in such a case. (Except that, SSD is approximately the same speed as RAM.)

course TOC


Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Attribution: Dr. Paul Mullins, Slippery Rock University
These notes began life as the Wikiversity course Introduction to Computers.
The course draws extensively from and uses links to Wikipedia.
A large number of video links are provided to labrats.tv. (I hope you like cats. And food demos.)