Skip to content
Related Articles
Open in App
Not now

Related Articles

Difference between RAM and ROM

Improve Article
Save Article
  • Difficulty Level : Easy
  • Last Updated : 28 Feb, 2023
Improve Article
Save Article

Prerequisite – Types of computer memory (RAM and ROM) 

Random Access Memory (RAM) is used to store the programs and data being used by the CPU in real-time. The data on the random access memory can be read, written, and erased any number of times. RAM is a hardware element where the data being currently used is stored. It is a volatile memory. Types of RAM:

  1. Static RAM, or (SRAM) which stores a bit of data using the state of a six transistor memory cell.
  2. Dynamic RAM, or (DRAM) which stores a bit data using a pair of transistor and capacitor which constitute a DRAM memory cell.

Read Only Memory (ROM) is a type of memory where the data has been prerecorded. Data stored in ROM is retained even after the computer is turned off ie, non-volatile. Types of ROM:

  1. Programmable ROM, where the data is written after the memory chip has been created. It is non-volatile.
  2. Erasable Programmable ROM, where the data on this non-volatile memory chip can be erased by exposing it to high-intensity UV light.
  3. Electrically Erasable Programmable ROM, where the data on this non-volatile memory chip can be electrically erased using field electron emission.
  4. Mask ROM, in which the data is written during the manufacturing of the memory chip.

The following table differentiates ROM and RAM:

Difference RAM ROM
Data retention RAM is a volatile memory which could store the data as long as the power is supplied. ROM is a non-volatile memory which could retain the data even when power is turned off.
Read/Write Read and write operations are supported Only read operations are supported
Use Used to store the data that has to be currently processed by CPU temporarily. It is typically used to store firmware or microcode, which is used to initialize and control hardware components of the computer
Speed It is a high-speed memory. It is much slower than the RAM.
CPU Interaction CPU can easily access data stored in RAM CPU cannot easily access data stored in ROM
Size and Capacity Large size with higher capacity, with respect to ROM Small size with less capacity, with respect to RAM
Used as/in CPU Cache, Primary memory. Firmware, Micro-controllers
Accessibility The data stored is easily accessible The data stored is not as easily accessible as in RAM
Cost Costlier cheaper than RAM.
Chip Size A RAM chip can store only a few gigabytes (GB) of data. A ROM chip can store multiple megabytes (MB) of data.
Function Used for temporary storage of data currently being processed by CPU Used to store firmware, BIOS, and other data that needs to be retained
My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!