The memory unit, also known as the storage unit, is one of the major components of a computer’s central processing unit (CPU). It stores data, information, instructions, and immediate computation results. It acts as an information hub and provides data to all other computer components or units as and when needed. Primary memory and secondary memory are two major components of the memory unit.
Primary memory is computer memory that the processor can access directly and quickly. It resides in the computer’s motherboard. Hence, reading and writing data into primary memory is quick. However, it does not store data permanently.
Conversely, secondary memory, or auxiliary memory, is that stores data permanently. However, the computer processor cannot access secondary memory directly.
In this article, we shall discuss everything about primary memory.
What is Primary Memory?
Primary memory is the main memory of a computer that is directly accessible to a processor (CPU). It is also commonly known as internal memory and primary storage. The access time of the primary memory is faster than secondary memory.
When you start your computer, the operating system (the main software), the user interface, and all other user-installed applications get loaded into the main memory. The processor then interacts with these applications and performs application-specific tasks.
In the memory hierarchy, primary memory resides between cache and secondary memory. It has a lower storage capacity than secondary memory and greater than cache memory.
The most common example of primary memory is RAM (Random Access Memory).
Need for Primary Memory
The primary purpose of primary memory is to reduce the access time of the ready process and improve the system's performance.
Secondary memory has a large storage capacity and holds all data, programs, files, and applications. However, the major issue is the processor cannot access it directly, resulting in a longer access time.
As a result, the operating system loads a process that needs to be executed into the main memory. The processor can access this process directly and quickly. After accessing, the CPU processes it efficiently, optimizing system performance.
Classification of Primary Memory
There are two broad categories of primary memory – RAM and ROM. Let us discuss them in detail below.
1. RAM (Random Access Memory)
Random Access Memory (RAM) is the volatile memory that stores data temporarily. When a computer shuts down, the data stored in RAM gets lost. It is also known as Read Write Memory .
A process that needs to be executed is loaded in RAM, making it easy for the CPU to access and process it according to the provided instructions. It is faster to read and write data from and to RAM than other types of storage devices, such as HDDs, SSDs, and optical drives.
For instance, let us say you need to open Microsoft Word. When you click on its icon, the operating system loads its code into RAM, the CPU will access and execute the code, and finally, your Microsoft Word will open.
Characteristics of RAM
- RAM stores data temporarily.
- It makes data accessible directly to a computer.
- It holds applications, data, or instructions that are currently in use by the processor.
- RAM is referred to as the short-term memory of the computer.
- It is the fastest memory.
- It determines the speed of the computer.
Types of RAM
Dynamic RAM, or DRAM, retains data only if it is refreshed periodically, i.e., in a few milliseconds. This is because it leverages one transistor and one capacitor, and the presence of the capacitor requires refreshing after milliseconds. Capacitors leak electric charge. Hence, it becomes necessary to charge DRAM regularly.
SDRAM, DDR SDRAM, ECC DRAM, and RDRAM are the types of DRAM.
Static RAM, or SRAM, holds data constantly as long as there is a power supply. Unlike DRAM, SRAM does not need refreshing periodically to retain data. It leverages several transistors to hold one bit of data, whereas DRAM requires only one transistor for one bit.
Hence, SRAM is much larger and more expensive than DRAM. It is employed if there is a requirement of critical speed.
2. ROM (Read Only Memory)
Another type of primary memory is read only memory (ROM). It is a non-volatile memory that stores data permanently, even if a computer system shuts down. As the name implies, read only memory allows only reading the data and instructions it holds. Hence, it is not possible to alter data stores in ROM.
This type of memory contains data and programs that do not change over time or rarely change. Generally, it stores programs or instructions, which are generally referred to as the startup firmware, required to boot up processes for the computer. This startup firmware is called a basic input/output system (BIOS).
Characteristics of ROM
- ROM is non-volatile.
- It is read-only memory and does not support writing data to it.
- It is more reliable and less expensive than RAM.
- ROM stores data and instructions in binary format.
- It plays a crucial role in the bootup process of a computer.
Types of ROM
Masked Read Only Memory (MROM) is the first ROM developed. It is a hardwired ROM containing a preprogrammed set of instructions or data. This means it contains preprogrammed instructions at the time of manufacturing. The text MROM contains cannot be modified. Today, this type of ROM is obsolete.
Programmable read only memory (PROM) is popularly known as the blank version of ROM. It is manufactured as a blank memory and is fed with programming instructions after manufacturing. Simply put, this memory is blank at the manufacturing time. Customers can buy them, write the desired content, and cannot manipulate it once written.
Erasable and programmable read only memory (EPROM) is a type of ROM whose content can be erasable. Exposing EPROM to UV radiations, it is possible to modify the stored content. It has a quartz window to pass UV rays for around 40 minutes to erase data. Some versions of Intel 8048 and the Freescale 68HC11 used EPROM.
Electrically erasable and programmable read only memory enables users to erase and reprogram memory up to 10000 times. Unlike EPROM, EEPROM leverages electricity to erase its content. It takes around 4ms to 10ms to erase data. Microcontrollers and remote keyless systems generally use EEPROM.
This was all about primary memory. It is the main memory of a computer that is easily and directly accessible to the processor. It stores data, programs, and applications that are currently in use by the CPU, making them accessible quickly. All other computer components receive data from the primary memory.
We hope you have got a good grasp of primary memory and its detailed classification. If you have any doubts, let us know in the comments.
People are also reading: