Patent ID: 8407560

Claim:
A method, encoded in computer instructions and executed by a computer system, that encodes k information bits and writes the encoded k information bits to an electronic memory, method comprising: systematically encoding the k information bits with an error correction code to produce a codeword with error-correction parity bits, wherein the error-correction parity bits are to enable the codeword to recover from bit-transition errors that may occur during storage of the codeword in, and retrieval of the codeword from, the electronic memory; ensuring that the codeword does not violate a weight constraint, including: determining a weight of a subset of the codeword; if the weight of the subset of the codeword exceeds a threshold value t, applying a bitwise complement operation to the subset of the codeword by inverting values of bits in the subset of the codeword; and writing the codeword to the electronic memory.