Patent ID: 9520901
Filing Date: 2016-12-13
CPC Classification: G06F,G11B,G11C,H03M

Claim Text:
1. A memory controller that controls a nonvolatile memory, the nonvolatile memory including a plurality of memory areas, comprising: a writing destination management circuit configured to determine a writing destination of user data in the nonvolatile memory; an encoding circuit configured to encode the user data to generate a parity, the encoding circuit performing the encoding according to a plurality of encoding methods having different error correction capabilities, the plurality of encoding methods including a first encoding method and a second encoding method of which the error correction capability is higher than that of the first encoding method; a decoding circuit configured to decode the user data and the parity which are read out of the nonvolatile memory, the decoding circuit detecting a number of errors in the user data; a writing control circuit configured to control the nonvolatile memory to write the user data at the writing destination determined by the writing destination management circuit; and an Error Correcting Code (ECC) management circuit configured to obtain the number of errors in the user data of each of the plurality of memory areas, to select an encoding method among the plurality of encoding methods to be performed on user data which is stored in a first memory area among the plurality of memory areas, and to instruct the encoding circuit to encode the user data according to the encoding method corresponding to the first memory area, the first memory area corresponding to the writing destination of the user data, wherein the ECC management circuit changes the encoding method corresponding to the first memory area from the first encoding method to the second encoding method when the number of errors in the user data of the first memory area is equal to or higher than a threshold and a total sum of parities of the nonvolatile memory is equal to or less than a predetermined amount, wherein a predetermined size of parity is generated for a first size of the user data when the encoding is performed according to the first encoding method, and the predetermined size of the parity is generated for a second size of the user data smaller than the first size when the encoding is performed according to the second encoding method.