Main memory, also known as primary memory or RAM (Random Access Memory), is a crucial component in a computer system that provides high-speed access to both data and instructions for the central processing unit (CPU).
• It is the central storage unit in a computer system.
• It serves as a temporary storage area where the CPU can quickly read and write data that is actively being used or processed by running programs.
• The principle technology used for the main memory is based on semiconductor integrated circuits.
Characteristics of Main Memory:

‣ Volatility:
RAM is volatile memory, meaning that it loses its contents when power is turned off. This characteristic makes it suitable for temporary storage.
‣ Speed:
Main memory is faster than secondary storage devices (e.g., hard drives or SSDs). This speed ensures quick access to data needed by the CPU during program execution.
‣ Size:
While main memory is fast, its capacity is limited compared to secondary storage. It is designed to store the actively used portions of programs and data.
‣ Addressability:
RAM is a type of random-access memory, meaning that the CPU can access any memory location directly and without having to go through other locations sequentially.
Functions of Main Memory:

‣ Program Execution:
Main memory holds the currently running programs and their instructions. The CPU fetches instructions from RAM for execution.
‣ Data Storage:
RAM stores data that is actively being used or processed by running applications. This includes variables, data structures, and other information.
‣ Operating System Usage:
The operating system is loaded into main memory during the computer’s startup. It remains there to manage various system functions and provide services to applications.
‣ Temporary Storage:
Main memory acts as a temporary storage area where data and instructions are loaded and processed by the CPU. It allows for quick access and manipulation of information.
Types of Main Memory:

DRAM (Dynamic RAM):
Characteristics:
- Requires constant refreshing to maintain the integrity of stored data.
- Less expensive compared to SRAM (Static RAM).
- Higher density, allowing for larger storage capacities.
- Slower compared to SRAM.
Usage:
Commonly used as the main memory in computers due to its cost-effectiveness and higher capacity.
SRAM (Static RAM):
Characteristics:
- Does not require constant refreshing, which makes it faster than DRAM.
- More expensive compared to DRAM.
- Lower density, leading to smaller storage capacities.
- Faster access times compared to DRAM.
Usage:
Often used as cache memory, providing fast access to frequently used data by the CPU.
DDR SDRAM (Double Data Rate Synchronous DRAM):
Characteristics:
- Synchronizes data transfers with the system clock.
- Offers higher data transfer rates compared to traditional SDRAM.
- Commonly used in modern computer systems.
Usage:
Used as the main memory in many computers due to its higher performance compared to older SDRAM.
SDRAM (Synchronous DRAM):
Characteristics:
- Synchronizes data transfers with the system clock, similar to DDR SDRAM.
- Older technology compared to DDR SDRAM.
Usage:
Used in older computer systems, but largely replaced by DDR SDRAM in modern systems.
LPDDR (Low Power DDR):
Characteristics:
- Designed for mobile devices and other power-constrained environments.
- Offers lower power consumption compared to traditional DDR SDRAM.
- Common in smartphones, tablets, and other portable devices.
Usage:
Found in mobile devices where power efficiency is crucial.
DDR2, DDR3, DDR4, DDR5 SDRAM:
Characteristics:
- Evolutions of DDR SDRAM with improvements in data transfer rates, power efficiency, and overall performance.
- Each generation offers higher speed and better efficiency compared to the previous one.
Usage:
Found in various computing devices, with DDR4 being prevalent in recent systems.
RAM And ROM Chips:
- A RAM chip is better suited for communication with the CPU if it has one or more control inputs that select the chip only when needed.
- Another common features is a bidirectional data bus that allows the transfer of data either from memory to CPU during a read operation , or from CPU to memory during a write operation.
- A bidirectional bus can be constructed with three state buffer: a signal equivalent to logic 1 , a signal equivalent to logic 0, or a high – impedance state.
- The logic 1 and 0 are normal digital signals.
- The high impedance state behaves like an open circuit, which means that the output doesn’t carry a signal and has no logic significance.
Typical RAM chip:

Typical ROM chip:

Memory Address Map:
Memory Address Map is a pictorial representation of assigned address space for
each chip in the system.
- To demonstrate an example, assume that a computer system needs 512 bytes of RAM and 512 bytes of ROM
- The RAM have 128 byte and need seven address lines, where the ROM have 512
bytes and need 9 address lines.

The hexadecimal address assigns a range of hexadecimal equivalent address
for each chip.
- Line 8 and 9 represent four distinct binary combination to specify which RAM we chose
- When line 10 is 0, CPU selects a RAM. And when it’s 1, it selects the ROM.
