Patent ID: 8533558

Claim:
A method comprising: in a memory device including an error correction coding (ECC) engine and multiple storage elements including a group of storage elements, wherein the memory device is configured to store information to the storage elements according to a page format, the page format including a data portion and a parity portion, performing: initiating a compression operation to compress data to be stored in the group of storage elements; selecting one of a first mode of the ECC engine to generate a first number of parity bits and a second mode of the ECC engine to generate a second number of parity bits, the selected mode based on an extent of compression of the compressed data; encoding the compressed data to generate parity bits corresponding to the compressed data; and adding additional data to the compressed data to increase a storage size of a formatted word; storing the formatted word including the compressed data and the parity bits to the group of storage elements according to the page format, wherein the compressed data is stored in the data portion and at least some of the parity bits are stored in the parity portion.