US 20050213393 A1 Abstract Memory cells are programmed and read, at least M=3 data bits per cell, according to a valid nonserial physical bit ordering with reference to a logical bit ordering. The logical bit ordering is chosen to give a more even distribution of error probabilities of the bits, relative to the probability distributions of the data error and the cell state transition error, than would be provided by the physical bit ordering alone. Preferably, both bit orderings have 2
^{M}−1 transitions. Preferably, the logical bit ordering is evenly distributed. The translation between the bit orderings is done by software or hardware. Claims(42) 1. A method of storing N bits of data, comprising the steps of:
(a) providing ┌N/M┐ cells, wherein M is at least 3; and (b) programming each cell with up to M of the bits according to a valid physical bit ordering, and according to a logical bit ordering that is different from said physical bit ordering and that distributes error probabilities of said up to M bits more evenly than said physical bit ordering. 2. The method of 3. The method of (c) reading said N bits from said cells. 4. The method of 5. The method of 6. The method of ^{M}−1. 7. The method of 8. The method of 9. The method of 10. The method of 11. The method of 12. The method of 13. A memory device comprising:
(a) a memory that includes K cells; and (b) a controller operative to store N bits of data in said cells by programming each said cell with up to M=┌N/K┐ of said bits according to a valid physical bit ordering, and according to a logical bit ordering that is different from said physical bit ordering and that distributes error probabilities of said up to M bits more evenly than said physical bit ordering, wherein M is at least 3. 14. The memory device of 15. The memory device of 16. The memory device of 17. The memory device of 18. The memory device of 19. The memory device of 20. A system for storing data, comprising:
(a) a memory device that includes a memory, said memory including K cells; (b) a host of said memory device, for providing N bits of data to store; and (c) a mechanism for translating, for each said cell, up to M=┌N/K┐ of said bits, as listed in a logical bit ordering, into a corresponding entry in a valid physical bit ordering that is different from said logical bit ordering, wherein M is at least 3, said each cell then being programmed according to said entry in said physical bit ordering, said logical bit ordering distributing error probabilities of said up to M bits more evenly than said physical bit ordering. 21. The system of 22. The system of 23. The system of 24. The system of 25. The system of 26. The system of 27. The system of 28. The system of 29. A method of storing N bits of data, comprising the steps of:
(a) providing ┌N/M┐ cells, wherein M is at least 3; and (b) programming each cell with up to M of the bits according to a valid physical bit ordering, and according to an evenly distributed logical bit ordering that is different from said physical bit ordering. 30. A memory device comprising:
(a) a memory that includes K cells; and (b) a controller operative to store N bits of data in said cells by programming each said cell with up to M==┌N/K┐ of said bits according to a valid physical bit ordering, and according to an evenly distributed logical bit ordering, wherein M is at least 3. 31. A system for storing data, comprising:
(a) a memory device that includes a memory, said memory including K cells; (b) a host of said memory device, for providing N bits of data to store; and (c) a mechanism for translating, for each said cell, up to M=┌N/K┐ of said bits, as listed in an evenly distributed logical bit ordering, into a corresponding entry in a valid physical bit ordering that is different from said logical bit ordering, wherein M is at least 3, said each cell then being programmed according to said entry in said physical bit ordering. 32. A method of storing N bits of data, comprising the steps of:
(a) providing ┌N/M┐ cells, wherein M is at least 3; and (b) programming each cell with up to M of the bits according to a valid, nonserial bit ordering that distributes error probabilities of all said up to M bits substantially evenly. 33. A memory device comprising:
(a) a memory that includes K cells; and (b) a controller operative to store N bits of data in said cells by programming each said cell with up to M=┌N/K┐ of said bits according to a valid, nonserial bit ordering that distributes error probabilities of all said up to M bits substantially evenly, wherein M is at least 3. 34. A method of of storing N bits of data, comprising the steps of:
(a) providing ┌N/M┐ cells, wherein M is at least 3; and (b) programming each cell with up to M of the bits according to a valid, nonserial, error-rate-optimal bit ordering. 35. The method of 36. The method of ^{M}−1. 37. The method of 38. The method of 39. The method of 40. The method of 41. The method of 42. A memory device comprising:
(a) a memory that includes K cells; and (b) a controller operative to store N bits of data in said cells by programming each cell with up to M=┌N/K┐ of said bits according to a valid, nonserial, error-rate-optimal bit ordering, wherein M is at least 3. Description This patent application claims the benefit of U.S. Provisional Patent Application No. 60/553,798, filed Mar. 14, 2004. This patent application also claims the benefit of U.S. Provisional Patent Application No. 60/611,873, filed Sep. 22, 2004. This patent application also is a continuation-in-part of US patent application Ser. No. 11/035,807 filed Jan. 18, 2005. The present invention relates to flash memories and, more particularly, to a method of storing data in multi-bit flash cells. Flash memory devices have been known for many years. Typically, each cell within a flash memory stores one bit of information. Traditionally, the way to store a bit has been by supporting two states of the cell—one state represents a logical “0” and the other state represents a logical “1”. In a flash memory cell the two states are implemented by having a floating gate above the cell's channel (the area connecting the source and drain elements of the cell's transistor), and having two valid states for the amount of charge stored within this floating gate. Typically, one state is with zero charge in the floating gate and is the initial unwritten state of the cell after being erased (commonly defined to represent the “1” state) and another state is with some amount of negative charge in the floating gate (commonly defined to represent the “0” state). Having negative charge in the gate causes the threshold voltage of the cell's transistor (i.e. the voltage that has to be applied to the transistor's control gate in order to cause the transistor to conduct) to increase. Now it is possible to read the stored bit by checking the threshold voltage of the cell: if the threshold voltage is in the higher state then the bit value is “0” and if the threshold voltage is in the lower state then the bit value is “1”. Actually there is no need to accurately read the cell's threshold voltage. All that is needed is to correctly identify in which of the two states the cell is currently located. For that purpose it is enough to make a comparison against a reference voltage value that is in the middle between the two states, and thus to determine if the cell's threshold voltage is below or above this reference value. In recent years a new kind of flash memory has appeared on the market, using a technique conventionally called “Multi Level Cells” or MLC for short. (This nomenclature is misleading, because the previous type of flash cells also have more than one level: they have two levels, as described above. Therefore, the two kinds of flash cells are referred to herein as “Single Bit Cells” (SBC) and “Multi-Bit Cells” (MBC).) The improvement brought by the MBC flash is the storing of two or more bits in each cell. In order for a single cell to store two bits of information the cell must be able to be in one of four different states. As the cell's “state” is represented by its threshold voltage, it is clear that a 2-bit MBC cell should support four different valid ranges for its threshold voltage. Similarly, in order for a single cell to store three bits of information the cell must be able to be in one of eight different states. So a 3-bit MBC cell should support eight different valid ranges for its threshold voltage. When encoding two bits in an MBC cell via the four states, it is common to have the left-most state in We extend the above terminology and notation to the cases of more than two bits per cell, as follows. The left-most unwritten state represents “all ones” (“1 . . . 1”), the string “1 . . . 10” represents the case of only the lowest bit of the cell being written to “0”, and the string “01 . . . 1” represents the case of only the most upper bit of the cell being written to “0”. When reading an MBC cell's content, the range that the cell's threshold voltage is in must be identified correctly; only in this case this cannot always be achieved by comparing to only one reference voltage. Instead, several comparisons may be necessary. For example, in the case illustrated in The bits of a single MBC cell may all belong to the same flash page, or they may be assigned to different pages so that, for example in a 4-bit cell, the lowest bit is in page 0, the next bit is in page 1, the next bit in page 2, and the highest bit is in page 3. (A page is the smallest portion of data that can be separately written in a flash memory). Both methods are in use. While the methods of the present invention are explained here in the context of the “each bit in its own page” approach, these methods also can be applied to the case of all bits residing in the same page. As was shown above for the 2-bit MBC cell, there is more than one option in how to define the correspondence between the cell's threshold voltage states and the bit encodings they represent. Each such correspondence is equivalent to a specific ordering of the encoded bit patterns along the threshold voltage axis. We saw above that Chen and Tanaka, while disclosing very similar cell designs, used different assignments (and hence different orderings), both equally usable. The object of the current invention is to provide good orderings that are better than other orderings in some sense. At first glance, one might think that every permutation of ordering all n-bit patterns should be considered for the n-bit MBC cell. The number of permutations of N elements is equal to N! (“N Factorial”). A cell with n bits has 2 First, according to the conventions we defined above, the left-most state always corresponds to the “all ones” bit pattern. Second, assuming a design in which each bit resides in a different page, there are restrictions caused by the bits of a cell being written sequentially rather than all at once. One must remember that programming can only increase the threshold voltage of a cell, not reduce it. Reduction of the threshold voltage can only be done when erasing, but erasing can be applied only to large groups of cells (“blocks” in common terminology). Therefore, any ordering of the bit patterns that requires the threshold voltage to decrease when writing a bit to “0” cannot be used. Consider for example a 2-bit MBC cell. Suppose we selected the following order from left to right—“11”, “00”, “10”, “01”. Assume we first wrote the lower bit to “0”, so the cell was brought to the “10” state. Now we want to write the upper bit to “0”. This requires changing the threshold downward, from the state representing “10” to the state representing “00”, but as we noted above, this is impossible to do in typical flash memories. Therefore we should select our ordering of bit patterns in a way that for every legal sequence of bit programming operations, it will never be required to reduce the threshold voltage. An ordering that satisfies these two restrictions is called herein a “valid” ordering. Similarly, an assignment of bit patterns to cell's states that results in a valid ordering is called herein a “valid” assignment. It is common, in MBC flash memories that assign a cell's bits to different pages, to have a lower bit in a lower-numbered page and to require the user to write the pages in sequential order so that a lower-numbered page is written before a higher-numbered page. We use this practice in the explanations here, but one must understand that the methods of the present invention are equally applicable to other practices of assigning bits to pages and of ordering the writing of pages. One can see in -
- a. 11, 10, 00, 01 (this is what Chen used)
- b. 11, 10, 01, 00 (this is what Tanaka used)
- c. 11, 01, 10, 00
Let us find out how many legal orderings we have in each case. Consider first the 2-bit case ( Now let us move to the less trivial 3-bit cell ( We can make the calculation similarly for a 4-bit MBC cell ( The Appendices list 3-bit and 4-bit orderings along with analyses of these orderings, as described below. Appendix A lists all 315 3-bit orderings. Appendices B, C, D and E are partial lists of the 4-bit orderings. The large number of possible bit orderings for MBC cells of more than 2 bits brings up the question which is the best one to use. U.S. Pat. No. 6,046,935 to Takeuchi proposes one method of constructing a bit patterns ordering for MBC cells. There is thus a widely recognized need for, and it would be highly advantageous to have, an optimal method of ordering the bits in an MBC cell. According to the present invention there is provided a method of storing N bits of data, including the steps of: (a) providing ┌N/M┐ cells, wherein M is at least 3; and (b) programming each cell with up to M of the bits according to a valid physical bit ordering, and according to a logical bit ordering that is different from the physical bit ordering and that distributes error probabilities of the up to M bits more evenly than the physical bit ordering. According to the present invention there is provided a memory device including: (a) a memory that includes K cells; and (b) a controller operative to store N bits of data in the cells by programming each cell with up to M=┌N/K┐ of the bits according to a valid physical bit ordering, and according to a logical bit ordering that is different from the physical bit ordering and that distributes error probabilities of the up to M bits more evenly than the physical bit ordering, wherein M is at least 3. According to the present invention there is provided a system for storing data, including: (a) a memory device that includes a memory, the memory including K cells; (b) a host of the memory device, for providing N bits of data to store; and (c) a mechanism for translating, for each cell, up to M=┌N/K┐ of the bits, as listed in a logical bit ordering, into a corresponding entry in a valid physical bit ordering that is different from the logical bit ordering, wherein M is at least 3, the each cell then being programmed according to the entry in the physical bit ordering, the logical bit ordering distributing error probabilities of the up to M bits more evenly than the physical bit ordering. According to the present invention there is provided a method of storing N bits of data, including the steps of: (a) providing ┌N/M┐ cells, wherein M is at least 3; and (b) programming each cell with up to M of the bits according to a valid physical bit ordering, and according to an evenly distributed logical bit ordering that is different from the physical bit ordering. According to the present invention there is provided a memory device including: (a) a memory that includes K cells; and (b) a controller operative to store N bits of data in the cells by programming each cell with up to M=┌N/K┐ of the bits according to a valid physical bit ordering, and according to an evenly distributed logical bit ordering, wherein M is at least 3. According to the present invention there is provided a system for storing data, including: (a) a memory device that includes a memory, the memory including K cells; (b) a host of the memory device, for providing N bits of data to store; and (c) a mechanism for translating, for each cell, up to M=┌N/K┐ of the bits, as listed in an evenly distributed logical bit ordering, into a corresponding entry in a valid physical bit ordering that is different from the logical bit ordering, wherein M is at least 3, the each cell then being programmed according to the entry in the physical bit ordering. According to the present invention there is provided a method of storing N bits of data, including the steps of: (a) providing ┌N/M┐ cells, wherein M is at least 3; and (b) programming each cell with up to M of the bits according to a valid, nonserial bit ordering that distributes error probabilities of all the up to M bits substantially evenly. According to the present invention there is provided a memory device including: (a) a memory that includes K cells; and (b) a controller operative to store N bits of data in the cells by programming each cell with up to M=┌N/K┐ of the bits according to a valid, nonserial bit ordering that distributes error probabilities of all the up to Mbits substantially evenly, wherein M is at least 3. According to the present invention there is provided a method of of storing N bits of data, including the steps of: (a) providing ┌N/M┐ cells, wherein M is at least 3; and (b) programming each cell with up to M of the bits according to a valid, nonserial, error-rate-optimal bit ordering. According to the present invention there is provided a memory device including: (a) a memory tht includes K cells; and (b) a controller operative to store N bits of data in the cells by programming each cell with up to M=┌N/K┐ of the bits according to a valid, nonserial, error-rate-optimal. bit ordering, wherein M is at least 3. The first method of the present invention is a method of storing N bits of data in K=┌N/M┐ cells, with M≧3. (The notation “┌x┐” means the smallest integer that is at least as large as the real number x. For example, ┌3┐=3 and ┌3.5┐=4.) Each cell is programmed with up to M of the data bits according to a valid physical bit ordering, and according to a different logical bit ordering that provides a more even distribution of the error probabilities of all the up to M bits than would be provided by the physical bit ordering alone. This more even error distribution is relative to the probability distribution of the N data bits and relative to the probability distribution of the state errors of the cells. For example, if the bit orderings are “error-rate optimal”, in the sense defined below, then if all data bits are equally probable and all state errors are equally probable, it is shown below that a truly even distribution of the error probabilities can not be achieved; whereas other probability distributions of the data bits and of the state errors may allow a truly even distribution of the error probabilities of all the up to M bits. Indeed, at the end of the description of the preferred embodiments, an artificial example with error-rate optimal bit orderings and a truly even error distribution is presented. Preferably, the programming includes, for each cell, translating the up to M bits, as listed in the logical bit ordering, into a corresponding entry in the physical bit ordering. Preferably, the method also includes the step of reading the N bits from the cells, as the purpose of storing the N bits usually is to provide the possibility of reading the N bits. Most preferably, this reading includes, for each cell, translating an entry, in the physical bit ordering, that corresponds to the state of the cell as programmed, into a corresponding entry in the logical bit ordering. Preferably, the logical bit ordering substantially equalizes probability-weighted numbers of transitions of all the up to M bits, relative to the probability distribution of the data bits and relative to the probability distribution of the state errors. Preferably, the total number of transitions of the physical bit ordering and the total number of transitions of the logical bit ordering both are equal to 2 Preferably, the physical bit ordering is nonserial. A memory device of the present invention, for implementing the first method of the present invention, includes a memory with K cells and a controller that is operative to store N bits of data in the cells by programming each cell with up to M=┌N/K┐≧3 of the bits according to a valid physical bit ordering, and also according to a different logical bit ordering that provides a more even distribution of the error probabilities of all the up to M bits than would be provided by the physical bit ordering alone. Preferably, the controller includes a mechanism for translating between the physical bit ordering and the logical bit ordering. In one class of preferred embodiments of the memory device of the present invention, this mechanism effects the translating by executing software. In another class of preferred embodiments of the memory device of the present invention, the controller includes dedicated hardware (as opposed to a general purpose processor that executes software) for effecting the translating. Alternatively, the memory includes such dedicated hardware. Preferably, the memory is a flash memory. Preferably, the physical bit ordering is nonserial. A system of the present invention, for storing data, includes a memory device that includes a memory with K cells, and a host of the memory device that provides N bits of data to be stored in the memory device. The system also includes a mechanism for translating, for each of the K cells, up to M=┌N/K┐≧3 of the bits, as listed in a logical bit ordering, into a corresponding entry in a different valid physical bit ordering, that cell then being programmed according to that entry in the physical bit ordering. The logical bit ordering provides a more even distribution of error probabilities of all the up to M bits than would be provided by the physical bit ordering alone. In one class of preferred embodiments of the system of the present invention, the translation mechanism effects the translation by executing software. Such a translation mechanism may be included in the host, or alternatively may be included in a controller, of the memory, that is included in the memory device. In another class of preferred embodiments of the system of the present invention, the translation mechanism includes dedicated hardware. Such a translation mechanism may be included in the memory, or may be included in a controller, of the memory, that is included in the memory device. Preferably, the memory is a flash memory. Preferably, the physical bit ordering is nonserial. A special case of the first method of the present invention and of the corresponding memory device and system ignores both the probability distribution of the N data bits and the probability distribution of the cells' state errors, and just requires that the logical bit ordering be evenly distributed. The second method of the present invention also is a method of storing N bits of data in K=┌N/M┐ cells, with M≧3. Each cell is programmed with up to M of the data bits according to a valid, nonserial bit ordering that distributes the bit error probabilities of all M bits substantially evenly. Note that whether a valid physical bit ordering can achieve such an even distribution of bit error probabilities depends on the probability distribution of the N data bits and relative to the probability distribution of the state errors of the cells. The artificial example at the end of the description of the preferred embodiments is one such case. A memory device of the present invention, for implementing the second method of the present invention, includes a memory with K cells and a controller that is operative to store N bits of data in the cells by programming each cell with up to M=┌N/K┐≧3 of the bits according to a valid, nonserial bit ordering that distributes the error probabilities of all M bits substantially evenly. Preferably, the bit ordering is a physical bit ordering. Gonzalez et al., in U.S. Pat. No. 6,684,289, also teaches mapping between logical bit orderings and physical bit orderings in reading and writing a flash memory, for purposes such as wear leveling and encryption, but not for equalizing the distribution of error probabilities of the stored bits. The third method of the present invention also is a method of storing N bits of data in K=┌N/M┐ cells, with M≧3. Each cell is programmed with up to M of the data bits according to a valid, nonserial, error-rate-optimal bit ordering. The total number of transitions in the bit ordering is the minimum such number for the selected value of M, i.e., 2 Preferably, the bit ordering is evenly distributed. For example, when M=4, each bit of the bit ordering has either three transitions or four transitions. A memory device of the present invention, for implementing the third method of the present invention, includes a memory with K cells and a controller that is operative to store N bits of data in the cells by programming each cell with up to M=┌N/K┐≧3 of the bits according to a valid, nonserial, error-rate-optimal bit ordering. The invention is herein described, by way of example only, with reference to the accompanying drawings, wherein: The present invention is of a method of programming multi-bit flash cells. The principles and operation of a multi-bit-cell flash memory device according to the present invention may be better understood with reference to the drawings and the accompanying description. We now consider the question of what is a good ordering of the bit patterns in an n-bit MBC cell. There is no one clear-cut criterion to use for deciding what is “best”. Instead we present several different criteria to choose from. The best criterion to use in an actual design depends upon the requirements of the overall storage system, as is made clear in the discussion below. We base our evaluation of orderings on the number of comparison operations required for reading the bits contained in an MBC cell. As already explained above, an SBC cell requires just one comparison of its threshold voltage value against a reference in order to determine the cell's data contents. A 2-bit MBC cell may require two comparisons. Cells with more bits generally require more than two comparisons. We distinguish between two methods of using comparisons in the reading process: static reading and dynamic reading. In static reading, all reference voltage values used during the reading process are fully determined prior to starting the reading. Such reading can be implemented either by using one comparator that does all comparisons one by one by changing the reference voltage value to which it compares a cell's threshold voltage, or by using a number of comparators equal to the number of comparisons (in which case all comparators may operate in parallel). It is also possible to use an intermediate scheme in which the number of comparators is less than the number of comparisons but greater than one, thereby providing be some parallelism in the process. All such implementations are considered static methods for the purpose of this invention, as long as all reference values are fully determined prior to reading. For example, reading the lower bit of the 2-bit MBC cell whose encoding is as shown in In dynamic reading, at least one reference voltage value used during the reading process is determined based on the result of a previous comparison done during the same reading operation. For example, reading the lower bit of the 2-bit MBC cell whose encoding is as shown in The number of comparisons required for reading a single bit using static reading depends on the way the value of the bit changes when moving from state to state along the threshold voltage axis. As a first example let us consider the 2-bit MBC case with the ordering of {3,2,0,1}. In binary notation, that ordering is {11,10,00,01}. (Note that in the appended claims, decimal notation is used for bit orderings.) Now we separate the bits, each into its own sequence. When we move along the states from left to right the lower bit passes through the values {1,0,0,1} while the upper bits passes through {1,1,0,0}. It is easy to see that we can determine the value of the upper bit by just a single comparison, with the reference value positioned to separate between the two left states and the two right states. The lower bit, however, cannot be determined by any single comparison; the best we can do is to use two comparisons (one separating the left-most state from all other states, and one separating the right-most state from all other states). If, however, the ordering of states is {3,2,1,0}={11,10,01,00}, then the lower bit sequence is now {1,0,1,0} and the upper bit sequence is again {1,1,0,0}. So using this ordering the lower bit requires three comparisons and the upper bit requires one comparison. The third and last valid 2-bit ordering is {3,1,2,0}={11,01,10,00}, giving {1,1,0,0} for the lower bit and {1,0,1,0} for the upper bit. This translates to one comparison for the lower bit and three comparisons for the upper bit. It is easy to realize that the number of comparisons required for reading a single bit using static reading is equal to the number of transitions the bit incurs when traversing all states along the threshold voltage axis from left to right. {1,1,0,0} has just one transition and requires one comparison, while {1,0,1,0} has three transitions and requires three comparisons. The same rules also apply to reading a cell with more than two bits. For example, a 3-bit cell with the ordering {7,6,2,4,0,5,3,1}={111,110,010,100,000,101,011,001} produces the sequence {1,0,0,0,0,1,1,1} for the lower bit, {1,1,1,0,0,0,1,0} for the middle bit, and {1,1,0,1,0,1,0,0} for the upper bit. The numbers of transitions (and therefore the number of comparisons) are 2 for the lower bit, 3 for the middle bit and 5 for the upper bit. The number of comparisons required for reading a single bit using dynamic reading also depends on the number of transitions the bit incurs when traversing all states along the threshold voltage axis from left to right, but in a different way than for static reading. For dynamic reading, the number of comparisons is the logarithm to base two of the number of transitions plus one, rounded up. For example, for a 2-bit MBC cell with the ordering of {3,2,0,1}={11,10,00,01} and bit sequences of {1,0,0,1} (two transitions) and {1,1,0,0} (one transition), the numbers of comparisons are two and one, respectively. Note that the ordering of {3,2,1,0}={1,10,01,00} with the bit sequences of {1,0,1,0} (three transitions) and {1,1,0,0} (one transition) also results in two and one comparisons, respectively, even though its number of transitions is different. Again, the same rules also apply for cells with more than two bits each. For example, reading a 3-bit cell with the ordering {7,6,2,4,0,5,3,1}={111,110,010,100,000,101,011,001} that produces the bit sequences {1,0,0,0,0,1,1,1} (two transitions), {1,1,1,0,0,0,1,0} (three transitions), and {1,1,0,1,0,1,0,0} (five transitions), requires two, two and three comparisons, respectively. Appendix A lists all the valid orderings for the 3-bit case. Each of the 315 orderings has one line in the table, showing the sequences for each of the three bits, the number of static reading comparisons for each bit (the three columns under the heading “static comp”), and the number of dynamic reading comparisons for each bit (the three columns under the heading “dynamic comp”). Also shown are the total, minimum and maximum numbers for each of the two reading methods, statistics that are referenced in the discussion below. We now investigate several criteria for selecting the ordering of bit patterns in an MBC cell. These criteria all relate to the number of comparisons required for reading. Generally speaking, the fewer comparisons to be done the better. A higher number of comparisons implies either a longer time for completing the operation (if using a single comparator) or a larger number of comparators (or both). Criterion A. Minimize the number of comparisons for sequentially reading all the bits in a cell (that is, reading the bits one by one and not in one operation) using static reading. In a cell that uses static reading with a single comparator, the time required for sequentially reading all the bits of a cell increases as the sum of the number of comparisons of all bits. Therefore a good criterion for selecting an ordering is to minimize the sum of comparisons of all bits. Looking at the results above, we see that for the 2-bit case we get a total of three comparisons for {3,2,0,1} and four comparisons for the other two alternatives. Therefore {3,2,0,1} provides the fastest sequential reading of all bits of a cell, and is thus optimal according to this criterion. For the 3-bit case, we see in Appendix A that there are two optimal orderings with a total of seven comparisons ({7,6,4,5,1,0,2,3} and {7,6,4,5,1,3,2,0}). The encoding illustrated in For the 4-bit case, the 36 orderings listed in Appendix B are optimal according to this criterion. Each such ordering has a total of 15 comparisons. The encoding illustrated in Criterion B. Minimize the maximum number of comparisons for reading a single bit of a cell using static reading. In a cell that uses static reading with a single comparator, the maximum time required for reading any bit of a cell increases with the maximum number of comparisons of any bit. Therefore a good criterion for selecting an ordering is to minimize the maximum number of comparisons for any bit. For the 2-bit case this maximum number is two for {3,2,0,1} and three for the other two alternatives. Therefore {3,2,0,1} is optimal according to this criterion too. For the 3-bit case, Appendix A lists ten optimal orderings under this criterion, with a maximum number of comparisons of three: {7,6,2,4,5,1,3,0}, {7,6,2,4,5,3,1,0}, {7,6,4,2,3,5,1,0}, {7,6,4,0,2,3,5,1}, {7,6,4,0,5,1,3,2}, {7,6,4,5,1,3,2,0}, {7,6,5,1,3,2,4,0}, {7,5,6,2,3,1,4,0}, {7,3,6,4,5,1,2,0} and {7,3,6,4,5,1,0,2}. A complete enumeration of all valid 4-bit orderings shows that the minimum for this criterion is five comparisons. Some of these orderings are listed in Appendix B. Criterion C. Minimize the minimum number of comparisons for reading a single bit of a cell, using static reading. In a cell that uses static reading with a single comparator, the minimum time required for reading any bit of a cell increases with the minimum number of comparisons of any bit. Therefore a good criterion for selecting an ordering is to minimize the minimum number of comparisons for any bit. For the 2-bit case this minimum number is one, and is the same for all three valid orderings. For the 3-bit case Appendix A shows that the best minimum number is again one, but there are many orderings that result in a higher minimum number, meaning a slower reading operation. A complete enumeration of all valid 4-bit orderings shows that the minimum for this criterion for the 4-bit case also is one comparison. Some of these orderings are listed in Appendix B. The method of Takeuchi mentioned above results in an ordering that gives the upper bit only one comparison (note that Takeuchi uses a terminology that is the opposite of the one we use: he calls the first bit that is written into the cell “the upper bit” and not “the lower bit”. We continue to use our terminology when discussing Takeuchi method). This implies that the Takeuchi method may be considered optimal in this sense. However, the Takeuchi method is based on assigning the states in a very simple and straight-forward manner—writing the first bit brings the threshold to one of the two left-most states, writing the second bit brings the threshold to one of the four left-most states, writing the third bit brings the threshold to one of the eight left-most states, and writing the M-th bit brings the threshold to one of the 2 Such an ordering requires one comparison for the last bit to be written into the cell, three comparisons for the next-to-last bit, seven comparisons for the third bit from the end, and 2 We use herein the term “serial assignment” for referring to an assignment that results in an ordering such as Takeuchi, having the form {2 Criterion D. Achieve equal number of comparisons for reading a single bit of a cell (regardless which bit is read), using static reading. In a cell that uses static reading with a single comparator, it might be beneficial to have all bits being read using the same number of comparisons, so as to provide the same response time regardless of which bit is being read. Therefore a good criterion for selecting an ordering is to achieve the same number of comparisons for all bits. For the 2-bit case no ordering satisfies this criterion. For the 3-bit case Appendix A shows that there are four orderings in which all bits require three comparisons: {7,6,2,4,5,1,3,0}, {7,6,2,4,5,3,1,0}, {7,6,4,2,3,5,1,0} and {7,6,5,1,3,2,4,0}. Obviously, there can be no 4-bit ordering with a total of 15 comparisons in which all bits have the same number of comparisons, because 15 is not divisible by 4. Appendix C lists all 4-bit valid orderings with a total of 16 comparisons in which the difference between the lowest and highest bit is not more than two comparisons, and we see that even in this case there is no valid ordering which satisfies this optimization criterion. The best that can be achieved is a difference of two comparisons between the bit with the lowest number of comparisons and the bit with the highest number of comparisons. Actually, if there is a strong desire to get as close as possible to an equal spread of comparisons over all bits, one would do better to choose a 17-comparison 4-bit ordering. Appendix D lists all valid orderings with a total of 17 comparisons in which the difference between the lowest and highest bit is not more than one comparison, and one can see that there are really orderings in which the difference between lowest and highest is only one comparison, resulting in more constant reading response time than can be achieved with either a 15-comparison ordering or a 16-comparison ordering. Criterion E. Minimize the number of comparisons for sequentially reading all bits in a cell, using dynamic reading. This is the equivalent of criterion A, but for dynamic reading. For the 2-bit case, all valid orderings result in the same number of comparisons and therefore there is no one optimal ordering. For the 3-bit case, Appendix A shows that there is one optimal ordering ({7,6,4,5,1,3,2,0}), with a total of five comparisons. There also are many orderings with a total of six comparisons. A complete enumeration of all valid 4-bit orderings shows that the minimum for this criterion for the 4-bit case is nine comparisons. Some of these orderings are listed in Appendix B. Criterion F. Minimize the maximum number of comparisons for reading a single bit of a cell, using dynamic reading. This is the equivalent of criterion B, but for dynamic reading. For the 2-bit case, all valid orderings result in the same number of comparisons (two) and therefore there is no one optimal ordering. For the 3-bit case, Appendix A shows that there are ten optimal orderings with a maximum number of comparisons of two: {7,6,2,4,5,1,3,0}, {7,6,2,4,5,3,1,0}, {7,6,4,2,3,5,1,0}, {7,6,4,0,2,3,5,1}, {7,6,4,0,5,1,3,2}, {7,6,4,5,1,3,2,0}, {7,6,5,1,3,2,4,0}, {7,5,6,2,3,1,4,0}, {7,3,6,4,5,1,2,0} and {7,3,6,4,5,1,0,2}. A complete enumeration of all valid 4-bit orderings shows that the minimum for this criterion for the 4-bit case is three comparisons. Some of these orderings are listed in Appendix B. Criterion G. Minimize the minimum number of comparisons for reading a single bit of a cell, using dynamic reading. This is the equivalent of criterion C, but for dynamic reading. For the 2-bit case, all valid orderings result in the same minimum number of comparisons (one) and therefore there is no one optimal ordering. For the 3-bit case, Appendix A shows that the best minimum number is again one, but there are many orderings that result in a higher minimum number, meaning a slower reading operation. A complete enumeration of all valid 4-bit orderings shows that the minimum for this criterion for the 4-bit case is one comparison. Some of these orderings are listed in Appendix B. Criterion H. Achieve equal number of comparisons for reading a single bit of a cell (regardless which bit is read), using dynamic reading. This is the equivalent of criterion D, but for dynamic reading. For the 2-bit case no ordering satisfies this criterion. For the 3-bit case, Appendix A shows that there are nine orderings in which all bits require two comparisons: {7,6,2,4,5,1,3,0}, {7,6,2,4,5,3,1,0}, {7,6,4,2,3,5,1,0}, {7,6,4,0,2,3,5,1}, {7,6,4,0,5,1,3,2}, {7,6,5,1,3,2,4,0}, {7,5,6,2,3,1,4,0}, {7,3,6,4,5,1,2,0} and {7,3,6,4,5,1,0,2}. Appendix E lists some valid 4-bit orderings for which the difference between the largest number of comparisons and the smallest number of comparisons is 1. One point of clarification should be added to the definition of the concept of valid allocations and valid orderings. It is assumed above that any intermediate step resulting from programming only some of the bits of a cell (but not all) is identical to the state that would be created if the still not written bits will be written as “1”. In other words, programming the last bits of a cell to “1” is actually “doing nothing” but keeping the cell's state unchanged. This is really a convenient way to implement the cell, and this is how typical MBC cells are currently built. However, it is possible to design an MBC cell a bit differently. If we assume the cell is always programmed with the full number of bits it can store, we can rely on the last programming operations to shift the state (the threshold voltage) even if a “1” is to be programmed. This means, for example, that a 4-bit MBC that was programmed with three “0” bits and is waiting to be programmed with the fourth bit will have a different state than the same cell after being programmed with “0001”. In such a design either we do not allow not programming all bits, or we devise a different reading scheme for reading cells that were not “filled” with all bits. It should be understood that all the methods of the first implementation of the present invention are equally applicable to the second implementation, except that the validity of an allocation or ordering must be checked against its specific transition rules and not against Criteria A-H relate to performance issues. However, it may be the case that reliability issues are much more important than performance. In such case one should optimize the selection of the allocation and encoding according to its influence on the number and distribution of expected bit errors when reading the data stored in the cell. The following embodiment of the present invention attains this end. When reading the values of the bits previously stored in an MBC cell we are attempting to find out in which of the voltage bands is the cell located. After the band is found, it is converted into the corresponding bits represented by that band according to the allocation and ordering used when writing the cell. It might happen that an error had occurred and the cell's state was changed since it was written. The most common source of such an error in a flash cell is the leakage of electrons stored in the cell's floating gate. This will typically result in the threshold voltage of the cell shifting a bit, resulting in the cell moving from the band it was written into to another band. There are also other error mechanisms in flash cells, for example disturbances of various kinds (e.g write disturb, read disturb) in which an operation that is not intended to change the state of a certain cell unintentionally changes the state of that cell because of side-effects of the signals and voltages applied to neighboring cells or to the same cell. Extensive tests of statistics of flash MBC errors have shown that the overwhelming majority of errors involve the shift of the cell's state by one band along the voltage axis. For example, assuming the 2-bit MBC of Let us investigate the effect of such an error in which a cell is read in a different state than the one it was written in. We start with the simple case of the 2-bit MBC of The above argument could lead us to the conclusion that each error in reading the cell's state results in one bit being wrong. However, this is an incorrect conclusion. Let us examine a 2-bit MBC using the ordering of Tanaka ({ Let us now look at the more complicated case of a 4-bit MBC. Consider a 4-bit cell using the serial ordering of {15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0}. Suppose the cell was written as “0” and read as “1”. This means we wrote “0000” and read “0001”. So the lowest bit is in error but the other three bits are still correct. One state error was translated into one bit error. This seems a good result, so is this specific ordering a good one? Suppose now the cell was written as “1” and read as “2”. This means we wrote “0001” and read “0010”. So now the two lowest bits are in error, while the two upper bits are correct. One state error was translated into two bit errors. This certainly raises questions about the optimality of this ordering, so let us continue the analysis. Suppose the cell was written as “3” and read as “4”. This means we wrote “0011” and read “0100”. Now all three lowest bits are in error, leaving only the upper bit correct. One state error was translated into three bit errors, certainly not a good result. But we are not finished yet. Suppose the cell was written as “7” and read as “8”. This means we wrote “0111” and read “1000”. Now all four bits are incorrect. One state error was translated into four bit errors, showing that the serial ordering is not a good one when considering the storage bit error rate. To see that such “error amplification” is not inevitable and there really are orderings that are better than the serial ordering, let us return to the {15,14,12,13,9,8,10,11,3,2,0,4,6,7,5,1} ordering already mentioned above. By trying out each and every one-state-away error we verify the following fact: each state error results in exactly one bit error. Let us write down all the possible state transitions to show this fact: -
- i. 15<-->14, “1111”<-->“1110”, only lowest bit affected
- ii. 14<-->12, “1110”<-->“1100”, only second lowest bit affected
- iii. 12<-->13, “1100”<-->“1101”, only lowest bit affected
- iv. 13<-->9, “1101”<-->“1001”, only second highest bit affected
- v. 9<-->8, “1001”<-->“1000”, only lowest bit affected
- vi. 8<-->10, “1000”<-->“1010”, only second lowest bit affected
- vii. 10<-->11, “1010”<-->“1011”, only lowest bit affected
- viii. 11<-->3, “1011”<-->“0011”, only highest bit affected
- ix. 3<-->2, “0011”<-->“0010”, only lowest bit affected
- x. 2<-->0, “0010”<-->“0000”, only second lowest bit affected
- xi. 0<-->4, “0000”<-->“0100”, only second highest bit affected
- xii. 4<-->6, “0100”<-->“0110”, only second lowest bit affected
- xiii. 6<-->7, “0110”<-->“0111”, only lowest bit affected
- xiv. 7<-->5, “0111”<-->“0101”, only second lowest bit affected
- xv. 5<-->1, “0101”<-->“0001”, only second highest bit affected
It is important to understand that what we are comparing are different orderings over the same physical cells. The physical phenomena which are the source of the errors are not affected by how we interpret the states to represent bits. The number of cells that end up being in an incorrect state is dictated by the laws of physics and not by the bit assignments. Nevertheless, the same physical fact of a given number of erroneous cells translates into different numbers of erroneous bits depending on the way the bits were allocated to the physical states. So a flash memory designer has an influence on the bit error rate of the data and can reduce the number of bit errors using an appropriately optimized bit allocation. As it is obvious that each error in a cell's state must generate at least one bit error (or otherwise two different states would represent exactly the same bits), we conclude that the above {15,14,12,13,9,8,10,11,3,2,0,4,6,7,5,1} ordering is optimal in this sense. We define an ordering to be “error-rate optimal” if it satisfies the condition that every error in reading the cell's state that results in reading an incorrect state that is one state away from the correct state generates exactly one bit error. It is easy to identify such an ordering: when looking at the ordering as a sequence of binary numbers, the difference between any two directly adjacent numbers is limited to one bit position. Any ordering satisfying this condition is error-rate optimal, and any ordering that is error-rate optimal must have this feature. This type of binary coding is well known in the mathematical literature and is called a “Gray code”, after the inventor of U.S. Pat. No. 2,632,058, which patent is incorporated by reference for all purposes as if fully set forth herein. There is another way to look at the above error rate optimality condition that is sometimes easier to work with, based on the notion of “transitions” as defined above. As we saw above, the number of bit errors generated in a certain bit position of a cell depends on the way the value of the bit changes when moving from state to state along the threshold voltage axis. As a first example let us consider the 2-bit MBC case with the ordering of {3,2,0,1}. Writing that same ordering using binary notation provides {11,10,00,01}. Now we separate the bits, each into its own sequence. When we move along the states from left to right the lower bit passes through the values {1,0,0,1} while the upper bits passes through {1,1,0,0}. It is easy to see that whenever there is a transition in the sequence of a bit, this bit will be in error if a state error occurs at that position. For example, if a state error moves this 2-bit cell between the second and third states, the lower bit will not be in error (no transition at this point in {1,0,0,1}) but the upper bit will be in error (there is a transition at the middle of {1,1,0,0}). Similarly, let us look at a 3-bit cell with the ordering {7,6,2,4,0,5,3,1}={111,110,010,100,000,101,011,001} that produces the sequence {1,0,0,0,0,1,1,1} for the lower bit, {1,1,1,0,0,0,1,0} for the middle bit, and {1,1,0,1,0,1,0,0} for the upper bit. A state error between the third and fourth states from the right results in bit errors in both the lower and upper bits but not in the middle bit, as there are transitions at this point at the lower and upper bits sequences but not at the middle bit sequence. The implication of this is that location of transitions in the sequence of a bit position determines if it will incur an error upon a state error at that position. If we assume that all the states of a cell are equally likely to occur when the cell is used (in other words—we have no prior knowledge of the data stored in the cells) and also that the state errors in both directions (right and left) are approximately equally likely to occur, then we can conclude that the probability of an error in a certain bit is directly proportional to the number of transitions along its sequence. Also, the total probability of a bit error in any bit position is directly proportional to the total number of transitions in all the bit sequences together. This leads to the conclusion that the lower the total number of transitions, the better is the ordering from the bit errors point of view. As we previously concluded that an optimal ordering generates exactly one bit transition from each state transition, an equivalent condition for an ordering to be optimal is that the total number of bit transitions is equal to the number of states minus one. For a 3-bit MBC this means the total number of transitions is 7, and for a 4-bit MBC this means the total number of transitions is 15. To summarize—an ordering is error-rate optimal if and only if its total number of transitions over all bit positions is equal to the number of states of the cell minus one. It is interesting to note that the above error rate optimality condition is equivalent to performance optimality criterion A, the minimization of the number of comparisons for sequentially reading all bits in a cell using static reading. Any ordering that is optimal according to that criterion is also optimal according to the bit error rate criterion, and vice versa. From Appendix A one can see there are only two valid orderings that are error-rate optimal for a 3-bit MBC: {7,6,4,5,1,0,2,3} and {7,6,4,5,1,3,2,0}. For the 4-bit MBC case one can see by complete enumeration of all valid orderings that there are 36 valid orderings that are error-rate optimal, as listed in Appendix B. We showed above that the 4-bit ordering of {15,14,12,13,9,8,10,11,3,2,0,4,6,7,5,1} is optimal for bit errors reduction. If we take 15 cells of 4 bits each using that ordering and cause each one of them to exhibit one of the 15 possible state errors (for this purpose we consider errors of crossing the same boundary between states to be the same, regardless if the crossing is left-to-right or right-to-left), the total number of bit errors in all cells will be 15, which is the lowest number possible. Let us look at which bit positions (out of the 4 bit positions of the cells) these 15 bit errors appear. We already listed above which one of the 4 bits of the cell is affected upon each of the state errors. We see that the lowest bit suffers an error in 6 of the cases, the second lowest bit in 5 of the cases, the second highest bit in 3 of the cases, and the highest bit in one case. This means that the distribution of the bit errors between the bit positions is not even, so that some bit positions encounter many more errors than others. Consider the case in which each bit position of a 4-bit MBC belongs to a different logical page. Suppose the flash memory architecture is based on groups of 15,000 cells each storing 4 bits, so each group stores 4 pages of 15,000 bits. Suppose further that the probability of a state error is 1 in 1,000, that is—on average one cell out of each 1,000 cells will be read in an incorrect state. If the ordering used is error-rate optimal, each state error generates exactly one bit error and therefore the bit error rate is also 1 per 1,000 cells and there will be on average 15 bit errors when reading the full group. However, the distribution of those 15 bit errors is not even—instead of each of the 4 pages including 15/4=3.75 errors on average, we have one page with 15*6/15=6 errors, one page with 15*5/15=5 errors, one page with 15*3/15=3 errors, and one page with 15*1/15=1 error (again, we assume here all state errors are equally likely to occur). At first thought one might say this uneven distribution is not important—after all why should we care where are the errors located if their total number is the same. But suppose that we have to design Error Correction Code (ECC) circuitry for correcting the errors in the data read from the flash memory. As a page is the unit of data that is read at one time, the correction circuitry should be designed to handle one page at a time. If the errors were distributed evenly among the pages residing in the same cells then the expected error rate when reading each single page (specified in bit errors per bits read) would be the same as the expected error rate calculated over the 4 pages together. In the above example this results in 3.75 bit errors per each page of 15,000 bits. But if the errors are distributed as in the {15,14,12,13,9,8,10,11,3,2,0,4,6,7,5,1} ordering, we have different error rates for different pages: one page with an average of 6 errors, one page with an average of 5 errors, one page with an average of 3 errors, and one page with an average of 1 error. The expected average of bit errors is a most crucial factor in the design of ECC circuitry. The larger the number of expected errors, the more redundancy is needed for storing extra parity or check bits, and the more complex is the circuitry for both encoding and decoding the stored bits. When working with relatively high error rates (1 per 1,000 and higher) the dependency of ECC complexity and redundancy cost, on the error rate is quite significant, and it is highly advantageous if one can somehow reduce the bit error rate one has to protect against. Therefore, from the ECC design point of view the two cases of even and uneven errors distribution among the pages are very much different. In the even case the design has to protect against an expected average number of 3.75 errors per page, while in the uneven case the design must protect against an expected average number of 6 errors per page, which is a much more difficult and costly task. The bottom line of all this is that while the error-rate optimal ordering {15,14,12,13,9,8,10,11,3,2,0,4,6,7,5,1} is an optimal ordering when looking at the total number of errors, it is not optimal when looking at each page separately. In order to satisfy both optimality criteria we need to find a valid ordering that satisfies the following two conditions: -
- a. The total number of transitions is the lowest possible. In other words, the ordering is error-rate optimal.
- b. Those transitions are evenly spread over the different bit positions.
For the 3-bit MBC case the minimal number of transitions is 7. Unfortunately 7 is not divisible by 3, so there is no way to achieve an optimal overall error rate with completely even distribution. The best we can hope for is an ordering with one bit having 3 transitions and the other two bits having two transitions each. For the 4-bit MBC case the minimal number of transitions is 15. Unfortunately 15 is not divisible by 4, so there is no way to achieve an optimal overall error rate with completely even distribution. The best we can hope for is an ordering with one bit having 3 transitions and the other 3 bits having 4 transitions each. Returning to our previous example, such ordering will result in one page having 3 errors and 3 pages having 4 errors, as compared with overall average of 3.75 errors per page. We define an ordering to be “evenly distributed” if the ordering results in the number of transitions of any bit position being different from the number of transitions of any other bit position by no more than one transition. Appendix A lists all valid orderings of the 3-bit MBC case. We already mentioned above only two of these orderings are error-rate optimal. However we find out neither of these two satisfies the even distribution requirement. { Appendix B lists all valid 4-bit orderings that are error-rate optimal. There are 36 of those. Again we realize none of them is evenly distributed, or even close to evenly distributed. The most evenly distributed orderings have a distribution of (5,5,4,1) transitions, and this is very far from our goal. One could wonder why we can't find an ordering that has the minimal number of transitions but is more evenly distributed. Indeed, Appendix F lists some 3-bit orderings which have a (3,2,2) distribution. Appendix G lists some 4-bit orderings which have a (4,4,4,3) distribution. However, not a single one of these evenly-distributed orderings is valid, and therefore none of them can be used for representing bit encodings in the MBC. Recalling from above, a non-valid ordering is one in which there are cases in which a bit cannot be written because writing the bit would require moving the cell's threshold to the left (i.e. lowering the threshold voltage), which is not possible. For example, the 4-bit ordering {15,11,3,1,0,2,6,14,10,8,9,13,12,4,5,7} is shown in Appendix G to have a distribution of (4,4,4,3). However, suppose we have to write a value of “0000” into a cell, one bit at a time. In order to achieve this, we first have to program the lowest bit (getting to an intermediate value of “1110”=“14”), then program the second lowest bit (getting to an intermediate value of “1100”=“12”), then program the second highest bit (getting to an intermediate value of “1000”=“8”), and then finally program the highest bit and get to our desired value of “0000”. In the third stage of this sequence the cell should move from state “12” to state “8”. In the last stage of this sequence the cell should move from state “8” to state “0”. But state So we see we are facing a dilemma. On the one hand we wish to use an ordering that is both error-rate optimal and evenly distributed, while on the other hand we need to use a valid ordering, and there is no ordering satisfying both requirements. The following aspect of the present invention allows us to achieve the goals of error-optimal and even distribution without violating the validity requirement imposed by the cell's physical method of operation. The solution is based upon a distinction to be made between the physical representation of the bits in the cells and their logical meaning as interpreted by the user of the data. The validity restriction is imposed by the physical level, while the error rate restriction is imposed by the logical level. Therefore we solve the seemingly contradictory requirements by using a different ordering at the logical level than at the physical level. When physically storing the bits into the cells (physical level) we use an ordering that is valid and is also error-rate optimal, but is not necessarily evenly distributed. When inputting and outputting data to/from the flash memory (logical level) we use an ordering that is evenly distributed and also error-rate optimal, but is not necessarily valid. We establish a one-to-one mapping between the two orderings and switch between them before accessing the cells for writing or after accessing the cells for reading. The method is best understood with reference to a specific example. Assume we choose {15,14,12,13,9,8,10,11,3,2,0,4,6,7,5,1} as our physical-level ordering and {15,11,3,1,0,2,6,14,10,8,9,13,12,4,5,7} as our logical-level ordering. The following table shows the correspondence between the two levels, and is used as a translation table for both writing and reading, as will be explained below. The left column of the table lists each of the physical states the cell can be in, starting from the left-most state number 15 (representing the erased state) up to the right-most state number 0 having the highest threshold voltage. Actually this column is not required for using the table, but is shown for clarity. The center column of the table is titled “Logical level interpretation” and shows how the logical level ordering is matched to the physical states of the cell. The right column of the table is titled “Physical level interpretation” and shows how the physical level ordering is matched to the physical states of the cell.
Let us see what can be learned from studying the table. If a cell is in the right-most (highest threshold voltage) state Returning now to the drawings, The advantage of this dual-level system is seen when we consider the example that was used above to demonstrate the difficulty with the logical level ordering: writing a value of “0” that required an intermediate step of writing “8” which was impossible to do because it required reducing the cell's threshold voltage from the threshold voltage of the state that represented “12”. Using the dual-level method writing a logical value of “0” is translated into writing a “9” at the physical level, and as the physical level ordering is valid, there will be no difficulty in writing this value (or indeed any other value) into the cell. Indeed, as seen in In order to employ the methods of this aspect of the present invention there is a need to have a translation stage carried out in both writing and reading. It is possible in principle to have this translation carried out by software, where the software is executed by a host computer (where the flash memory is controlled directly by the host) or by a stand-alone controller (where the flash memory is controlled by a controller in the flash device that serves as the interface for the host). In system In system Implementing the translation in software is inefficient, especially when taking into account that the translation has to be applied to each and every cell that is to be written or read. Therefore it is better to have the translation performed in hardware, either within a stand-alone controller die or within the same die as the flash cells. In system In system In system It should be understood that no matter what system architecture is chosen, the translation requires all the data bits, that are targeted to the cells to be written, to be available before the writing operation begins. This is so because in order to know which row in the translation table we are in we need all the bits of the logical data. This means that if for example we implement a 4-bit MBC using the methods of this invention, the host should have all 4 logical pages that will eventually reside in the same group of cells to be available before programming can start. Then the data of any one of the 4 pages is viewed as one row in a 4-rows table, and then each 4-bit column of the table serves as an input to the translation process described above. The following is an example of such a table, for K cells:
Cell #0 stores a binary 6, cell # 1 stores a binary 3, cell # 2 stores a binary 8, etc. In the above discussion we assumed that all state errors are equally likely. That is, a cell is equally likely to be in any of its possible states (meaning we have no prior knowledge of the data to be stored) and also that each of the states is equally reliable and has the same probability of error. It is possible that either one (or both) of these assumptions is not true. In such case the optimal ordering is not necessarily the one providing even spread of transitions across the bits, as not all transitions are equally likely to occur. The same principles as discussed above are also applicable to that case. The optimal ordering to use in the logical level is one in which the overall probability of having a transition in any bit position is the same, or as close to this as possible. Such an ordering is called herein an ordering that evenly distributes the error probabilities of the bits, or equivalently, that provides an even distribution of the error probabilities of the bits, given the probability distributions of the data bits and of the state errors. Note that an ordering that evenly distributes the error probabilities of the bits is not necessarily an “evenly distributed” ordering, as defined above, although as we have seen if the data bits and the state errors are uniformly distributed then an evenly distributed ordering does distribute the error probabilities evenly. If the ordering resulting from this optimality criteria is valid, it can be used as the only ordering at all levels, with no translation needed. For example, in the above example of an error-rate optimal M=4 bit ordering, {15,14,12,13,9,8,10,11,3,2,0,4,6,7,5,1}, suppose that the state transition error probabilities are as in the following table:
Assume further that all data bits are equally probable. If these probabilities are applied to the above 15,000 cell example, each page has on the average 0.0003×15,000=4.5 errors. For example, the average number of errors in the logical page to which the lowest bit is assigned is 15,000 times the sum of the transition error probabilities of the transitions that change the lowest bit. There are six such transitions: transitions i, iii, v, vii, ix and xiii. Each of these transitions has an error probability of 0.00005. So the average number of errors in the page that stores the lowest bit is 6×0.00005×15,000=4.5 errors. So in this case the {15,14,12,13,9,8,10,11,3,2,0,4,6,7,5,1} bit ordering is valid and error-rate optimal and also distributes the bit error probabilities evenly, and no translation is needed. However, such optimal ordering may be found to be non-valid and therefore not possible to use at the physical cells level. In that case we use a translation that maps the logical bit pattern to be stored in a cell into a physical bit pattern that is the one actually written into the cell and that represents a valid ordering, thus achieving a better spread of bit error probability across the different bit positions while not violating the restrictions of the physical cells implementation. While the invention has been described with respect to a limited number of embodiments, it will be appreciated that many variations, modifications and other applications of the invention may be made. Referenced by
Classifications
Legal Events
Rotate |