Types of Memory in Computer: Primary Memory, Secondary Memory, Cache Memory, Virtual Memory and Flash Memory

Types of Memory in Computer: Primary Memory, Secondary Memory, Cache Memory, Virtual Memory and Flash Memory

10 mins read60.7K Views Comment
Jaya
Jaya Sharma
Assistant Manager - Content
Updated on Jan 15, 2025 15:56 IST

For a system to function properly, it is important to have different types of memory in computer. It stores information that the CPU uses for processing and completing instructions. In this article, we will be discussing the different types of computer memory along with their characteristics. 

2023_01_MicrosoftTeams-image-123-1.jpg

In this article, we will be taking a look at the different types of memory in computer systems. 

Table of Contents

What is Memory and Its Types in Computer?

Let us get started by learning what is memory and its types in computer.

Recommended online courses

Best-suited IT & Software courses for you

Learn IT & Software with these high-rated online courses

โ‚น18 K
1 year
โ‚น39.88 K
2 years
โ€“ / โ€“
2 years
โ‚น18 K
1 year
โ€“ / โ€“
2 years
โ‚น10.8 K
6 months
โ‚น19.5 K
12 months
โ‚น16.25 K
4 weeks
name
ICACertificate
โ€“ / โ€“
80 hours

What is Memory in Computer?

Computer memory refers to different types of data storage technologies used by the computer. A computer system is made up of a combination of types of computer memory. It is electronic that holds a place for instruction and data that a computer needs to reach quickly. Computer memory is the collection of storage units that store binary information in bits. The memory block is split into smaller components called cells. Every cell has a unique address for storing data in memory.

Different Types of Memory in Computer

Let us now discuss the classification of various types of computer memory. Broadly, computer memory is segregated into Primary, Secondary, Cache and Register. Further classification is between primary and secondary memory. 

types of memory in computer

1. Primary Memory

This is the main type of memory in computer that communicates directly with the CPU, cache and auxiliary memory. It allows immediate access from temporary memory slots or other storage locations. This type of computer memory keeps data and programs when the process is active to use them. 

When a program or data is activated for execution, the processor loads instructions from the secondary memory into the main memory and then starts execution. It is a volatile memory due to which any unsaved data is lost when a power cut occurs. Primary memory is of two types: RAM and ROM.  

Learn CPU design

1.1 RAM

RAM is a type of memory in computer hardware that temporarily stores data and programs. It is the faster part of the main memory which can be directly accessed by the CPU. It reads and writes programs until the computer is switched on. RAM is of two types: DRAM and SRAM. 

  1. DRAM full form is Dynamic Random-Access Memory. It is a type of RAM that is used for dynamic data storage. Every cell in DRAM consists of one-bit information. A cell is composed of a transistor and a capacitor. This capacitor and transistor are extremely small in size. The capacitor needs a continuous refresh to retain information since it is volatile.
  2. SRAM full form is Static Random-Access Memory. This type of RAM stores static data in memory which remains active until there is a power supply. Same sized SRAM chip holds less data than DRAM. Unlike DRAM, it does not require a continuous refresh. 

Explore networking and hardware courses

1.2 ROM

Read-Only Memory (ROM) is a permanent storage type. This is a type of read-only type of computer memory that only reads the stored information, but it does not have the capability to modify or write. Since it is a non-volatile type of memory in computer, the information stays even after a power cut or when the system has been shut down. ROM is of the following five types:

  1. MROM: It is the oldest ROM whose data is pre-configured via integrated circuit manufacture during the time of manufacturing. Due to this pre-configuration, the user cannot change the instruction stored within the MROM chip. 
  2. PROM: It is a digital ROM which only once allows writing any information or program. This is done using a special PROM programmer or burner device.
  3. Flash ROM: This type of ROM can be programmed or written in smaller units called sectors or block. It is used for transferring data between computer and digital devices. 
  4. EPROM: In this type of ROM, data can be erased as well as reprogrammed only once. It can store data for a minimum of 10-20 years. To erase and reprogram EPROM, the user needs to pass UV light for 40 minutes. Post this, the data can be recreated. 
  5. EEPROM: The full form of EEPROM is Electrically Erasable and Programmable Read Only Memory. It is an electrically erasable and programmable ROM. This allows data to be erased using a high-voltage electrical charge. After this, it can be reprogrammed up to thousands of times. 

2. Secondary Memory

It is a permanent type of memory in computer that holds a large amount of data. This is an external memory that represents different storage media on which data and programs can be saved for long term. It is not directly accessible by the CPU and is available as external devices such as CDs, DVDs and USBs. They are cheaper than primary memory but slower than primary memory.  

  1. Hard disk: It is a type of permanent computer memory that stores programs, files and data. It is stored on the motherboard of the computer that does not lose data even when there is a power outage or when the system has been switched off. 
  2. Compact Disc (CD): It is an optical disk storage device that stores different types of data, such as audio, video, files, and other information. CD uses light to read and write data from CDs. 
  3. Pen Drive: This portable device is a type of secondary memory in computer that is used for permanently storing data. It is also known as a USB flash drive that stores and transfers. 
Difference between SRAM and DRAM
Difference Between RAM And ROM
32-Bit vs. 64-Bit: How They Are Different

3. Cache Memory 

This small-sized chip-based memory of computer that lies between the main memory and CPU. It is very close to the chip of CPU. The aim of this type of computer memory is to enhance the performance of the CPU. It is a high-performance and temporary type of memory that reduces the access time of data from main memory. Every instruction and data that is often used by the CPU is stored within Cache memory. Cache memory is of three types: L1, L2, and L3 cache.

4. Virtual Memory 

It is one of the main types of memory in computer that allows computers to run a program when there is not enough physical memory. It is a common technique used in the operating system. It is used in both hardware and software for compensating physical memory shortage. Virtual memory transfers date form Random Access Memory to disk storage. 

5. Flash Memory

It is one of the five main types of memory in computer that stores data which can be erased and reprogrammed electronically. Even without the power, the data is retained. Flash memory is used for storage and data transfer in industrial applications, consumer devices and enterprise systems. 

Explore the fundamentals of operating systems. Explore our top OS programmes offered by the best colleges in India and online Operating system Courses, and advance your career.

How Does Computer Memory Work?

The computer memory works in the following steps:

  1. As a user starts the computer, BIOS/UEFI firmware will load from ROM into RAM.
  2. The operating system then loads from the secondary storage (HDD/SSD) into RAM.
  3. Applications and data are loaded from secondary storage into RAM whenever needed.
  4. The CPU's cache memory (L1, L2, L3) stores the frequently accessed data so that it can be quickly accessed.
  5. First, the CPU checks its cache memory for the data required before looking in RAM.
  6. RAM holds all programs that are currently running and active data for quick access by the CPU.
  7. Virtual memory uses hard drive space to extend RAM when physical RAM becomes full.
  8. When RAM is full, less-used data is "paged" or moved to the virtual memory on the hard drive.
  9. The Memory Management Unit (MMU) translates between virtual memory addresses and physical RAM addresses.
  10. Data in RAM get erased when the computer powers off, while data in secondary storage is permanent.
  11. When running a program, the CPU constantly reads instructions and data from RAM through the memory bus.
  12. Secondary storage (HDD/SSD) retains data permanently even without power.
  13. The memory controller coordinates all data movement between different memory types.
  14. Write operations save data back to the appropriate memory location based on whether it needs to be temporary or permanent.
  15. The system continually optimizes memory usage by moving data between cache, RAM, virtual memory, and storage based on access patterns.

Importance of Different Types of Memory in Computer

Different types of computer memory are essential for the computer system since, without it, the system cannot perform even basic tasks. In a computer system, memory stores different types of data, such as audio, video, documents, images, etc. This data can be retrieved as and when required. The CPU selects memory cells for reading and writing data based on the task that the user wants the computer to accomplish. There are different memory types in computers to suit the deviceโ€™s needs. 

Characteristics of Different Types of Computer Memory

The following are the characteristics of different types of computer memory:

  1. The storage capacity varies for different types of memory in computer. The storage capacity of external devices is measured in bytes, while internal memory is measured either in words or bytes. Storage word length may vary in 8, 16, or 32 bits.  
  2. Unit of transfer measures the transfer rate of bits that can be either read or written in and out of memory devices. This data transfer rate is different in internal and external devices. For internal memory, it is usually equal to word size and for external memory, it is greater than a word. 
  3. The internal memory in a computer is built within it, whereas external memory is present as a separate storage device such as USB or disk. 
  4. There are four methods to access memory, including DMA, Associative Access Method, Sequential Access Method, and Random Access Method.
  5. Computer memory types have different physical behaviour, such as volatile, non-erasable, and non-volatile memory.
  6. The performance of the memory depends on access time, memory cycle time and transfer rate. Access time is the total time taken by memory devices to perform read and write operations.
  7. Memory cycle time is the total time needed to access the memory block and the additional time needed before starting the second access. 

Explore operating system courses

You can also check out:

Exploring the Evolution of Generations of Computers

FAQs

How many types of computer memory are there?

Mainly, there are two types of computer memory including primary and secondary memory. These two are then further subdivided into different areas of memory.

What are the two types of RAM?

DRAM and SRAM are the two types of RAM:

  1. DRAM or dynamic random access memory is one of the types of RAM that is used in all types of computers including smartphones, tablets and laptops.
  2. SRAM or static RAM is a random access memory that retains data bits within its memory till the time power is being supplied.

Why is RAM significant for computer performance?

RAM is significant for computer performance since it identify the number of programs and processes that can run simultaneously without slowing down the entire system. The more amount of RAM allows user in efficiently multitasking and reducing the need for the computer to rely on slower storage devices.

What is the reason behind cache memory being faster than RAM?

Cache memory is faster than RAM due to the faster technologies being used in Cache. Along with that, cache memory is located closer to the processor. The design of cache memory ensures that the processer quickly accesses frequently used data and instructions. This reduces the time required for fetching information from slower RAM modules. 

Is it possible to upgrade the memory in a computer?

Yes, it is possible to upgrade the memory in a computer especially RAM modules. Depending on the architecture and specifications of the computer, user can add more RAM or replace existing modules with higher-capacity ones. Upgrading the computer memory improves the system performance.

About the Author
author-image
Jaya Sharma
Assistant Manager - Content

Jaya is a writer with an experience of over 5 years in content creation and marketing. Her writing style is versatile since she likes to write as per the requirement of the domain. She has worked on Technology, Fina... Read Full Bio