There are mainly two different types of data storage present in a computer,
- Primary Storage
- Secondary Storage
RAM (Random Access Memory) is a form of primary data storage. It is alternatively referred to as ‘Main Memory’ or ‘primary memory’.
So What is RAM in Modern Day Computing?
The term ‘Random Access’ means that the data stored at any location in a RAM can be accessed randomly or directly in any order (unlike hard disks, where the data is accessed sequentially) which makes RAM faster than secondary storage such as hard drive.
RAM is a volatile memory, meaning, it requires a constant electric charge to hold on to a stored data, as soon as the computer is turned off, the data inside a RAM is lost or vanished. (we will see more about its volatile nature below)
RAM is small in physical size as well as in the amount of data it can hold compared to secondary storage. It is also the closest in proximity with the processor.
WHAT IS THE PURPOSE OF A RAM?
Whenever you want to run an application or a program in a computer, it must be first loaded from the hard drive into the “Main Memory” or the RAM. Since data can be accessed randomly and with minimum memory latency (delay), RAM is faster to read from and write to, compared to other kinds of storage and often results in a good performance of a computer.
However, when you run too many applications or programs simultaneously you may experience some lag, because as we discussed above, RAM can hold only a limited amount of data compared to a hard drive. When too many applications are loaded into the main memory simultaneously, they fill up the RAM completely which eventually slows down the computer and there is not enough space left in the main memory to load any new applications, forcing you to close a few running applications. Another alternative is to upgrade the RAM of your computer so that, more data can be loaded from the hard drive into the RAM, thereby reducing the number of times the processor has to read data from the hard drive(which takes much longer than reading from RAM).
Here’s an example for you to better understand what RAM is and how it works. The three main components we are going to focus on are,
- CPU (Processor)
- Hard Drive
Let’s consider an example of cooking a meal in a kitchen, where the CPU is the ‘countertop’, RAM is the ‘pantry’ and the hard drive is the ‘Grocery Store’.
You’re ready to make your meal, you access the pantry for required ingredients and begin with your cooking but the pantry is small and can hold a limited number of items only, for any additional ingredients required you need to access them from the Grocery store, which delays the cooking process.
If the pantry size is increased, it is capable of holding more ingredients and reduces the number of trips to the Grocery store, which are often time-consuming. Similar is the case with the RAM.
(Example referred from crucial.com)
Now that you have a little bit of understanding of what RAM is, let’s look into its different types and understand it’s working in more detail. There are two types of RAM,
- Dynamic Random Access Memory (DRAM)
- Static Random Access Memory (SRAM)
- It is a more common type of memory.
- It consist of small transistors and capacitors (which holds the electric charge)
- It requires constant periodic recharging (refreshing) because the capacitor holds the charge for a short period of time before it leaks away. Hence the name Dynamic
- It provides high performance at a reasonable price.
- Even though its data transferring rate is fairly good, it is still not quite fast enough for modern processors. That’s where SRAM comes into the picture.
- It is a small but high-speed memory cache and is the fastest memory in a computer.
- It consists only of interconnected transistors and hence there’s no need for recharging (refreshing). Hence the name Static.
- It is more expensive and occupies about 2x or 3x the space of a DRAM
Both DRAM and SRAM are volatile memory because they hold on to a data as long as there’s power (electricity). Once the power goes out, so does the data. If you need to store data permanently, it must be transferred to a secondary storage such as hard drive.
Different examples of DRAM are,
SDRAM (Synchronous DRAM)
- The term “synchronous” in SDRAM means that there is synchronization between SDRAM and the clock cycle of the CPU, which allows the CPU to know the exact time (clock cycle) the data will be available for processing, which helps to improve the performance of the computer.
- It was introduced in the year 1993.
- It is called SDR SDRAM (Single Data Rate SDRAM), meaning it can transfer data i.e. read/write only once every clock cycle.
DDR SDRAM (Double Data Rate SDRAM)
- DDR SDRAM is the successor of SDRAM, it came out back in the year 2000 and has a prefetch buffer size of 2-bit.
(prefetch means to load or fetch the data before it is needed because the latency of fetching the data is high. Prefetching accurate data early enough can help to reduce the latency (lower the latency, better the performance))
- Double Data Rate means that data can be transferred twice in a single clock cycle i.e. it can read/write on both, rising (high) and falling (low) edges of a clock cycle, thereby providing high data transfer rates of 200~400 MT/sec (Mega Transfer/second). The data transfer rate is obtained from both the rising and falling edges of the clock cycle.
DDR2 SDRAM (Double Data Rate Two SDRAM)
- It is the successor of DDR SDRAM and was introduced in the year 2003. It has a prefetch buffer size of 4-bit.
- It has extra signal pins and can operate twice as fast as the preceding DDR SDRAM. The data transfer rate of DDR2 is between 400~1066 MT/sec.
DDR3 SDRAM (Double Data Rate Three SDRAM)
- It was introduced in the year 2007 and has a prefetch buffer size of 8-bit.
- It reduces power consumption compared to DDR and DDR2 (DDR requires 2.5V, DDR2 requires 1.8V, whereas DDR3 requires 1.5V)
- It has lower latencies over DDR2 and offers higher data transfer rate between 800~2133 MT/sec.
- It was introduced in the year 2014 and is the latest and the fastest memory available (at the time of writing this article).
- It has a prefetch buffer size of 16-bit and operates at a voltage of 1.2V compared to 1.5V of DDR3.
- DDR4 SDRAM is capable of much higher speeds than the preceding DDR3 SDRAM, the data transfer rate is between 2133~4266 MT/sec.
Now let’s understand the specifications of the RAM.
For e.g. let’s see the specifications of a DDR3 SDRAM, it looks something like,
Here the number after DDR3 i.e.1333 refers to speed in MHz. DDR3-1333 is alternatively called as PC3-10600, where 3 in “PC3” indicates that it’s a DDR3 SDRAM and the number after PC3 refers to maximum bandwidth (the rate at which data can be read/write) in MB/s.
Higher the number, better the bandwidth.
(picture from crucial.com)
A DDR3-1333 (i.e. PC3-10600) operates at 666MHz and has a maximum bandwidth of 10600MB/s or 10.6GB/s and is backward compatible with PC3-8500.
However, a computer designed for DDR3 SDRAM is not compatible with any other SDRAM i.e. you cannot use DDR2 SDRAM in a computer designed for DDR3 SDRAM and vice-versa.
Even though DDR2 and DDR3 have the same number of pins i.e. 240, they are incompatible with each other because of the notch position, as it’s different for each memory.