NAND and NOR flash detailed explanation[Copy link]
"Flash memory" is often used interchangeably with "NOR memory". Many industry insiders are also confused about the advantages of NAND flash technology over NOR technology, because in most cases flash is only used to store a small amount of code, in which case NOR flash is more suitable. NAND is an ideal solution for high data storage density. The feature of NOR is on-chip execution (XIP, eXecute In Place), so that the application can run directly in the flash memory without having to read the code into the system RAM. NOR has high transmission efficiency and is very cost-effective at small capacities of 1 to 4MB, but its low write and erase speeds greatly affect its performance. The NAND structure can provide extremely high cell density, can achieve high storage density, and has fast write and erase speeds. The difficulty in applying NAND lies in the management of flash and the need for special system interfaces.
Performance comparison Flash flash is non-volatile memory that can erase and reprogram blocks of memory cells called blocks. The write operation of any flash device can only be performed in empty or erased cells , so in most cases, an erase must be performed before a write operation. It is very simple for NAND devices to perform erase operations, while NOR requires that all bits in the target block be written to 0 before erasing . Since erasing NOR devices is performed in blocks of 64 to 128KB, it takes 5 seconds to perform a write/erase operation. In contrast, erasing NAND devices is performed , and the same operation only takes 4ms at most. The difference in block size when performing erases further widens the performance gap between NOR and NAND. Statistics show that for a given set of write operations (especially when updating small files), more erase operations must be performed in NOR-based cells. Thus, when choosing a storage solution, designers must weigh the following factors. ● NOR has a slightly faster read speed than NAND. ● NAND has a much faster write speed than NOR. ● NAND's 4ms erase speed is much faster than NOR's 5s. ● Most write operations require an erase operation first. ● NAND's erase unit is smaller, and the corresponding erase circuit is less.
Interface Differences NOR flash has an SRAM interface and has enough address pins to address, making it easy to access every byte inside it. NAND devices use complex I/O ports to access data serially, and the methods of each product or manufacturer may vary. Eight pins are used to transmit control, address, and data information. NAND read and write operations use 512-byte blocks, which is a bit like hard disk management of such operations. Naturally, NAND-based memory can replace hard disks or other block devices.
Capacity and Cost NAND flash has a cell size of almost half that of NOR devices. Due to the simpler production process, NAND structure can provide higher capacity within a given die size, which reduces the price accordingly. NOR flash occupies most of the market for flash memory with a capacity of 1 to 16MB, while NAND flash is only used in products with a capacity of 8 to 128MB. This also shows that NOR is mainly used in code storage media, and NAND is suitable for data storage. NAND has the largest market share in CompactFlash, Secure Digital, PC Cards, and MMC memory cards.
Reliability and Durability A key issue to consider when using flash media is reliability. Flash is a very suitable storage solution for systems that need to extend MTBF. The reliability of NOR and NAND can be compared in three aspects: life (durability), bit swapping, and bad block handling. Life (durability) The maximum number of erases per block in NAND flash is one million, while NOR can erase and write 100,000 times. In addition to the 10:1 block erase cycle advantage of NAND memory, the typical NAND block size is 8 times smaller than that of NOR devices, and each NAND memory block can be erased fewer times in a given time. Bit Swapping All flash devices are plagued by the phenomenon of bit swapping. In some cases (rarely, and more often in NAND than NOR), a bit will flip or be reported as flipped . The change of a single bit may not be obvious, but if it happens to a critical file, this small failure can cause the system to shut down. If it is just reported as a problem, a few more reads may solve it. Of course, if the bit does change, error detection/error correction (EDC/ECC) algorithms must be used. Bit reversal is more common in NAND flash memory. NAND vendors recommend using EDC/ECC algorithms when using NAND flash memory. This problem is not fatal when using NAND to store multimedia information. Of course, if local storage devices are used to store operating systems, configuration files, or other sensitive information, EDC/ECC systems must be used to ensure reliability. Bad Block Handling Bad blocks in NAND devices are randomly distributed. There have been efforts to eliminate bad blocks in the past, but it was found that the yield was too low and the cost was too high to be cost-effective. NAND devices require an initial scan of the media to find bad blocks and mark them as unusable. In manufactured devices, if this processing cannot be performed reliably, it will result in a high failure rate.
Easy to use NOR-based flash memory can be used very directly. It can be connected like other storage and code can be run directly on it. NAND is much more complicated because it requires an I/O interface. The access method of various NAND devices varies from manufacturer to manufacturer. When using NAND devices, drivers must be written before other operations can be performed. Writing information to NAND devices requires considerable skill, as designers must never write to bad blocks, which means that virtual mapping must be performed throughout on NAND devices.
Software Support When discussing software support, one should distinguish between basic read/write/erase operations and higher-level software for disk emulation and flash management algorithms, including performance optimization. Running code on NOR devices does not require any software support. When performing the same operations on NAND devices, a driver is usually required, namely the memory technology driver (MTD ). Both NAND and NOR devices require MTD for write and erase operations. Relatively fewer MTDs are required when using NOR devices. Many vendors provide more advanced software for NOR devices, including M-System's TrueFFS driver, which The driver is used by manufacturers such as Wind River System, Microsoft, QNX Software System, Symbian and Intel. The driver is also used to emulate DiskOnChip products and manage NAND flash memory, including error correction, bad block handling and wear leveling.