NAND Flash generally shares the address line and data line, which has a certain impact on the read and write speed; while the NOR Flash flash memory data line and address line are separated, so the read and write speed is relatively faster.

1) The basic unit of reading and writing of flash memory chips. Different 
 
 applications use "words" as the basic unit for NOR chip operations. In order to facilitate the management of large-capacity NOR flash memory, the NOR flash memory is usually divided into logical blocks with a size of 128KB or 64KB, and sometimes the block is also divided into sectors. It is necessary to specify the logical block number and the offset within the block at the same time when reading and writing. The operation of the application on the NAND chip is based on the "block" as the basic unit. The block of NAND flash memory is relatively small, generally 8KB, and then each block is divided into pages. 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 for occasions with a small amount of data; NAND flash memory is a continuous storage medium, suitable for storing large data. 
 
 3) Since the NOR address line is separated from the data line, the NOR chip can be connected to the data line like SRAM. The use of NOR chips is similar to that of ordinary memory chips. Its transmission efficiency is very high. The executable program can be executed in the chip (XIP, eXecute In Place), so that the application program can run directly in the flash memory without having to The code is read into the system RAM. Because of this feature of NOR, NOR chips are often used as startup chips in embedded systems. However, NAND shares the address and data bus, and need to connect some additional control input and output, so it is difficult to directly use the NAND chip as a boot chip. 
 
 4) Because of the shared address and data bus, NAND flash memory chips are not allowed to clear a byte or even a block of data, and can only clear a fixed size area; while NOR chips can operate on words. Therefore, when dealing with small data volume I/O operations, the speed should be faster than that of NAND. For example, a NOR chip usually takes 10 microseconds to write a word, then it takes 1280 milliseconds to write 512 bytes on a 32-bit bus; and the time required to write 512 bytes in NAND flash memory includes: 512×50 nanoseconds per byte + 10 microseconds Second page seek time + 200 microsecond chip erasing time = 234 microseconds. 
 
 5) The capacity of NAND flash memory is relatively large, and the current maximum capacity has reached 8G bytes. In order to facilitate management, the storage space of NAND uses a two-level storage system of block and page, which means that the storage space of flash memory is two-dimensional. For example, the size of K9F5608UOA flash memory block is 16K, and the size of each page is 512 bytes. The 16-byte free area is also used to store error check code space (sometimes called out-of-band, OOB space); NAND flash memory puts one byte of data into the internal cache at a time during write operations Area, and then issue a "write command" to write. Since operations on NAND flash memory are based on blocks and pages, NAND flash memory is faster than NOR flash memory when reading and writing a large amount of data to NAND 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, data operations are few, bit swap operations are few, so the reliability is high, there are few bad blocks, so it is generally used in Places with high reliability requirements. On the contrary, NAND-type flash memory interfaces and operations are relatively complex, and there are many bit swap operations. For critical data, error detection/error correction (EDC/ECC) algorithms are required to ensure data integrity. Therefore, the probability of problems Much larger, bad blocks are inevitable, and because bad blocks are randomly distributed, even error correction cannot be done. 
 
 7) NAND Flash generally share the address line and data line, which has a certain impact on the read and write speed; while the NOR Flash flash memory data line and address line are separated, so the read and write speed is relatively faster. 
 
 The commonality of NAND and NOR chips is first manifested in that to write data to the chip, the corresponding content in the chip must be cleared first, and then written, which is commonly referred to as "erase before write". It's just that the NOR chip only needs to erase one word, while the NAND needs to erase the entire block. Secondly, the number of flash memory erasing and writing is limited. When the use of the flash memory is close to the service life, the write operation often fails; when the service life is reached, the data stored in the flash memory can be read, but no more write operations can be performed Therefore, in order to prevent the occurrence of the above problems, it is not possible to repeatedly write to a specific area. Generally, the number of erasable times of NAND is higher than that of NOR chips, but because NAND is usually a whole block of erasing, if one of the pages in the block fails, the entire block will fail, and because the erasing process is complicated, the probability of failure is relatively high. , So on the whole, the life of NOR is longer. 
 
 Another commonality is that the read and write operation of flash memory is not just a physical operation. In fact, storing data in flash memory must be implemented by algorithms. This module is generally in the MTD (Memory Technology Drivers) module of the driver or in the FTLZ (Flash Translation Layer) module. ) In-layer implementation, the specific algorithm is related to the chip manufacturer and chip model.

From the perspective of usage, NOR flash memory and NAND flash memory have their own characteristics:

(1) The storage density of NOR is low, so the cost of storing one byte is also higher, while the storage density and storage capacity of NAND flash memory are relatively high;

(2) NAND-type flash memory is very fast in erasing and writing files (especially continuous large files), which is very suitable for sequential reading occasions, while NOR has a very fast reading speed, which can be used in random access applications. Good performance.       

 

Comparison of NAND and NOR technology

       NOR and NAND have their own strengths, but the two advantages cannot be reflected on a single chip. Therefore, when the designer chooses the chip, he can only pursue the advantages and avoid the disadvantages, and make an appropriate choice between the two according to the purpose of use and main functions.

       The general principle is: use NAND flash memory in large-capacity multimedia applications, and use NOR flash memory in data/program storage applications. According to this principle, designers can also combine the two types of flash memory chips, use NOR chips to store programs and NAND chips to store data, so that the advantages of the two types of flash memory are complementary. In fact, this clever design has been widely used in mobile phones, PocketPC, PDA, and electronic dictionaries.

      When choosing a storage solution, designers must weigh a variety of factors in order to obtain a higher cost performance. Take mobile phones as an example. NOR flash memory that supports XIP technology can run OS directly. The speed is very fast, which not only simplifies the design, but also reduces the cost. Therefore, many mobile phones adopt the design of NOR+RAM. The disadvantage of NOR flash memory is its low storage density, so there are also designs with NAND+RAM. For these two solutions, it is difficult to say which one is better, because we cannot leave the specific product and simply evaluate from one aspect. Mobile phones pursuing compact and elegant will need NOR flash memory support; mobile phones pursuing large storage capacity will choose more NAND flash memory; mobile phones pursuing functions and speed will adopt the design of NOR + NAND + RAM. This design that learns from each other can play NOR and NAND's respective advantages.

        In addition to factors such as speed and storage density, designers also need to consider many issues such as interface design, plug-and-play design and drivers when choosing flash memory chips, because the two types of flash memory also have many differences in the above-mentioned aspects. For example, in terms of drivers, NOR device running code does not require any software support, while the same operation on NAND devices requires the support of storage technology driver (MTD). Although both NAND and NOR devices require MTD for writing and erasing operations, it is more difficult for NAND to develop drivers, because the error correction and bad block processing functions of NAND flash memory need to be implemented by drivers.

Usability difference

The difference in usability is also inseparable from the architectural design of NOR and NAND. First of all, in terms of interface, the design of NOR has obvious characteristics of traditional flash memory, so the actual application is relatively new and complex than NAND. O design is much easier. Moreover, when using NAND flash memory, the driver must be written first before other operations can be continued.

Secondly, in terms of the ability to repeatedly erase and write, each block of NAND can be erased and written for between 100,000 and 1 million times, while NOR is only 1/10 of it, and the capacity of each erase block of NAND is only 1/8 to 1/2 of NOR, which indicates that the frequency of erasing and writing of each block is less than that of NOR flash memory, which helps to extend the service life. In terms of data retention time, both are similar, at the level of 10 years.

However, due to the series-connected architecture, NAND transistors are more likely to have an impact, turning logic 0 into logic 1, and it is also difficult to find faulty transistors. This phenomenon can be called bit-flipping. It is necessary to use EDC/ECC (error detection code/error correction code) for correction, and NOR problems in this area rarely occur.

In addition, NAND still has the problem of bad block management in use. In NAND flash memory, because bad blocks are randomly distributed, it is necessary to scan and mark the bad blocks, just like dealing with bad sectors in a hard disk. In current products, up to 80 bad blocks can be allowed. The existence of bad blocks makes writing information to NAND flash memory require considerable skill, because designers must never write to bad blocks, which means that virtual mapping must be performed on NAND flash memory from beginning to end.

In terms of the degree of software support, a distinction should be made between basic read/write/erase operations and higher-level software for disk emulation and flash management algorithms, including performance optimization.

Running code on NOR flash memory does not require any software support. When performing the same operation on NAND flash memory, a driver is usually required, that is, the memory technology driver (MTD). NAND and NOR flash memory are written and erased. Both require MTD.

When using NOR flash memory, the MTD required is relatively less. Many manufacturers provide more advanced software for NOR flash memory, including M-System's TrueFFS driver, which is used by Wind River System, Microsoft, QNX Software System, Symbian And Intel and other manufacturers.

Guess you like

Origin blog.csdn.net/qq_25814297/article/details/109285917