Everything about RAM...
Tags: tutorial, productivity, computerscience
Published: 2020-04-21 18:22:59

What's your RAM? will be the first question our friend will put on us when we buy a PC. Because all he knows😆 is "more the RAM, more the speed". But how this statement holds in the background. In this article, I will be explaining all you need to know about RAM.

##__Contents__##
+ [1. What is RAM](#1-what-is-ram) 
+ [2. How DRAM works?](#2-how-dram-works) 
+ [3. Developments in DRAMs](#3-developments-in-drams)
+ [3.1 SIMM V/S RIMM](#31-simm-vs-dimm)
+ [4. SDRAM v/s DDR SDRAM](#4-sdram-vs-ddr-sdram)
+ [4.1 DDRx SDRAM](#41-ddrx-sdram) 
+ [5. non ECC v/s ECC](#5-non-ecc-vs-ecc) 
+ [6. RAM Hierarchy](#6-ram-hierarchy) 
+ [7. Before you buy](#7-before-you-buy)

 > This article is mainly concentrated on Dynamic RAM. I'm not touching RAMs in [supercomputers](https://en.wikipedia.org/wiki/Supercomputer) and Static RAM

##___1. What is RAM?___##
When I want to open a paint.exe file, within no time it will load. But want will happen in the background?🤔 The program loads the necessary data from the hard drive(where the application is installed) to the RAM instead of loading the entire application. Then RAM will process the data to Processor(CPU).

![Own creation](https://dev-to-uploads.s3.amazonaws.com/i/8d39rudc0mdc2pwpaib2.png)

##___2. How DRAM works?_🧐__##
DRAM(Dynamic RAM) consists of the millions of memory cells which consist of [transistors](https://whatis.techtarget.com/definition/transistor) and [capacitors](https://learn.sparkfun.com/tutorials/capacitors/all), Capacitor is like a bucket which stores a bit(1 for read and 0 for write) at a time.

![Own creation](https://dev-to-uploads.s3.amazonaws.com/i/umngrx281eljy33zwpvq.png)
 
_Unfortunately, In the actual scenario capacitors will leak some charge, If they aren't charged again then they will forget for what they meant and finally dies_
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/upxppcyzqwkt6yxwg0kb.gif)

_So, Capacitors are charged by some voltage dynamically to again read the data bits_
![own creation](https://dev-to-uploads.s3.amazonaws.com/i/ablrm7jnzcjlehubyyov.gif)
Hence the name evolved as __Dynamic RAM__ and this whole cycle is called as __Clock cycle__. 

## __3. Developments in DRAMs__
Generally, DRAM is _asynchronous with the [clock](https://www.wepc.com/tips/ram-speed/)_ in nature. So, To overcome this drawback later Synchronous Dynamic RAM(SDRAM) is introduced which will be perfectly in synchronous with the clock, After the introduction of SDRAM the transfer rate of the RAM can be explained easily with clock speed. For instance, let's take a present DDR4 SDRAM which has the speed of 3200 MHz that means the RAM operates 3.2 billion cycles per second. 

Indeed, it is necessary to know about the Single inline memory module(SIMM) and Daul inline memory module(DIMM) before knowing anything about SDRAM. 
 
###___3.1 SIMM V/S DIMM___###

__a. SIMM__
SIMMs are mostly used in the early 1980s to 1990s systems, the famous among them are Pentium series and IBM systems.
SIMM uses 32-bit(4-byte) bus path, which means it will transfer 32 bits at a time. let us consider there is a DRAM of speed 100 MHz then total transfer rate of data can be calculated like

![own creation](https://dev-to-uploads.s3.amazonaws.com/i/97e89h1bs3pgqinrx48f.png)
_so the DRAM of 100MHz will process 400 MB/s data to the processor(CPU)._

But, The advancement in RAMs in terms of speed SIMMs are replaced with RIMMs which can provide a much more data transfer rate. 

__b. DIMM__         
DIMMs are mainly used in this generation DRAMs thanks to the usage of 64-bit bus path(8-byte path), which means it will transfer 64 bits at a time.
Let us suppose a present-day DDR4 SDRAM with 3200mhz speed, then transfer rate can be calculated as
![own creation](https://dev-to-uploads.s3.amazonaws.com/i/y9u5we3nv987tfh5267x.png)

_Hence it will process around 25600 MB/s to the processors_
>Special type DIMM is used in laptops and portable PC's which is __SO-DIMM(small outline DIMM)__

##___4. SDRAM v/s DDR SDRAM___##
SDRAM sends data at a single rate only at a rising edge of the clock cycle. But later on, Double Data rate SDRAM(DDR SDRAM) is introduced which sends Double data(both at rising and falling edges)of the clock cycles.
![own creation](https://dev-to-uploads.s3.amazonaws.com/i/jhpi9shjmi5mrnejqwd1.PNG)

###___4.1 DDRx SDRAM___###
To fasten the processing time of the application to the users, Processors are upgrading periodically. consequently, To support the high processing speed the same amount of powerful RAMs are needed. Thus the DDR class RAMs are constantly improved.

_The main differences in DDR class RAMs are tabulated below_
![own creation](https://dev-to-uploads.s3.amazonaws.com/i/kkzxjrq7u2cwgzil65a2.PNG)
> Actually DDR5 expected to launch in 2018 and 2019 but didn't happen😟. But, Lot of buzz going around that DDR5 will hit the market at the end of 2020.

##___5. Non ECC v/s ECC___##
The ordinary RAMs are generally non-ECC(Error-correcting code) while ECC RAMS are commonly used in servers. 
Nowadays servers play a crucial role in different departments like health, public and private sectors, Thus the RAMs in these servers are maintained carefully intended to support 24*7. In case of any errors reported while data processing they can detect the errors and correct back.

>ECC RAMs has 9 memory chips whereas non-ECC RAMs has 8 memory chips.

##___6. RAM Hierarchy___##
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/jeewpqp7yi18e0lppdqg.png)

##___7. Before you buy___##

If you use PC for casual purposes like simple browsing, videos and music then 4GB DDR SDRAM will be abundant. In case of busy employees who needs to work with corporate tools like VMWare, Android studios, Adobe character animators then you can grab from 8GB DDR SDRAM. But if you are a serious gamer or a guy who uses 20 tabs of chrome on the spot you need to clutch 16GB DDR SDRAM. However, This much RAM will be more than enough but as they say "More is More"!!

And if you are planning to upgrade the RAM then make sure you have ticked these boxes 
+ Checking the motherboard: As the different class of RAM has different fitting slots, checking the motherboard which RAM fits is recommended before buying.
![own creation](https://dev-to-uploads.s3.amazonaws.com/i/p7o4kya5ut9jh8yffv23.PNG)

+ If you are using 4GB DDR3 SDRAM for suppose, then the same amount of 4RAM DDR3 SDRAM ram is recommended because two RAMs which are operating at different clock speeds will result in slowing down the performance and ends up with heating💥 the motherboard as well.

__Check out the illustration of present-day RAM__
![own creation](https://dev-to-uploads.s3.amazonaws.com/i/fxdc3j1j47t2xuohwtyh.png)


##___References:___##

https://en.wikipedia.org/wiki/Random-access_memory
https://en.wikipedia.org/wiki/SIMM
https://en.wikipedia.org/wiki/DIMM
https://www.youtube.com/watch?v=PVad0c2cljo