This website uses cookies. By using this site, you consent to the use of cookies. For more information, please take a look at our Privacy Policy.
Home > Wiki encyclopedia > RAM


Random access memory (English: Random Access Memory, abbreviation: RAM), also called main memory, is an internal memory that directly exchanges data with the CPU. It can read and write at any time (except when refreshing), and it is very fast, and is usually used as a temporary data storage medium for the operating system or other running programs. When working in RAM, you can write (store) or read (take out) information from any specified address at any time. The biggest difference between it and ROM is the volatility of data, that is, the data stored will be lost once the power is turned off. RAM is used in computers and digital systems to temporarily store programs, data, and intermediate results.



Memory is a device or component used to store large amounts of information in digital systems, and is an important part of computers and digital devices. Memory can be divided into two categories: random access memory (RAM) and read-only memory (ROM).

Random access memory (RAM) can both store information in and read information from the specified unit. Any information stored in RAM will be lost after power off, so RAM is volatile memory.

ROM is a read-only memory. In addition to fixed storage of data, tables, and firmware, it is also widely used in combinational logic circuits.


Random access

The so-called "random access" means that when the data in the memory is read or written, the time required is independent of the location of the information or the location of the write. In contrast, when reading or writing sequential access (Sequential Access) information in a storage device, the time it takes depends on the location. It is mainly used to store the operating system, various applications, data, etc.

When the RAM is in normal operation, data can be read from the RAM or written to the RAM. Compared with ROM, RAM has the advantages of easy read/write and flexible use, and is particularly suitable for occasions where data is frequently changed quickly.


When the power is turned off, the RAM cannot retain data. If you need to save data, you must write them to a long-term storage device (such as a hard disk).

The working characteristic of RAM is that the data information can be accessed at any location unit at any time after the power is turned on, and the internal information will disappear after the power is turned off.

Sensitive to static electricity

Like other fine integrated circuits, random access memory is very sensitive to the static charge of the environment. Static electricity can interfere with the charge of the capacitors in the memory, causing data loss and even burning out the circuit. Therefore, before touching the random access memory, you should touch the metal ground with your hand.

Access speed

Modern random access memory has the fastest write and read speed among almost all access devices, and the access delay is insignificant compared with other storage devices involving mechanical operations.

Need to refresh (regenerate)

Modern random access memories rely on capacitors to store data. A fully charged capacitor represents 1 (binary), and an uncharged represents 0. Due to the more or less leakage of the capacitor, if no special treatment is done, the data will gradually lose with time. Refresh is to read the state of the capacitor in a specified period, and then recharge the capacitor according to the original state to make up for the lost charge. The need to refresh just explains the volatile nature of random access memory.


The RAM is composed of a storage matrix, an address decoder, a read/write controller, input/output, and chip selection control.

(1) Storage matrix. As shown in the figure, the core part of RAM is a register matrix, used to store information, called the storage matrix.

(2) Address decoder. The function of the address decoder is to translate the binary number corresponding to the register address into valid row selection signals and column selection signals, thereby selecting the storage unit.

(3) Read/write controller. When accessing RAM, whether to read or write the selected register is controlled by reading and writing signals. During the read operation, the data of the selected unit is transferred to the CPU (central processing unit) via the data line and input/output line; during the write operation, the CPU stores the data into the selected unit via the input/output line and data line.

(4) Input/output. The RAM exchanges data with the CPU of the computer through the input/output terminal, it is the input terminal when reading, and it is the input terminal when writing, and it is dual-purpose. Controlled by read/write control line. The number of data lines at the input/output end is the same as the number of corresponding register bits in an address, and some RAM chips have separate input/output ends. Generally, the output end of the RAM has an open collector or three-state output structure.

(5) Chip selection control. Due to the limitation of RAM integration. The memory system of a computer is often composed of many RAMs. When the CPU accesses the memory, it can only access a certain piece (or pieces) of RAM at a time, that is, only one piece (or pieces) of RAM in an address in the memory is accessed by the CPU, and exchanges information with it, while other pieces of RAM and CPU do not When contact occurs, chip selection is used to achieve this kind of control. Usually a RAM has one or several chip select lines. When a chip select line is connected to an effective level, the chip is selected. The output signal of the address decoder controls the register of an address of the chip to connect with the CPU; When the chip select line is connected to an invalid level, the chip is disconnected from the CPU.


According to the different working principles of the storage unit, RAM is divided into static RAM and dynamic RAM.

Static Random Access Memory (SRAM)

The static storage unit is formed by adding a gating control on the basis of a static trigger. Therefore, it relies on the self-protection function of the trigger to store data. The information stored in SRAM can be kept for a long time without power outage, the state is stable, and no external refresh circuit is needed, thereby simplifying the external circuit design. However, because the basic storage circuit of the SRAM contains more transistors, the integration is lower and the power consumption is larger.

The characteristics of SRAM are as follows:

●Storage principle: data is stored by triggers.

●Unit structure: Six-tube NMOS or OS.

●Advantages: fast speed, simple to use, no need to refresh, very low static power consumption; often used as Cache.

● Disadvantages: large number of components, low integration, large operating power consumption.

●Commonly used SRAM integrated chips: 6116 (2K×8 bits), 6264 (8K×8 bits), 62256 (32K×8 bits), 2114 (1K×4 bits).

Dynamic random access memory (DRAM)

DRAM uses the principle of capacitance to store charge to save information, the circuit is simple, and the degree of integration is high. Since any capacitor has leakage current, when the capacitor stores charge, the discharge of the capacitor will cause charge loss after a period of time, and the stored information will be lost. The solution is to read and rewrite the DRAM every certain time (usually 2ms), so that the charge discharged on the capacitor at the logic level "l" is replenished, and the original is at the level " The "0" capacitor remains "0", this process is called DRAM refresh.

The refresh operation of DRAM is different from the memory read/write operation, which is mainly manifested in the following points:

(1) The refresh address is generated by the refresh address counter, not provided by the address bus. [7]

(2) The basic storage circuit of DRAM can be refreshed simultaneously by row, so refresh only needs row address, not column address.

(3) The data line of the memory chip is in a high-impedance state during the refresh operation, that is, the on-chip data line is completely isolated from the external data line.

Compared with SRAM, DRAM has the advantages of high integration, low power consumption, and low price, so it is commonly used in large-capacity memory. The disadvantage of DRAM is that the logic circuit needs to be refreshed, and normal read and write operations cannot be performed during the refresh operation.

The characteristics of DRAM are as follows:

● Storage principle: The principle that the gate capacitance of the MOS tube can be used to store charge needs to be refreshed (early: three-tube basic unit; after: single-tube basic unit).

●Refreshing (regeneration): In order to replenish the leaked charge in time to avoid the loss of stored information, it is necessary to recharge the gate capacitor regularly.

● Refresh time: the time to perform refresh operation regularly. This time must be less than the time that the gate capacitance naturally retains information (less than 2ms).

●Advantages: Integration is much higher than SRAM, low power consumption, and low price.

● Disadvantages: The peripheral circuit is complicated due to refresh; refresh also makes the access speed slower than SRAM, so in computers, DRAM is often used as the main memory.

Nevertheless, due to the simple structure of the DRAM memory unit, the use of fewer components, high integration, and low power consumption, it has become the mainstream product of large-capacity RAM.


Difference from read-only memory

In a computer, RAM and ROM are both data storage. RAM is a random access memory, which is characterized by volatility, that is, memory loss after power failure.


ROM usually refers to solidified memory (write once, read repeatedly), and its characteristics are opposite to RAM. For example, if a file is suddenly shut down or the file is closed without saving, the ROM can randomly save files that were not previously stored, but the RAM will make the previously unsaved files disappear.

Difference from memory

In the composition of the computer, there is a very important part, which is memory. The memory is a component used to store programs and data. For a computer, only when the memory is available, can the memory function be ensured to work properly. There are many types of storage, which can be divided into main storage and auxiliary storage according to their uses. The main storage is also called internal storage (abbreviated as memory), and the auxiliary storage is also called external storage (abbreviated as external storage). External storage is usually magnetic media or optical discs, such as hard disks, floppy disks, magnetic tapes, CDs, etc., which can save information for a long time, and does not rely on electricity to save information, but driven by mechanical components, the speed is much slower than that of the CPU. Memory refers to the storage component on the motherboard. It is the component that the CPU communicates with directly and uses it to store data. It stores the data and programs currently in use (that is, in execution). Its physical essence is one or more sets of data. For integrated circuits with input/output and data storage functions, the memory is only used to temporarily store programs and data. Once the power is turned off or a power failure occurs, the programs and data will be lost.

Starting with a computer, there is memory. The development of memory has also experienced many technical improvements today, from the earliest DRAM to FPMDRAM, EDODRAM, SDRAM, etc., the speed of memory has been increasing and the capacity has been increasing. What kind of memory is mainly used by servers today? Registered ECC SDRAM is commonly used in IA architecture servers.

Since memory is used to store data and programs that are currently in use (that is, in execution), how does it work? The memory of the computer we usually refer to refers to dynamic memory (that is, DRAM). The so-called "dynamic" in dynamic memory refers to when we write data to DRAM. After a period of time, the data will be lost, so it is necessary. An additional circuit is provided for memory refresh operation.


  • XC2C384-10PQG208C


    CPLD CoolRunner -II Family 9K Gates 384 Macro Cells 125MHz 0.18um Technology 1.8V 208-Pin PQFP

  • XC2C384-10TQG144I


    CPLD CoolRunner -II Family 9K Gates 384 Macro Cells 125MHz 0.18um Technology 1.8V 144-Pin TQFP

  • XC2C384-7PQ208C


    CPLD CoolRunner -II Family 9K Gates 384 Macro Cells 217MHz 0.18um Technology 1.8V 208-Pin PQFP

  • XC2C512-10FG324C


    CPLD CoolRunner -II Family 12K Gates 512 Macro Cells 128MHz 0.18um Technology 1.8V 324-Pin FBGA

  • XC2C512-10FT256C


    CPLD CoolRunner -II Family 12K Gates 512 Macro Cells 128MHz 0.18um Technology 1.8V 256-Pin FTBGA

FPGA Tutorial Lattice FPGA
Need Help?


If you have any questions about the product and related issues, Please contact us.