Patent ID: 8861256

Claim:
A method of storing binary data in a memory array with less than half of memory elements in any row and column of the array in a low-resistance state, the method comprising: arranging the binary data in a first portion of an encoding array, the encoding array having as many rows and columns as the memory array; entering high-resistance values in a second portion of the encoding array; selecting, from a covering code with a radius equal to a predetermined number that is less than half the number of rows in the encoding array, a codeword for each row in which more entries than the predetermined number are low-resistance values; using the codeword for each such row to reduce the number of low-resistance values in that row; selecting from the covering code a codeword for each column in which more entries than the predetermined number are low-resistance values; using the codeword for each such column to reduce the number of low-resistance values in that column; if any row or column still has too many low-resistance values, repealing the preceding steps of selecting and using codewords until no row and no column has more low-resistance values than the predetermined number; and storing the entries from the encoding array in corresponding memory elements of the memory array.