Flash memory is a form of nonvolatile data storage device based on the principles first used in EPROM devices. Flash comes in a number of form factors and interfaces, as well as a number of underlying technologies.
Flash consists of a number of identical cells. Each cell uses the fact that an isolated spot of dopant on an integrated circuit can hold a charge for a long time; even up to many years. EPROM works in a similar way; during programming, hot electrons are injected, through an insulating region, into the storage cell, where they are trapped. The charge in the cell can be detected by means of a field effect transistor placed just below the cell.
In an EPROM, the only way to return the trapped electrons to the substrate is to expose the chip to ultraviolet light, which generates charge carrier pairs in the normally insulating medium, rendering it conducting. In a Flash memory, a similar effect can be produced by applying an erase voltage to a row of electrodes around the cell.
Flash memory has the general characteristic that it can be read relatively rapidly, on the order of a few nanoseconds; however write cycles are much slower, being on the order of a few microseconds, and erase cycles are slower still, in some cases taking up to a second or so. Flash devices also have a limited lifespan, despite lacking moving parts. The injection of hot electrons damages the crystalline structure of the silicon gradually; most Flash devices have a lifespan of approximately ten thousand erases.
Flash memory is available in a variety of underlying technologies, the most common being NOR and NAND. NOR Flash basically presents the same interface as an EPROM, most chips conforming to a standard known as CFI, the Common Flash Interface. CFI is popular because microprocessors can execute code directly from CFI flash, which means that CFI Flash can be used as a bootstrap. NOR flash is available in single-bit-per-cell and dual-bit-per-cell variants. Intel StrataFlash and AMD MirrorBit are examples of dual-bit-per-cell NOR Flash.
NOR devices drive their cells deeply into saturation in order to ensure data integrity over long periods of time. This means that while they do not require ECC, they are quite slow to write and very slow to erase. NAND Flash is very different. It uses small cells, driven only slightly into saturation. Typically NAND Flash will erase in a few milliseconds, will erase in small segments (typically 8 kilobytes at a time, as opposed to most NOR devices which have erase regions of 128 kilobytes) and can be rewritten up to a hundred thousand times before wearing out. NAND Flash has typically eight times the density of NOR Flash. The price that NAND Flash pays for this flexibility is that it is extremely error prone and absolutely requires the use of an error correction scheme. NAND Flash devices provide an out of band area in which to store checksums and other FEC data. Microprocessors cannot generally boot out of NAND Flash unless they are specifically designed to do so.
As erasing a Flash device wears it out, and Flash devices are generally not erased all at once, but rather a block at a time, a number of schemes for extending the lifespan of Flash devices by evening out the wear are in use. Counted wear levelling is the most sophisticated, maintaining a count of the number of times each block has been erased, and moving static data into frequently-erased blocks. Block rotation and block shuffling are simpler variants, suitable for lightly-used Flashes.
Most consumer contact with Flash comes in the form of memory cards. SmartMedia cards are simply NAND Flash chips in a card form factor. CompactFlash cards consist of one or a number of NAND Flash parts connected to an ASIC that provides ECC and wear levelling functionality, as well as presenting an ATA interface. Most PC motherboards have a NOR Flash for holding their BIOS firmware. Flash is, as HP marketing literature had it, the saver of the Universe.