Code360 powered by Coding Ninjas X Naukri.com. Code360 powered by Coding Ninjas X Naukri.com
Table of contents
1.
Introduction
1.1.
Main Memory
2.
RAM(Random Access Memory)
3.
ROM(Read-Only Memory)
4.
SRAM (Static Random Access Memory)
5.
DRAM (Dynamic Random Access Memory)
6.
Memory Organization
6.1.
RAM integrated circuit chips
6.2.
ROM integrated circuit chips
6.3.
Memory Address Map
6.4.
Memory Connection to CPU
7.
Frequently Asked Questions
7.1.
Where is main memory stored?
7.2.
What are the main memory operations?
7.3.
What is RAM also called?
7.4.
Is ROM a real optical memory?
8.
Conclusion
Last Updated: Apr 23, 2024
Easy

What is Main Memory?

Author GAZAL ARORA
1 upvote

Introduction

Computer memory is similar to the human brain. It is used to save data, information, or instructions. Computers accept the data, process that data, and give the desired output. It is capable of storing both input and output. 

What is Main Memory?

A computer's memory is of three types:

The primary memory of a computer system is also known as the main memory.

Recommended Topic, Microinstruction in Computer Architecture

Main Memory

The main memory of a computer, also known as RAM (Random Access Memory), is a crucial component responsible for temporarily storing data and instructions that the CPU (Central Processing Unit) needs to access quickly during program execution. It serves as a workspace where the CPU can read and write data rapidly, enabling efficient processing of instructions.

Main memory is volatile, meaning its contents are lost when the computer is powered off. It consists of memory cells organized in a hierarchical structure, with each cell capable of storing a single binary digit (bit). These cells are grouped into bytes, which are the fundamental units of data storage in computers.

It is of two types:

  • RAM (Random Access Memory)
  • ROM (Read Only Memory)
     

RAM(Random Access Memory)

RAM is a type of volatile memory used in computers and electronic devices to temporarily store data and instructions that the CPU needs to access quickly during program execution. It allows for random access, meaning any memory location can be accessed directly, enabling efficient read and write operations. RAM is volatile, meaning its contents are lost when power is turned off. It comes in various forms such as SRAM and DRAM, each with its own characteristics and applications.

ROM(Read-Only Memory)

ROM is a type of non-volatile memory used in computers and electronic devices to store firmware, boot loaders, and other essential system software that must not be modified during normal operation. Unlike RAM, ROM is read-only, meaning its contents cannot be modified or overwritten. It retains data even when power is turned off. ROM is commonly used to store the BIOS (Basic Input/Output System) in computers, firmware in embedded systems, and other critical software components.

SRAM (Static Random Access Memory)

SRAM is a type of memory that uses bistable latching circuitry to store each bit. Unlike DRAM, which requires periodic refreshing to maintain data integrity, SRAM retains data as long as power is supplied. It offers faster access times and lower power consumption compared to DRAM, making it suitable for cache memory in CPUs and other high-performance applications. However, SRAM is more expensive and has lower storage density than DRAM.

DRAM (Dynamic Random Access Memory)

DRAM is a type of memory that stores each bit as an electrical charge in a capacitor within an integrated circuit. Unlike SRAM, DRAM requires periodic refreshing to maintain data integrity, which can lead to slower access times. However, DRAM offers higher storage density and lower cost per bit compared to SRAM, making it suitable for main memory in most computing devices, such as personal computers and mobile devices.

Read About - Shift Registers in Digital Electronics

Memory Organization

The main memory technology is based on silicon integrated circuits. The main memory integrated circuits are divided into two major units:

  1. RAM (Random Access Memory) integrated circuit chips.
  2. ROM (Read Only Memory) integrated circuit chips.

RAM integrated circuit chips

A static RAM's main components are flip-flops, which store binary data. The information stored in RAM chips is volatile, which means it will remain valid as long as the device is powered on.

Characteristics of a RAM chip:

  1. A RAM chip is suited for communication with the CPU if it has one or more control inputs that choose the chip only when needed.
  2. A bidirectional data bus is another typical feature that allows data to be transferred from memory to CPU during a read operation and from CPU to memory during a write operation.
  3. The logic 1 and 0 signals are standard digital signals. 
  4. RAM chips come in a variety of sizes and are used based on the needs of the system.
  5. The RAM chips are further classified into two modes, static and dynamic.
     

A RAM chip's block diagram is given below.

You can also read about the memory hierarchy and What are payloads

ROM integrated circuit chips

A ROM memory is used to store data and programs permanently in a computer system. 
ROM chips are available in a variety of sizes. The following block diagram represents a 128 * 8 ROM chip.

  1. A ROM chip has a similar architecture as a RAM chip. However, there is a slight difference. While RAM can perform both read and write operations, a ROM can only perform read operations. In other words, the data bus operates in output mode only.
  2. The 9-bit address lines in the ROM chip indicate any of the 512 bytes stored in it.
  3. The value for chip select 1(CS1) and chip select 2(CS2) must be 0 or 1 for the proper functioning of the unit. If this is not the case, then the data bus is said to be in a high-impedance state. 

Memory Address Map

The system designer must calculate the amount of memory required for a given application and assign it to RAM or ROM.
The interconnection between the processor and the memory is established by knowing the size of memory required and the type of ROM and RAM chips available.
The addressing of memory can be established using a table that specifies the memory address assigned to each chip.  
The table is called the Memory address map. 

For example, 512 bytes RAM and 512 bytes ROM.

  

Address Bus

ComponentHexa Decimal Address10987654321
RAM 10000-007F000XXXXXXX
RAM 10080-007F001XXXXXXX
RAM 10100-017F010XXXXXXX
RAM 10180-01FF011XXXXXXX
ROM0200-03FF1XXXXXXXXX

Memory Connection to CPU

  • The data and address buses are used to connect RAM and ROM chips to a CPU.
  • The low-order lines in the address bus choose the byte within the chips, while the other lines in the address bus select a particular chip through its chip select inputs.
     

Source

You can also read about Input-Output Processor here.

Refer to know about: Device Manager in Computer

Frequently Asked Questions

Where is main memory stored?

Main memory is typically stored on integrated circuits (ICs) or chips located on the motherboard of a computer or electronic device. It consists of volatile memory modules such as DRAM or SRAM, which are directly accessible by the CPU for fast data retrieval and manipulation.

What are the main memory operations?

Main memory operations include reading data from memory, writing data to memory, and refreshing memory contents to maintain data integrity. These operations are essential for storing and accessing data during program execution and system operation.

What is RAM also called?

RAM (Random Access Memory) is also called primary memory or main memory. It serves as a temporary storage space for data and instructions that the CPU needs to access quickly during program execution. RAM is volatile, meaning its contents are lost when power is turned off.

Is ROM a real optical memory?

No, ROM (Read-Only Memory) is not a real optical memory. It is a type of non-volatile memory that stores data and instructions permanently, typically using electronic circuits or semiconductor technology. ROM retains its contents even when power is turned off and is commonly used for firmware and system software storage in computers and electronic devices.

Conclusion

In this article, we learned about the main memory. We learned that primary memory is known as the computer system's main memory. It is a computer's built-in memory; therefore, data from and to the main memory can be read and written very quickly.
We also learned about RAM ROM chips, Memory Address Map, and Memory Connection to the CPU.

Check out our blog on Register in Computer to find out more about computer architecture. 

Explore more!

You can use Code360 to practice various DSA questions asked in different interviews. It will help you master effective coding techniques, and you will also get interview experiences from people working in big companies.

Live masterclass