The difference between NOR flash and NAND flash[Copy link]
1) The basic units of reading and writing flash memory chips are different The application program uses "word" as the basic unit for NOR chip operations. In order to facilitate the management of large-capacity NOR flash memory, NOR flash memory is usually divided into logical blocks of 128KB or 64KB in size, and sometimes the blocks are divided into sectors. When reading and writing, it is necessary to specify both the logical block number and the offset within the block. The application program uses "block" as the basic unit for NAND chip operations. The blocks of NAND flash memory are relatively small, generally 8KB, and each block is divided into pages, and the page size is generally 512 bytes. To modify a byte in a NAND chip, the entire data block must be rewritten. 2) NOR flash memory is a random storage medium, used in occasions with small amounts of data; NAND flash memory is a continuous storage medium, suitable for storing large data. 3) Since the NOR address line and data line are separated, the NOR chip can be connected to the data line like SRAM. The use of NOR chips is similar to that of common memory chips. Its transmission efficiency is very high, and executable programs can be executed in the chip (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. Due to this feature of NOR, NOR chips are often used as boot chips in embedded systems. NAND shares the address and data bus, and needs to connect some control inputs and outputs, so it is difficult to use NAND chips directly as boot chips. 4) NAND flash memory chips do not allow data clearing of a byte or even a block because of the shared address and data bus. They can only clear an area of a fixed size; while NOR chips can operate on words. Therefore, the speed of processing I/O operations with small data volumes must be faster than that of NAND. For example, a NOR chip usually takes 10 microseconds to write a word, so it takes 1280 milliseconds to write 512 bytes on a 32-bit bus; and the time required for NAND flash to write 512 bytes includes: 512×50 nanoseconds per byte + 10 microseconds of page seek time + 200 microseconds of chip erase time = 234 microseconds. 5) NAND flash memory has a relatively large capacity, and the current maximum capacity has reached 8G bytes. In order to facilitate management, NAND's storage space uses a two-level storage system of blocks and pages, that is, the storage space of flash memory is two-dimensional. For example, the size of the K9F5608UOA flash memory block is 16K, the size of each page is 512 bytes, and each page has 16 bytes of free area for error check code space (sometimes also called out-of-band, OOB space); when performing a write operation, NAND flash memory puts one byte of data into the internal cache each time, and then issues a "write instruction" to perform the write operation. Since the operation of NAND flash memory is based on blocks and pages, when reading and writing a large amount of data to NAND flash memory, the speed of NAND is faster than that of NOR flash memory. 6) The reliability of NOR flash memory is higher than that of NAND flash memory. This is mainly because the interface of NOR flash memory is simple, there are fewer data operations and fewer bit swap operations, so the reliability is high and bad blocks rarely appear. Therefore, it is generally used in places with high reliability requirements. On the contrary, the interface and operation of NAND flash memory are relatively complex, there are many bit swap operations, and critical data requires error detection/error correction (EDC/ECC) algorithms to ensure data integrity. Therefore, the probability of problems is much greater, and bad blocks are inevitable. Moreover, since bad blocks are randomly distributed, even error correction cannot be done. 7) NAND Flash generally shares address lines and data lines, which has a certain impact on the read and write speed; while NOR Flash has separate data lines and address lines, so the read and write speed is relatively faster. The commonality between NAND and NOR chips is that to write data to the chip, the corresponding content in the chip must be cleared first, and then written, which is usually called "erase first, then write". The only difference is that NOR chips only need to erase one word, while NAND needs to erase the entire block. Secondly, the number of times flash memory can be erased is limited. When the use of flash memory is close to its service life, write operations often fail; when the service life is reached, the data stored in the flash memory can be read, but it can no longer be written. Therefore, in order to prevent the above problems from occurring, a specific area cannot be repeatedly written. Usually, the number of times NAND can be erased is higher than that of NOR chips, but because NAND is usually erased in a whole block, if one bit in the page within the block fails, the entire block will fail, and because the erase process is complicated, the probability of failure is relatively high, so overall, NOR has a longer life. Another commonality is that the read and write operation of flash memory is not just a physical operation. In fact, the data storage in the flash memory must be implemented using an algorithm. This module is generally implemented in the MTD' (Memory Technology Drivers) module of the driver or in the FTLZ (Flash Translation Layer) layer. The specific algorithm is related to the chip manufacturer and chip model. From the perspective of use, NOR flash memory and NAND flash memory have their own characteristics: (1) NOR has a low storage density, so the cost of storing one byte is also high, while NAND flash memory has a relatively high storage density and storage capacity; (2) NAND flash memory is very fast when erasing and writing files (especially large continuous files), which is very suitable for sequential reading occasions, while NOR has a very fast reading speed and performs well in random access applications. NOR and NAND each have their own strengths, but both advantages cannot be reflected on the same chip. Therefore, when selecting a chip, designers can only take advantage of its advantages and avoid its disadvantages, and make an appropriate choice between the two according to the purpose of use and main functions.