RAM stands for Random Access Memory and is a short-term or volatile form of memory. Why is RAM volatile? Well, whenever the device hosting the RAM loses power all the data residing in the RAM is also lost. In other words, the memory cells in a RAM stick need constant recharging or flow of energy in order to hold the data stored in them. There are two types of RAM- DRAM (Dynamic RAM) and SRAM (Static RAM). In this article, we have briefly discussed what is ram in computer system? And explained its working.
What is the purpose of RAM in Computer system?
Whenever you run a program on your computer, the binary instructions for running the program are loaded sequentially into the system memory or “RAM”, from the persistent storage drive. Consequently, the processor executes said instructions in the same sequence, “running” the program.
Why isn’t the instructions directly executed from the hard drive or permanent storage medium?
Permanent storage technologies are not as fast as RAM. In fact, they are orders of magnitude slower than the RAM in every performance metric. Naturally, if a large enough program is directly executed from the hard drive, it would take forever for any program to finish execution.
To put the difference into perspective, the fastest NVMe SSDs today can have a transfer rate of about 6 GB/s which is paltry, even compared to single-channel previous-gen DDR3 RAM. In terms of the latency involved in accessing data, the RAM is still orders of magnitude faster, depending on the permanent storage technology in question. However, having said so, SSD transfer speeds are quickly appreciating and it is a wonder in its own right that we can even have a conversation today comparing the performance of the two vastly different technologies.
What is DRAM and SRAM?
DRAM is the memory type most commonly used in the system memory. The RAM chips you buy off the shelf to insert into your system when it starts feeling too slow can also be called, you guessed it, DRAM chips. At the circuit level, a DRAM bit is generally made up of a capacitor which signifies a 0 when discharged and a 1 when charged along with one to three transistors to control the state of the capacitor. However, just like any capacitor, charge constantly seeps out over time. Thus if a bit held charge and signified a 1, it would eventually lose charge and start signifying a 0, leading to data corruption. Henceforth, the cells needs to be periodically recharged to maintain data integrity.
SRAM, on the other hand not require periodic recharging of its memory cells. The reason for this boils down to their electronic structure. The SRAM cells are made of six MOSFETs, out of which each bit is stored in four transistors which form two cross-coupled inverters and have three stable states: standby, reading and writing.
How can SRAM cells hold the correct bit without needing to recharge? When an SRAM cell is in standby mode, that is, neither is data being written to, nor read from the cell, two of the four MOSFETs disconnect the cell from the bit lines which are used for said purpose. However, the cell is still connected to the power line and the two cross-coupled inverters formed by the remaining four MOSFETs continue to reinforce each other as long as there is constant supply of power.
Consequently, data operations are generally faster and incur lower access times on SRAM (it is easier to resolve the state of an SRAM bit) but it comes at the cost of decreased packing density. In other words, more DRAM cells can fit into the same area as compared to SRAM cells, primarily since a DRAM cell is smaller, only needing to fit in a transistor and a capacitor. On the other hand, SRAM cells are physically larger since they are comprised of six transistors at the very least.
As far as uses are concerned, SRAM is primarily utilized in cache memory, which is a small but extremely fast memory having the quickest access times in a computer and generally used for storing very vital or frequently used pieces of information. The L2 and L3 caches in a processor are generally made of SRAM cells.