Primary memory

From Computer Science Wiki
This is a basic concept in computer science

The primary memory stores instructions. It is important to understand primary memory generally holds currently executing instructions.

There are two types of memory in primary memory, RAM and ROM[1]. For the IB, you should focus on RAM, and not ROM.

  • RAM is Random Access Memory which loses its contents when the computer is switched off (it is volatile ). This memory can be written to, instructions and data can be loaded into it.
  • ROM , or Read Only Memory is non-volatile and is used to store programs permanently (the start-up or " boot " instructions, for example), the computer cannot store anything in this type of memory.

When the programs and data files (known as the software) are not in RAM, they are stored on secondary storage (also known as backing store) such as tapes or discs. The tape or disc drives and any input and output devices connected to the CPU are known collectively as peripherals.

Primary Memory[edit]

RAM – Random Access Memory[2]

  • The RAM is where instructions, values are stored at runtime
  • The RAM can be accessed a lot faster than secondary storage, In general the time between primary memory and CPU is 7 to 10 nanoseconds.
  • All data and instructions are lost when the power is turned off (volatile)
  • Allows storage and random access to data and instructions
  • Each instruction & piece of data in the RAM has a unique address (see also: Operating Systems management techniques)


ROM – Read Only Memory

  • Can not be written to easily or at all (often times once only, then never again)
  • In modern PCs usually used for firmware in CPU, Graphics card, hard disks, etc.
  • Many ROM modules are replaced with Flash modules nowadays (ex. BIOS, firmware modules) to allow easier updating
  • In devices like keyboards, etc. which aren’t designed for firmware updates ROM might still be used
  • Stores code for interrupter


Speed of primary memory[edit]

Please use this interactive latency tool to understand latency. Don't forget to move the slider to the right for the most current data.

Time comparison
unit of time Definition Some examples
1 nanosecond Nanosecond is one billionth of a second. 1 ns: Time to execute one machine cycle by an Intel Pentium 4 1 GHz microprocessor, 1 ns: Light travels 12 inches (30 cm)
1 microsecond µs Microsecond is one millionth of a second. 1 µs: Time to execute one machine cycle by an Intel 80186 microprocessor
1 millisecond ms Millisecond is one thousandth of a second. 50-80 ms: The time taken to blink an eye
1 second 1 second is 1 second "One Mississippi" said aloud


  • Describe primary memory.