Computer Memory

Get a brief introduction to computer memory.

Just like a human brain, we can use computer memory to store, retain, process, and retrieve information in computers. The information may include the data required to run the system and the instructions to process that data. Each location in the memory can be accessed using a unique address starting from zero to memory size (last location) minus one. Ideally, computer memory can be divided into the following three types:

  • Cache memory
  • Primary memory (Main memory)
  • Secondary memory

Note: Another potential classification may include two types, internal memory and external memory, where cache and primary memory are categorized as internal memory and secondary memory as external memory.

Cache memory

Cache memory is the closest memory to the CPU and the CPU can access data stored in it in the shortest possible time compared to other memories. It has limited capacity and temporarily stores the data that is most frequently required for the current computer process.

Primary memory

Primary memory also known as main memory is slower than cache memory and faster than secondary memory. It is directly accessible by the CPU. It has limited capacity and temporarily stores data and instructions required to run the current computer process. Primary memory is also known as the working memory of the computer. Primary memory can be classified as RAM and ROM.

Note: The cache memory and RAM are volatile, i.e. data stored in them will be lost if the system is switched off.

RAM

RAM or random access memory is a volatile memory. As the name implies, the data stored in it can be accessed randomly using the address of the data bit. The stored data can be read, and new data can be written in it. It stores data required for immediate computer processing. When the data has served its purpose and is no longer required, it is moved to the secondary memory, and the data required for the next immediate processing is moved from secondary memory to RAM.

ROM

ROM or read only memory is a non-volatile memory, i.e. data stored in it will be retained even if the system loses power access. Normally, this memory can only be read. This memory stores basic sets of instructions like the bootstrap programThe first code that gets executed when a computer is turned on. This code loads the operating system that resides in the secondary memory. required by the CPU to start up.

Secondary memory

Secondary memory also known as external memory is a non-volatile memory. It is slower than the cache and primary memory. It stores data permanently. The CPU can not access secondary memory directly. The required data is first transferred to the main memory and then accessed by the CPU.

🤔 Point to ponder

Question

Think about some less complex systems like a central heating system or air conditioners. Do they need secondary memory as well?

Show Answer

There are many different types of devices with varying technology used to store secondary memory. A few of the main ones are:

  • Hard disk drive: A hard disk drive (HDD) uses a random-access manner to store data. Hence, the data can be stored, accessed, and retrieved in any order.

  • Solid state drive: Solid state drive (SSD) uses semiconductor cells to store data. It is less noisy and provides quicker data access compared to HDD.

  • Blu-ray disc: Blu-ray disc (BD) is a storage format capable of storing large videos in high definition and video games.