What is RAM?
RAM, which stands for Random Access Memory, is a hardware device generally located on the motherboard of a computer and acts as an internal memory of the CPU. It allows CPU store data, program, and program results when you switch on the computer. It is the read and write memory of a computer, which means the information can be written to it as well as read from it.
RAM is a volatile memory, which means it does not store data or instructions permanently. When you switch on the computer the data and instructions from the hard disk are stored in the RAM, e.g., when the computer is rebooted, and when you open a program, the operating system (OS), and the program are loaded into RAM, generally from an HDD or SSD. CPU utilizes this data to perform the required tasks. As soon as you shut down the computer, the RAM loses the data. So, the data remains in the RAM as long as the computer is on and lost when the computer is turned off. The benefit of loading data into RAM is that reading data from the RAM is much faster than reading from the hard drive.
In simple words, we can say that RAM is like a person?s short term memory, and hard drive storage is like a person's long term memory. Short term memory remembers the things for a short duration, whereas long term memory remembers for a long duration. Short term memory can be refreshed with information stored in the brain?s long term memory. A computer also works like this; when the RAM fills up, the processor goes to the hard disk to overlay the old data in Ram with new data. It is like a reusable scratch paper on which you can write notes, numbers, etc., with a pencil. If you run out of space on the paper, you may erase what you no longer need; RAM also behaves like this, the unnecessary data on the RAM is deleted when it fills up, and it is replaced with new data from the hard disk which is required for the current operations.
RAM comes in the form of a chip that is individually mounted on the motherboard or in the form of several chips on a small board connected to the motherboard. It is the main memory of a computer. It is faster to write to and read from as compared to other memories such as a hard disk drive (HDD), solid-state drive (SSD), optical drive, etc.
A computer's performance mainly depends on the size or storage capacity of the RAM. If it does not have sufficient RAM (random access memory) to run the OS and software programs, it will result in slower performance. So, the more RAM a computer has, the faster it will work. Information stored in RAM is accessed randomly, not in a sequence as on a CD or hard drive. So, its access time is much faster.
History of RAM:
Types of RAM:
Integrated RAM chips can be of two types:
Both types of RAM are volatile, as both lose their content when the power is turned off.
1) Static RAM:
Static RAM (SRAM) is a type of random access memory that retains its state for data bits or holds data as long as it receives the power. It is made up of memory cells and is called a static RAM as it does not need to be refreshed on a regular basis because it does not need the power to prevent leakage, unlike dynamic RAM. So, it is faster than DRAM.
It has a special arrangement of transistors that makes a flip-flop, a type of memory cell. One memory cell stores one bit of data. Most of the modern SRAM memory cells are made of six CMOS transistors, but lack capacitors. The access time in SRAM chips can be as low as 10 nanoseconds. Whereas, the access time in DRAM usually remains above 50 nanoseconds.
Furthermore, its cycle time is much shorter than that of DRAM as it does not pause between accesses. Due to these advantages associated with the use of SRAM, It is primarily used for system cache memory, and high-speed registers, and small memory banks such as a frame buffer on graphics cards.
The Static RAM is fast because the six-transistor configuration of its circuit maintains the flow of current in one direction or the other (0 or 1). The 0 or 1 state can be written and read instantly without waiting for the capacitor to fill up or drain. The early asynchronous static RAM chips performed read and write operations sequentially, but the modern synchronous static RAM chips overlap read and write operations.
The drawback with Static RAM is that its memory cells occupy more space on a chip than the DRAM memory cells for the same amount of storage space (memory) as it has more parts than a DRAM. So, it offers less memory per chip.
2) Dynamic RAM:
Dynamic Ram (DRAM) is also made up of memory cells. It is an integrated circuit (IC) made of millions of transistors and capacitors which are extremely small in size and each transistor is lined up with a capacitor to create a very compact memory cell so that millions of them can fit on a single memory chip. So, a memory cell of a DRAM has one transistor and one capacitor and each cell represents or stores a single bit of data in its capacitor within an integrated circuit.
The capacitor holds this bit of information or data, either as 0 or as 1. The transistor, which is also present in the cell, acts as a switch that allows the electric circuit on the memory chip to read the capacitor and change its state.
The capacitor needs to be refreshed after regular intervals to maintain the charge in the capacitor. This is the reason it is called dynamic RAM as it needs to be refreshed continuously to maintain its data or it would forget what it is holding. This is achieved by placing the memory on a refresh circuit that rewrites the data several hundred times per second. The access time in DRAM is around 60 nanoseconds.
We can say that a capacitor is like a box that stores electrons. To store a ?1? in the memory cell, the box is filled with electrons. Whereas, to store a ?0?, it is emptied. The drawback is that the box has a leak. In just a few milliseconds the full box becomes empty. So, to make dynamic memory work, the CPU or Memory controller has to recharge all the capacitors before they discharge. To achieve this, the memory controller reads the memory and then writes it right back. This is called refreshing the memory and this process continues automatically thousands of times per second. So, this type of RAM needs to be dynamically refreshed all the time.
Types of DRAM:
i) Asynchronous DRAM:
This type of DRAM is not synchronized with the CPU clock. So, the drawback with this RAM is that CPU could not know the exact timing at which the data would be available from the RAM on the input-output bus. This limitation was overcome by the next generation of RAM, which is known as the synchronous DRAM.
ii) Synchronous DRAM:
SDRAM (Synchronous DRAM) began to appear in late 1996. In SDRAM, the RAM was synchronized with the CPU clock. It allowed the CPU or to be precise the memory controller to know the exact clock cycle or timing or the number of cycles after which the data will be available on the bus. So, the CPU does not need for the memory accesses and thus the memory read and write speed can be increased. The SDRAM is also known as the single data rate SDRAM (SDR SDRAM) as data is transferred only at each rising edge of the clock cycle. See the image in the following description.
iii) DDR SDRAM:
The next generation of the synchronous DRAM is known as the DDR RAM. It was developed to overcome the limitations of SDRAM and was used in PC memory at the beginning of the year 2000. In DDR SDRAM (DDR RAM), the data is transferred twice during each clock cycle; during the positive edge (rising edge) and the negative edge (falling edge) of the cycle. So, it is known as the double data rate SDRAM.
There are different generations of DDR SDRAM which include DDR1, DDR2, DDR3, and DDR4. Today, the memory that we use inside the desktop, laptop, mobile, etc., is mostly either DDR3 or DDR4 RAM. Types of DDR SDRAM:
a) DDR1 SDRAM:
DDR1 SDRAM is the first advanced version of SDRAM. In this RAM, the voltage was reduced from 3.3 V to 2.5 V. The data is transferred during both the rising as well as the falling edge of the clock cycle. So, in each clock cycle, instead of 1 bit, 2 bits are being pre-fetched which is commonly known as the 2 bit pre-fetch. It is mostly operated in the range of 133 MHz to the 200 MHz.
Furthermore, the data rate at the input-output bus is double the clock frequency because the data is transferred during both the rising as well as falling edge. So, if a DDR1 RAM is operating at 133 MHz, the data rate would be double, 266 Mega transfer per second.
ii) DDR2 SDRAM:
It is an advanced version of DDR1. It operates at 1.8 V instead of 2.5V. Its data rate is double the data rate of the previous generation due to the increase in the number of bits that are pre-fetched during each cycle; 4 bits are pre-fetched instead of 2 bits. The internal bus width of this RAM has been doubled. For example, if the input-output bus is 64 bits wide, the internal bus width of it will be equal to 128 bits. So, a single cycle can handle double the amount of data.
iii) DDR3 SDRAM:
In this version, the voltage is further reduced from 1.8 V to the 1.5 V. The data rate has been doubled than the previous generation RAM as the number of bits that are pre-fetched has been increased from 4 bits to the 8 bits. We can say that the internal data bus width of RAM has been increased 2 times than that of the last generation.
iv) DDR4 SDRAM:
In this version, the operating voltage is further reduced from 1.5 V to 1.2 V, but the number of bits that can be pre-fetched is same as the previous generation; 8 bits per cycle. The Internal clock frequency of the RAM is double of the previous version. If you are operating at 400 MHz the clock frequency of the input-output bus would be four times, 1600 MHz and the transfer rate would be equal to 3200 Mega transfer per second.
Difference between Static RAM and Dynamic RAM: