Introduction
Can you imagine your life where you forgot how to walk or how to breathe after waking up from a good nights' sleep or where you just forgot what you did just a second ago? No, right? So, RAM (Random Access Memory) is the part of your brain that keeps track of what you did just a second ago, and ROM is the part of your brain that reminds you every morning how to walk and perform the fundamental daily tasks. That was just about the gist of it. Let's dive deeper into the topic.
Computer memory is of two types- Primary Memory (RAM and ROM) and Secondary Memory (Hard disk, pen drive, etc.). You can refer to the below diagram for a better understanding.
Recommended Topic, Microinstruction in Computer Architecture and Difference Between Jfet and Mosfet
RAM
RAM stands for Random Access Memory. It is a primary volatile memory and stores the data required by the CPU while executing a program. RAM is volatile memory meaning that the data is lost when the power is turned off. The data stored in RAM can be read and changed in any order. RAM can further be classified into SRAM (Static Random Access Memory) and DRAM (Dynamic Random Access Memory).
SRAM
As suggested by the word static, Static-RAM holds the data as long as power is available. It uses latching circuitry (D Flip-Flops) to store every bit. It can store only a limited number of bits per chip, making it more expensive. SRAM is faster than DRAM, but it uses more power and generates more heat. SRAM is used in cache memory and CPU internal registers.
DRAM
Dynamic-RAM requires a recharge every few milliseconds to maintain its data, hence the name dynamic. It stores each bit of data in a memory cell consisting of a capacitor and a transistor, based on MOS (Metal Oxide Semiconductor) technology. Due to this, it can store many bits per chip, making it inexpensive. It uses less power than SRAM and generates less heat. It is primarily used in main memory. The RAM in computers or the graphics memory on the graphics card, which we usually refer to, is DRAM.