FIGURE 1.3: DDRAM memory modules for desktop computers. Picture is from
TABLE 1 . 1 :
( Unit )
( Size ) Approximate size in bytes )
on integrated circuits doubles approximately every two years. This means that with time,
both main memory and CPUs become cheaper.
Note that there is a significant difference between the hard disk and the main memory
of a computer. When the computer shuts down, everything that is written in main memory
disappears. This is why the main memory of a computer is referred to as volatile memory.
Alternatively, the data on the hard disk is persistent even after the computer shuts down
and there is no power. Usually, magnetic fields are used to store the data permanently. This
is why hard disks are referred to as persistent storage. Since the hard disk of a computer
contains physical components, such as moving heads and rotating platters, accessing data
from the hard disk is significantly slower than accessing data from main memory. Since the
hard disk contains moving components, Moore's law does not apply to it. Main memory is
significantly more expensive than hard disk memory. For example, currently one can buy a
1 TB hard disk for around
100. Buying that much main memory costs more than 10 times
more. Note that the CPU cannot directly access data from the hard disk. The data needs
to be first brought into main memory before it can be accessed by the CPU.
Main memory is often referred to as Random Access Memory (RAM) . This means that it
takes exactly the same time to access any cell of the main memory. Alternatively, accessing
different parts of the hard disk can take different time. For example, the sector (unit of
division of the hard disk) that is the closest to the reading head can be accessed the fastest.
Accessing a sector that is far away from the reading head will incur rotational delay .This
is the time that is needed for the reading head to reach the sector.
Input devices and output devices can be connected to a computer. Examples of input
devices include keyboard, joystick, mouse, and microphone. Examples of output devices
include monitor, speakers, and printer. An Internet connector can be considered to be both
an input and output device. The CPU communicates with devices though main memory
reads and writes. For example, a program can display an image on the screen by writing the
image to the video card of the display. Similarly, information from an Internet connector
can be received by reading the data from shared main memory.