Key difference: RAM is volatile and used for both read and write. ROM is non-volatile and only used for reading. Memory on the RAM is erased when the computer is switched off.
Both Random-Access Memory (RAM) and Read-Only Memory (ROM) are primary storage devices used in electronics, most commonly in computers. Primary data storage devices store data that is required by the computer to execute operations. RAM is a part of hardware that stores operating system’s application programs and currently running processes. ROM, on the other hand, stores critical programs which are used for the basic computer commands, such as start-up. Both types of memory allow random access, so in order to be precise, RAM should be referred to as read/write RAM and ROM as read-only RAM. The comparison between RAM and ROM is as follows:
RAM: Random-Access Memory is a volatile memory used for data storage on a computer. The name states the memory can be accessed in a random order, without having to alter or read other data. This stores data that is used by programs, however once the computer is shut down, the data is wiped out. RAM operates much faster that ROM. It comes in the form of microchips of different sizes such as 256MB, 512MB, 1GB, 2GB etc. Computers are designed, so that RAM can be increased up to a certain capacity.
RAM has two types: Static RAM (SRAM) or Dynamic RAM (DRAM). In SRAM, data is held in a flip-flop form, where each flip-flop holds a bit of memory. This data does not need constant refreshing is fairly faster than DRAM, however it is expensive and is only used as a cache in a PC. DRAM has memory cells paired with a transistor and capacitor requiring constant refreshing.
ROM: Read-Only Memory is a type of non-volatile storage system in a PC. Every computer comes fitted with this memory that holds instructions for starting up the computer. ROM stores critical programs, such as the program that boots the computer and performs diagnostics. Data stored in ROM cannot be easily rewritten or modified. This data is also not lost when the computer is powered down. However, ROMs operate at a much slower speed that RAM. In addition to computer, ROMs are also used in calculators and peripheral devices such as laser printers, in which ROM stores the fonts.
Different types of ROM include PROM (programmable read-only memory), EPROM (erasable programmable read only memory), EEPROM (electrically erasable programmable read-only memory) and Flash Memory, which is most commonly used to distribute firmware.