Computer Fundamentals 简明教程

Computer - Random Access Memory (RAM)

What is RAM (Random Access Memory)?

RAM 是计算机的易失性存储器,用于临时存储数据;一旦关闭电源,RAM 中的数据就会被擦除。它也被称为主存储器或临时存储器。RAM 存储程序或指令执行期间正在主动使用的那些数据。在系统的启动过程中,操作系统主动使用 RAM 和文件或程序执行所必需的应用程序。它通过提供快速数据和指令访问来加速 CPU 处理。

RAM is a computer’s volatile memory which stores data temporarily; once power turned off, the data which is inside the RAM gets erased. It is also known as primary or temporary memory. RAM stores the data that is actively being used during the execution of a program or instructions. During the booting process of a system, the operating system actively uses RAM and applications that are necessary to execute a file or a program. It speeds up CPU processing by providing fast data and instruction access.

random access memory

RAM 主动用于程序或指令执行。一旦我们启动计算机;系统必需的文件、程序和操作系统文件将被加载到 RAM 中以实现计算机的平稳运行。计算机的 RAM 越多,它可以更好地处理多任务并且可以更快地运行应用程序,因为可以更快地访问数据。

RAM is actively used for program or instruction execution. Once we start the computer; system necessary files, programs and operating system files are loaded into the RAM for the smooth running of the computer. The more RAM a computer has, the better it can handle multitasking and the faster it can run applications since data can be accessed more quickly.

How does RAM Work?

RAM 由网格单元组成,每个单元都有一个唯一地址,允许以任何顺序读写数据,CPU 从 RAM 请求数据,RAM 以高速传送数据,这对于多任务处理和运行复杂应用程序至关重要。

RAM consists of a grid of cells, each with a unique address, allowing data to be read or written in any order, the CPU requests data from RAM, which is delivered at high speed, making it essential for multitasking and running complex applications.

RAM 是计算机的内部存储器,可根据要求存储不同类型的数据和信息。它也被认为是读/写内存。RAM 中的数据访问是随机的。这意味着我们无需了解前一个位置的地址,就可以访问内存中的任何随机位置。由于 RAM 是易失性存储器,因此大多数系统中都以不间断电源 (UPS) 的形式存在备份。此外,系统的速度和性能与 RAM 的大小成正比。

RAM is the computer’s internal memory which stores different types of data and information as per the requirement. It is also considered as read/write memory. The data access in RAM is random. This means that we can access any random location in the memory without even knowing the address of the previous location. Since RAM is a volatile memory hence, a backup is present in most of the systems in the form of an uninterrupted power supply (UPS). Moreover, the speed and performance of a system are directly proportional to the size of the RAM.

Characteristics of RAM

RAM 的主要特性如下所述 −

Key Characteristics of RAM are described below −

  1. Multitasking − RAM does multitasking and fast execution of instructions or programs.

  2. Prevents system crashes − RAM prevents system crashes and slowdowns during intensive tasks.

  3. High-performance − It provides high performance for the execution of gaming and visual applications, where large amounts of data must be processed swiftly.

  4. System Support − RAM can perform write and erase operations.

  5. Additional RAM − To maintain the system’s speed and performance; additional RAM can be added on.

  6. Faster data accessing − It facilitates CPU by accessing data quickly to support faster execution. RAM is faster than SSD.

  7. Cost − RAM is not costly as compared to SSD.

Types of Random Access Memory

不同类型的 RAM 在下图中进行分类

Different types of RAM are categorised in the below image

types of ram

SRAM (Static Random Access Memory)

静态 RAM 是一种使用触发器进行主存储的 RAM,并且是易失性的。它是一种半导体存储器。使用双稳态锁存电路存储每一位,因此速度极快,因此称为高速缓存存储器。它通常用作 CPU 高速缓存,通常位于 L2 或 L3 中。它在计算机开启时将数据存储在锁存器中。SRAM 更昂贵,并且比 DRAM 需要更多的功率。它充当计算机系统中的高速缓存存储器。SRAM 比 DRAM 需要更多的晶体管。由于锁存机制,它比 DRAM 更快。SRAM 每位数据使用 6 个晶体管,而 DRAM 每位使用一个晶体管。

Static RAM is a type of RAM that uses flip-flops for primary storage and is volatile. It is a type of semiconductor memory. Each bit is stored using bistable latching circuitry, making it extremely fast so known as cache memory. It is commonly used as a CPU cache and is typically located in L2 or L3. It stores data in the latch as long as the computer is on. SRAM is more expensive and requires more power than DRAM. It serves as cache memory in a computer system. SRAM requires more transistors than DRAM. It is faster than DRAM because of the latching mechanism. SRAM employs 6 transistors per data bit while DRAM uses one transistor per bit.

SRAM 的一些主要特征如下 −

Some of the key characteristics of SRAM are as follows −

  1. SRAM has a memory cell which consists of 6 transistors.

  2. SRAM consist flip-flop to store data units.

  3. SRAM is dedicatedly designed for the CPU and works as a cache memory.

  4. It accesses data in less time; faster than DRAM, and takes very less time to access data.

  5. Storing a large amount of data on a single chip is not possible, so more chips are needed.

  6. SRAM is expensive.

  7. It requires a regular power supply to store data.

  8. SRAM generates more heat.

  9. Contents remain as it is until power is ON.

SRAM 可进一步分为以下类型:

SRAM can be further classified into the following types −

  1. Synchronous − Synchronous SRAM works jointly with a clock signal. It reads and writes in sync with the clock, making it faster and suitable for high-speed applications.

  2. Asynchronous − Its working is not dependent on the clock signal; it carries out read-and-write operations once the addresses and control signals are stable.

  3. Pseudo SRAM − PSRAM is a type of memory that has features of both DRAM and SRAM. The device uses a DRAM cell but includes an internal refresh circuit, so presenting itself as SRAM to the external system.

  4. Non-Volatile SRAM − nvSRAM integrates a small non-volatile memory with SRAM cells to keep data even when power is off.

SRAM 的优点如下:

The advantages of SRAM are as follows −

  1. SRAM is preferred because it is much faster.

  2. It does not require being refreshed.

  3. It delivers faster read and write operations.

  4. It works as a cache memory in CPUs.

  5. It is less prone to errors and data corruption caused by the refresh process.

  6. It is very reliable and therefore is used for cache memory.

DRAM 的缺点如下:

Disadvantages of DRAM are as follows −

  1. It is expensive.

  2. It has a complex cell structure; so the design and layout of SRAM are more complex.

  3. Due to its volatile nature, overall data is lost when power goes off.

  4. It has a low storage capacity as compared to DRAM.

  5. The design is complex and not easy to build or understand.

  6. It is not Suitable for Large Memory Applications

总体来说,高速度和可靠性让 SRAM 变得非常昂贵,特别是在诸如 CPU 缓存等应用中。然而,与 DRAM 相比,其较高的成本和较低的密度限制了其在较小的、高性能内存应用程序中的应用。

Overall, speed and reliability make SRAM highly-priced, particularly for applications such as CPU caches. However, its higher cost and lower density compared to DRAM restrict its use to smaller, high-performance memory applications.

DRAM (Dynamic Random Access Memory)

这是另一种用作主存储器的 RAM 类型;它将数据存储在电容器中,即使计算机已打开电源,也能存储很短时间(几毫秒)。每个存储单元都是一个包含一位数据且由晶体管和电容器组成的 DRAM 芯片。在此存储控制器中,数据可以被读取,然后被重写,不断更新它。可以定期刷新数据以确保其完整性。DRAM 的成本较低,但它可以存储更多数据。此外,它比 SRAM 更慢,但所需的功率更低。

It is another type of RAM used as main memory; it stores data in capacitors for a short period (a few milliseconds) even when the computer is powered on. Each memory cell is a DRAM chip that contains one bit of data and is composed of transistors and capacitors. In this memory controller, the data can be read and then rewritten, constantly updating it. The data is refreshed regularly to ensure its integrity. The DRAM is less expensive, but it can store significantly more data. In addition, it is slower and requires less power than SRAM.

然而,DRAM 比 SRAM 更便宜,因而适合用作 CPU 的主存储器。它比 SRAM 慢,但可以与 CPU 总线直接连接。笔记本电脑的 DRAM 通常范围从 4GB 到 16GB,而小设备的 DRAM 通常范围从 1GB 到 2GB。

However, DRAM is less expensive than SRAM, making it suitable for use as the CPU’s main memory. It is slower than SRAM and can link directly to the CPU bus. A DRAM typically ranges from 4GB to 16GB for laptops and 1GB to 2GB for smaller devices.

以下列出了 DRAM 的部分主要特性−

Some of the key characteristics of DRAM are as follows −

  1. It works as a main memory for the system.

  2. It is made up of capacitors that store the data, thus we need to refresh it multiple times.

  3. It is inexpensive so DRAM is mostly available in Laptops or PCs today.

  4. It requires less space and less power.

  5. It refreshes every millisecond to maintain data consistency.

  6. It is more power-efficient than SRAM.

  7. DRAM can store multiple bits on a single chip.

DRAM 可以进一步分类为以下类型:

DRAM can be further classified into the following types −

  1. SDRAM − Synchronous with bus clock; general computing.

  2. DDR SDRAM − it has higher data transfer rates compared to SDRAM.

  3. DDR2 SDRAM − It has higher speeds, lower power consumption, and enhanced latency.

  4. GDDR − It is optimized for graphics processing units (GPUs).

  5. LPDDR − It is dedicatedly designed for mobile and embedded applications.

  6. RDRAM − Specifically designed for innovative design for specific high-performance applications.

  7. EDO DRAM − It allows for faster read cycles by overlapping operations.

DRAM 的优势如下所示:

The advantages of DRAM are as follows −

  1. DRAM has a slower accessing time than SRAM

  2. Its design is simple, not complex because it consists of only a single transistor.

  3. It is smaller in size.

  4. Its cost is low compared to SRAM

  5. It has high congestion rates.

  6. It has a large memory space.

  7. It has a high density that makes it suitable for large memory applications.

DRAM 的缺点如下:

Disadvantages of DRAM are as follows −

  1. It is volatile so continuous refreshing requires keeping data consistent.

  2. Its manufacturing process is complex.

  3. It is slower than SRAM.

  4. It has higher latency compared to SRAM.