All computer memory is used to hold binary strings of data destined to be manipulated by the CPU. Think of memory as a vast bank of switches with two positions: on or off. Off is given the value of "0"; on is given the value of "1." This allows the switches to hold binary data based on whether they are open or closed. By stringing a series of switches together, larger numbers and code values can be represented.
Nonvolatile and Volatile Memory
There are two major classes of computer memory: nonvolatile and volatile.
Non-volatile memory (NVM)
Nonvolatile memory is retained even if the power is shut off. The setup data held in CMOS, discussed in the preceding lessons, is a good example of nonvolatile memory. If the data is lost when the computer loses power, the memory is said to be volatile.
Read-only memory (ROM), flash memory, hard disks, floppy disks, and magnetic tape and optical discs are the good examples of Non-volatile memory
Volatile memory
Unlike non-volatile memory, volatile memory requires power to maintain the stored information or needs power to reach the computer memory. Random-access memory (RAM) is the good example of volatile memory.
Active Memory
Active memory is a state in which a block of code or data is directly accessible to the CPU for reference or manipulation. When data is located outside the system's active memory, it is said to be "in storage." Storage devices include floppy disk and hard disk drives, optical media, and tape units.
Active memory is faster than storage because the information is already on the system, there are fewer physical (and no mechanical) operations involved in obtaining the data, and the CPU has direct control over the memory.