EPROMs, EEPROMS and flash memory store data as the presence or absence of electrons in transistors at the nodes of a memory array. Electrons trapped in the floating gate of a field effect transistor signify a 1, while the lack of electrons represents a 0. The presence of electrons, or charge, in the gate establishes a voltage that allows current to be conducted through the transistor, which is detected when the node is read. Once put in the floating gate, electrons are unable to leave, meaning the memory is non-volatile. The memory can be erased electrically or by exposing it to UV light.
Erasable Programmable Read-Only Memory (EPROM), a form of non-volatile memory, was an advance over PROM for certain applications, since PROM can be written only once, while EPROM can be erased and rewritten multiple times. To erase, EPROM is exposed to UV light through a quartz window in the chip. This increases the energy of the electrons in the floating gate, allowing them to escape and resetting all bits to 1.
Electrical Erasable Programmable Read-Only Memory (EEPROM) is a non-volatile memory similar to EPROM, except that it is erased by applying a voltage pulse.
Like EEPROM, flash memory is erased by applying a voltage. The difference is that rewriting an EEPROM requires erasing the entire memory, a relatively slow process, while flash can be erased and rewritten in smaller blocks. Flash is used in memory cards, USB drives and solid state memory used in place of hard disks. Cartridges that store video games in ROM often used additional flash memory to store game data. Flash memory has a limit to how many times it can be rewritten, commonly 100,000+ cycles.
Random Access Memory (RAM) is the type of memory used in computers to store code and data to be read and written directly by the CPU. RAM is very fast, but once the computer is turned off information stored in RAM is lost. Removable media require nonvolatile storage. The only way to use RAM as removable media is to keep supplying power when the media is not plugged into the computer. This is accomplished in battery-backed RAM by building a battery into the memory device.