Close Window

Reading: Computer memory

Memory is a temporary storage area within the CPU. Data is not changed in memory rather it is taken to the CPU where it is processed, changes in data are then sent back to memory for storage.

The CPU can only execute instructions if the instructions (and their associated data) are stored in memory. Thus the amount of memory in a computer affects the size and number of programs that it can execute.

Why do you lose any work you have not saved?

Remember that when you work on a program it is in memory. Any data you create or any changes you make to data are also stored in memory. When you issue a save command the data saved to secondary storage (eg. your hard disk), until then it is in memory.

Now memory is volatile, which means when the power is turned off, the contents of memory are lost. Thus if you are working on your computer and the power fails, the content of memory which includes your work will be lost. Any work you save to secondary storage is okay as it is not volatile (ie. it's contents are not lost when the power is turned off).

RAM and ROM

Every computer comes with a certain amount of physical memory, usually referred to as main memory or RAM . You can think of main memory as an array of boxes, each of which can hold a single byte of information. A computer that has 1 megabyte of memory, therefore, can hold about 1 million bytes (or characters ) of information.

RAM , acronym for r andom a ccess m emory , is a type of computer memory that can be accessed randomly; that is, any byte of memory can be accessed without touching the preceding bytes. RAM is the most common type of memory found in computers and other devices , such as printers .

There are two basic types of RAM:

  • dynamic RAM (DRAM)
  • static RAM (SRAM)

The two types differ in the technology they use to hold data , dynamic RAM being the more common type. Dynamic RAM needs to be refreshed thousands of times per second. Static RAM does not need to be refreshed, which makes it faster; but it is also more expensive than dynamic RAM. Both types of RAM are volatile, meaning that they lose their contents when the power is turned off.

In common usage, the term RAM is synonymous with main memory , the memory available to programs . For example, a computer with 8M RAM has approximately 8 million bytes of memory that programs can use. In contrast, ROM (read-only memory) refers to special memory used to store programs that boot the computer and perform diagnostics. Most personal computers have a small amount of ROM (a few thousand bytes). In fact, both types of memory (ROM and RAM) allow random access . To be precise, therefore, RAM should be referred to as read/write RAM and ROM as read-only RAM.

Memory differs from secondary storage, such as hard disks or CD-ROMS in speed, volatility and cost.

Why do computers have both memory and secondary storage?

Computers have both memory and secondary storage such as hard disks for the three reasons stated immediately above: speed, cost and volatility. Secondary storage is used to store information permanently while memory is used to store programs while they are running. Memory isn't used for long-term storage as it is volatile and relatively expensive. Alternatively, secondary storage isn't any use for running programs from as it is too slow. After all, what would be the use of having a super fast processor if your memory was as slow as a hard disk?