Read-Only Memory
Read-only memory holds fixed data that persists without power and can also implement any combinational function as a lookup table.
What it is
Read-only memory, or ROM, stores data that is written once and thereafter read many times. Unlike SRAM and DRAM, ROM is non-volatile: its contents survive power loss. It holds firmware, boot code, and constant tables.
Structure
A ROM is an array addressed by input lines. A decoder selects one word from the address, and that word's stored bits appear on the outputs. The stored pattern is fixed by the array's wiring or by programmed cells.
ROM as logic
Because a ROM outputs a stored value for every input address, it can implement any combinational function: put the truth table's output rows into the ROM and drive the address with the function's inputs. This makes ROM a general way to realize logic, related to how an FPGA lookup table works.
Varieties
Mask ROM is fixed at manufacture. PROM is programmed once by the user. EPROM and EEPROM can be erased and reprogrammed, by ultraviolet light or electrically, and flash memory is a dense, electrically-erasable descendant used widely for non-volatile storage.
Uses
ROM stores the initial code a processor runs at power-up, constant data such as character fonts and lookup tables, and the microcode of a control unit.