Difference Between RAM and ROM

RAM (Random Access Memory) is a fast accessible memory that stores data during its operation while ROM (Read Only Memory) stores permanent data that is used for its functions, such as the information for booting the computer. Thus, the key difference between RAM and ROM is in the way the data is stored in them; the storage in RAM is temporary whereas the storage in ROM is permanent.

A computer, like the human brain, needs memory to store required information. For example, a human can add two numbers together and produce the results based on a method he has learned and memorized. In the same manner, a computer needs to hold methods and information in a memory to operate. RAM and ROM are both different types of memories used in any computer to make it fast and to enable it to access information stored in the computer. Every computer comes with a certain amount of physical memory, which is in the form of chips that hold data.

CONTENTS

1. Overview and Key Difference
2. What is RAM
3. What is ROM
4. Side by Side Comparison – RAM vs ROM in Tabular Form
6. Summary

What is RAM?

RAM is the abbreviation of Random Access Memory. As the name interpret, the usage or access to the memory is random since the microprocessor reads the memory and write to it very rapidly. Consider a computer which needs to add two numbers that a user inputs. When the user inputs the two numbers, the computer stores those numbers in the RAM. After that, it stores back the result in the RAM for the user to read. This is how the computer or the microprocessor reads and writes data in the RAM. Likewise, while executing a program, the computer stores the required data from hard disk drive in the RAM for fast access.

How Data is Stored in RAM

A RAM is an integrated circuit composed of memory cells which are circuits of logic gates. Each memory cell has an address by which the microprocessor identifies where to write the data or from which to read it. One memory cell can store only one bit of data, and usually, the memory cells are arranged as registers to hold 8 bit wide data. The width of data may vary depending on the RAM type. That is, a 16-bit RAM has 16 bit registers, whereas an 8-bit RAM has 8-bit registers.

The above-said registers have two types of connections: address lines and data lines. The logic ‘1’ and ‘0’ combination placed on the address lines activates the register that matches the particular combination and enables it either to read or write. However, the data stored in this RAM registers are only temporary, so they vanish when the power is off. This makes RAM a volatile memory.

Figure 01: RAM

Types of RAM

There are several types of RAMs used in a computer; the main types are Static RAM (SRAM) and Dynamic RAM (DRAM). SRAM is much faster on access and cost of production is higher than DRAMs. Therefore, SRAM is used as a cache memory of the microprocessor chip. DRAM, on the other hand, is a bit slower and comparatively less expensive. DRAMs are used externally to the microprocessor on the motherboard. Sometimes, the computer makes a separate partition on the hard disk as a RAM to make up for the overused physical RAM. This process makes the computer slower in operation since this requires writing and reading data in a file called page file on the hard disk. This type of RAM is called virtual RAM.

What is ROM?

ROM is the acronym for Read-Only Memory. Unlike RAM, ROM is a non-volatile memory; although the power is removed from the ROM chip, the stored data still remains in their registers. ROMs, usually, have data pre-stored when they are manufactured. For computers, ROM is useful to store un-altered programs; for example, BIOS, which is executed at the starting (boot).

Disadvantages of ROM

There are many disadvantages of ROMs, and the main disadvantage being the inability to alter or update the features of the firmware. If the manufacturer has programmed it with malfunctioning firmware, then all the chips have to be recalled and replaced one by one. Another drawback is that ROMs are not useful in R&D work since many versions of the firmware have to be tested by the programmer before launching the final product.

Types of ROM

An erasable programmable ROM (EPROM) where the firmware can be re-written by the programmer has been introduced to overcome the above said issues. However, the erasing needs a high-intensity UV light, making it still difficult. As a solution for this, the electrically erasable programmable ROM (EEPROM) has been introduced to the programmers, so that they could be used on the test-bed itself, and can be reprogrammed repeatedly.

Figure 02: EEPROM

Flash memory, used in USB drives and modern laptops as the hard drive, is a further development of EEPROM which uses the chip area very efficiently. The re-writable CDs and DVDs are also considered as an advancement of CD and DVD ROMs.

Difference Between RAM and ROM

RAM vs ROM

Data can be both stored and retrieved from RAM (Random-Access Memory). Data can be only read from ROM (Read-Only Memory).
Access
Access time is very short in RAM. The computer uses it rapidly to store frequently required data. Access time is long in ROM.  It cannot be used to read fast.
Storage
RAM is a volatile memory, so once the voltage supply is lost, the data is removed from the memory. ROM is a non-volatile memory. If it is not erasable, data remains in storage until the hardware is damaged.
Use
RAM is used in the cache and main memory of the computer since it is fast, the production cost is high and the surface area per unit memory is larger. ROMs are used to store permanent, but less-used data like software setups, once-only-used BIOS in computers since they are manufactured in larger capacities and the cost of production is lesser.

Summary – RAM vs ROM

RAM is a high-speed temporary storage for data which is used to store values which are rapidly used. In contrast, ROMs are a permanent type of memory and unlike RAMs, loss of data will not happen even though the voltage is removed. This is the key difference between RAM and ROM. ROMs are disadvantageous in use since once the firmware is written in the ROM, it cannot be altered for improvements or corrections. Therefore, ROMs are also introduced with read and write capability like RAMs. But the read/write function of RAMs is much faster than ROM.

Image Courtesy:
1.”Chip ram”By Laserlicht – Own work (CC BY-SA 3.0) via Commons Wikimedia
2.”AT24C02 EEPROM 1480355 6 7 HDR Enhancer” By © Nevit Dilmen (CC BY-SA 3.0) via Commons Wikimedia