Patent ID: 8495464

Claim:
A method comprising: receiving a N-bit uncompressed data to be stored in a memory device, wherein the memory device does not perform any error correction code (ECC) algorithm nor provide designated error correction code storage for the N-bit uncompressed data, where N is a positive integer; compressing the N-bit uncompressed data to generate a M-bit compressed data, where M is a positive integer; determining whether the M-bit compressed data can be stored with K corresponding ECC bits within a N-bit storage location, where K is a positive integer; computing a K-bit ECC for the M-bit compressed data, wherein M+K is less than or equal to N if M+K is equal to or less than N; storing the M-bit compressed data and the K-bit ECC together in the memory device within a selected storage location that is equal to or less than N bits if M+K is equal to or less than N; and storing the N-bit uncompressed data in uncompressed form if M+K is greater than N.