Primary Memory

Primary Memory

Primary memory is incredibly important to the functioning of a computer …it’s also not always fully understood what it is and how it works. Learn more here!

What is Primary Memory?

Primary Memory is the first memory or the most important memory that the computer uses. It is the memory directly accessed by the CPU (Central Processing Unit). It is the memory that the computer uses to hold the information (the instructions and data) about what it is is currently working on.

Four Components of Primary Memory

There are four main components to primary memory:

ROM (Read Only Memory)

ROM stands for Read Only Memory, which means this memory can only be read: the computer can get information from the ROM but can’t put information into the ROM. (This is how it originally was, but ROM typically uses a programmable ROM that can have data stored into it. That is how the computer’s firmware or BIOS can get updated!) The data that the ROM uses is for the startup or booting of the computer: it has information that allows the CPU to access the different hardware components (storage, input/output, etc.). ROM is typically very small (a few megabytes) and is non-volatile.

Registers

The CPU contains several very small registers that hold the information (data and/or memory addresses) that the CPU uses in its operations. These are extremely tiny (measured in bits: from 8 to 64 or so). They are usually studied as part of the functioning of the CPU, so aren’t typically talked about when discussing primary memory. They are memory storage spaces that the CPU can access, so they are actually part of primary memory!

Cache

Like the Registers, Cache memory is typically not discussed when talking about primary memory. Cache is small memory storage spaces (typically 1 to 8 megabytes) located on the CPU or very near the CPU, and they are used to hold instructions or data that the CPU uses repeatedly. Both the cache memory and the registers are volatile memory.

RAM (Random Access Memory)

a photograph of memory cards holdiing RAM chips
RAM is found in microchips, often on add-on cards like these

RAM stands for Random Access Memory, which means that any section of it can be accessed as needed. It is the main component of primary memory: it is much bigger than the other components (RAM is typically measured in gigabytes, or billions of bytes!), and is the component typically discussed when talking about primary memory. RAM holds all the instructions and data that the computer works with at any given time.

For example, the computer’s operating system is loaded into RAM at start-up, and any program that needs to run (such as the web browser you are using to read this post!) is also loaded into RAM. Any file or information that is being used (the web page this post is on, an email message, any music files the computer is playing, etcetera) are also loaded into RAM. RAM is volatile memory.

Volatile vs. non-Volatile

screenshot of a save file dialogue box
If you don’t save it (or if it’s not saved automatically), it will be lost forever!

Volatile means it changes, and in computer memory volatile means that when there is electricity flowing the memory can hold information or instructions, but that when the electricity stops flowing the memory is all reset or zero’d out. Any information that was loaded into volatile memory is gone when the power stops.

That means that any information that is stored in RAM (or registers or cache) is gone when the computer shuts down. (Or if your smartphone battery fails, or the power gets cut off to a desktop computer.) Any program that was running is gone, and any data is lost: for example, a report that the user was writing is erased.

Secondary Memory (Storage)

Modern computer users typically don’t experience this loss of data as much because of automatic actions by software: the data is stored in non-volatile memory locations, called Secondary Storage. If software does not do this automatically, the user must do so manually by saving their work to the storage. Secondary storage (typically, a computer’s hard disk drive or solid-state drive) is non-volatile and stores all the information, application software, data, etc. that the computer needs but is not currently using.

For more information on primary memory, check out my online course “Conquer Computer Science: Hardware and Software”

John Iglar

John Iglar has taught Computer Science to students aged 3 to 83. He has taught in some of the finest international schools around the world, covering the IB Diploma, IGCSE, and many more curricula! No longer tied to a school, he tutors, blogs, freelances, and creates online courses.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.