Bits, Bytes, and Words
Nearly everything the PC connects to is measured in bits these days, especially modems and Internet connections, but RAM is still measured in bytes—actually, kilobytes, megabytes, or gigabytes. Table 7-1 lists the various data units commonly associated with RAM.
Memory Speeds
RAM is much faster than a hard disk, floppy disk, CD-ROM, or any other form of secondary storage. On the average, accessing data from a hard disk drive takes from 8 to 16 milliseconds (ms). Accessing the same data from RAM takes from 50 to 80 nanoseconds (ns). There are 1,000ms and 1 billion nanoseconds in a second. What this works out to is that RAM at 50ns is over a million times faster than a hard disk. Other secondary storage devices, such as the CD-ROM or floppy disk, are even slower.
Clock Speeds
Most, but not all, of the actions taking place inside the PC are synchronized to one or more “clocks.” These clocks provide electronic timings to which the components of the PC can synchronize their actions to those of the CPU and other devices. For example, the processor’s internal clock speed provides the tempo at which electronic signals and data are sent around the PC.
The CPU’s clock isn’t really a “clock” like the cuckoo clock on the wall. The system clock sets the length and number of electronic cycles available in one second. These cycles, which are the timing mechanism used to synchronize the movement of data and execution of instructions, are measured in megahertz (MHz). A hertz is one shift of the clock’s electronic signal from high to low (or low to high). A megahertz is one million hertz in one second. A CPU with a clock speed of 600MHz operates on 600 million cycles per second. To put this in terms of instructions, a single computer instruction, such as adding two binary numbers that are already in the CPU’s registers, generally takes one CPU cycle. So, theoretically, a 600MHz computer is capable of completing 600 million of these instructions per second. Many processors are rated in MIPS (million of instructions per second). Unfortunately, most processors cannot translate their megahertz ratings directly into MIPS. Data must be moved in and out of the CPU’s registers to RAM, the hard disk, and other destinations, and these actions also require clock cycles to complete.
CPU Wait States
It should also be noted that RAM, which operates in nanoseconds, is faster than most CPUs. This suggests a problem, but the CPU works through wait states, which are intervals of a set number of cycles between CPU actions, such as data requests, reads, writes, moves, etc., to allow the requests to be carried out. To read data from memory, the CPU may use three wait states, as illustrated in Figure 7-3. The CPU issues the request for data along with an address. Receiving the address and transferring it to the memory controller uses about one wait state. Finding the data in memory also takes about one wait state. Transferring the data to the CPU’s storage areas (called registers) uses a third wait state. Even if each wait state only took about 1/400 millionth of a second (based on a 400MHz
CPU), RAM only requires perhaps 50 to 60ns to do its part.
The significance here is that the closer the RAM’s speed is matched to that of
the data bus and CPU clock, more data will be transferred from RAM to the CPU
and other components of the PC on each cycle. Another speed in the PC that must
be considered is the speed of the data and address buses. Like the CPU, the bus
transfer speed is in megahertz, which represents the speed used to move data
and instructions between structures, such as the CPU and memory. Most RAM
manufacturers include online guides on their Web sites to helpmatch RAM and RAM
speeds to bus and CPU speeds. Table 7-2 contains a sampling of RAM speeds and
matching bus speeds.
Having more RAM in the PC does not improve the overall speed of the processor, but it does improve how much data the processor can access without the need to go to the slower hard disk drive. You may have heard that adding RAM to a slow PC will speed it up. Yes, but only because the processor was able to perform faster input/output (I/O) operations.