1. Field of the Invention
The present invention generally relates to a storage device, and more particularly to an error correction method for a memory device.
2. Description of the Prior Art
Error detection and correction is important in maintaining data reliability in a storage device such as a semiconductor-based memory device. This fact becomes more significant as either the density or the number of bits stored in each memory cell increases. Moreover, the semiconductor-based memory device such as a flash memory may have bad bits that are either produced during the manufacturing or arose from substantial cycles of read and write.
Error correction code (ECC) is therefore used to improve the reliability in the memory device. However, the ECC in the conventional memory device is not effective. For the worse, when the number of errors exceeds the capability of the error correction scheme, the data stored in the memory device no longer can be recovered and are lost forever.
For example, the conventional flash memory usually employs low-density parity-check (LDPC) coding and associated soft-decision decoding technique in correcting error(s) of the data bits. However, the LDPC and associated soft-decision decoding no longer can recover the erroneous data when the number of error bits exceeds the capability of the error correction.
Furthermore, the threshold voltage distribution of the flash memory may probably change or drift after the flash memory has been subjected to a number of program/erase cycles or/and certain data retention time has elapsed. Errors probably incur if the threshold read value does not change correspondingly according to the change of the threshold voltage distribution.
For the reason that the conventional memory device such as the flash memory could not effectively correct error(s) and prevent data loss, a need has arisen to propose a novel error correction method for substantially improving capability of error correction in the memory device.
In view of the foregoing, it is an object of the embodiments to provide an error correction method for a memory device such as a flash memory in order to substantially improve the capability of error correction in the memory device.
According to one embodiment, a memory device is firstly (base) read, and the soft values associated with data bits read out of the memory device are initialized. At least one iteration of error correction code (ECC) decoding is performed on the soft values, and the soft values are updated with respect to each iteration of the ECC decoding. Each updated soft value is determined whether it is strong or not. The memory device is further read when not all the updated soft values are strong. Subsequently, the soft values are modified according to read-out data bits of the further reading and the updated soft values.
Referring to
In the embodiment, the flash memory is firstly read in the step 11. In the example shown in
Soft-decision decoding is used in the embodiment. The soft-decision decoding is one type of algorithm used to decode data that have been encoded with ECC. Although soft-decision decoding is used in the embodiment, it is appreciated that other decoding such as hard-decision decoding may be used instead. With respect to the soft-decision decoding, a soft value is associated with each data bit. In the embodiment, the first bit (or the most significant bit) of the soft value is the data bit, and the other bits of the soft value are reliability bits that indicate the reliability of the associated data bit. The soft value may, in the embodiment, be classified into, but not limited to, four categories: strong “1,” weak “1,” weak “0,” and strong “0” as defined in Table 1 (in which an 8-bit system is used).
In the step 12, the soft value of each data bit is initialized to result in an initial soft value. For example, the data bit “0” read out of the flash memory is initialized as (or mapped to) “00000000” (e.g., strong “0”) and the data bit “1” is initialized as (or mapped to) “11111111” (e.g., strong “1”). Please refer to
Subsequently, ECC decoding (i.e., LDPC decoding in this embodiment) is performed in the step 13. In the embodiment, one or more iterations of the ECC decoding are performed. With respect to each iteration in the ECC decoding, the soft value for each data bit is correspondingly updated (in the step 14). In the example shown in
After a predetermined number (e.g., two in the example) of iterations have been completed, the latest soft values of the data bits are determined in the step 15. It is noted, according to the flow illustrated in
Next, in the step 17, the soft values are respectively modified according to the further read-out bits and the latest soft values. Specifically, the soft value of each strong data bit is initialized if the further read-out bit is consistent with the previous bit. That is, the data bit “0” is initialized as (or mapped to) “00000000” (e.g., strong “0”) and the data bit “1” is initialized as (or mapped to) “11111111” (e.g., strong “1”). Otherwise, in one embodiment, the soft values are hold or kept unchanged. The operation in the step 17 according to the present embodiment is summarized in Table 3.
In another embodiment, as shown in Table 4, in addition to initializing the soft value of each strong data bit if the further read-out bit is consistent with the previous bit, the soft value of weak data bit is enhanced or shifted if the further read-out bit is consistent with the previous bit. Specifically, the soft value of weak “1” with previous bit “1” is incremented by adding a first value (e.g., 00000111) to the latest soft value, provided no overflow occurs. On the other hand, the soft value of weak “0” with previous bit “0” is decremented by subtracting a second value (e.g., 00000111) from the latest soft value, provided no underflow occurs. The first value may, but not necessarily, be the same as the second value. Furthermore, the first value and the second value may be either predetermined or dynamically determined.
After the soft values are modified in the step 17, they are subjected to further ECC decoding (e.g., the steps 13 and 14) as described above. With respect to each iteration in the ECC decoding, the soft value is correspondingly updated (in the step 14). In the example shown in
Although specific embodiments have been illustrated and described, it will be appreciated by those skilled in the art that various modifications may be made without departing from the scope of the present invention, which is intended to be limited solely by the appended claims.