Patent ID: 8570804

Claim:
A method for operating a memory, comprising: accepting data for storage in the memory; determining respective first voltage levels for programming a group of analog memory cells of the memory so as to cause the analog memory cells to store respective values of a physical quantity that represent the data; calculating an error correction code (ECC) for the accepted data dependent upon the determination of the respective first voltage levels; encoding the accepted data dependent upon the ECC; programming the group of analog memory cells with the encoded data dependent upon the determined first voltage levels; reading second voltage levels from the respective programmed analog memory cells; and reconstructing the data from the second voltage levels, wherein reconstructing the data comprises decoding the data dependent upon the ECC; wherein determining the first voltage levels comprises estimating distortion caused to a value of the physical quantity stored in a target analog memory cell by the values of the physical quantities stored in one or more other analog memory cells when storing the data in the target analog memory cell, and pre-correcting a first voltage level used for programming the target analog memory cell responsively to the estimated distortion.