Patent ID: 8327062

Claim:
A method of programming a memory array, the method comprising: providing data to be written having a plurality of first data blocks of a first length, each block of the plurality of first data blocks comprising bits that are to be written; defining a plurality of second data blocks of a second length in the data to be written, the second length being larger than the first length; calculating a first value, the first value being the number of bits in a first block of the plurality of second data blocks; defining a plurality of third data blocks of a third length in the data to be written, the third length being larger than the second length; calculating a second value, the second value being the number of bits in a first block of the plurality of third data blocks; defining a plurality of fourth data blocks of the second length in the data to be written, the plurality of fourth blocks comprising an inverse of the bits in the data to be written; calculating a third value, the third value being the number of bits in a first block of the plurality of fourth data blocks; defining a plurality of fifth data blocks of the third length in the data to be written, the plurality of fifth blocks comprising the inverse of the bits in the data to be written; calculating a fourth value, the fourth value being the number of bits in a first block of the plurality of fifth data blocks; if the second value is less than a maximum allowable number of bits that can be programmed in parallel and if the fourth value is not less than the maximum allowable number of bits that can be programmed in parallel, then writing the bits in the first block of the plurality of third data blocks into the memory array; if the fourth value is less than the maximum allowable number of bits that can be programmed in parallel and if the second value is not less than the maximum allowable number of hits that can be programmed in parallel, then writing the bits in the first block of the plurality of fifth data blocks into the memory array; if the second value is not less than the maximum allowable number of bits that can be programmed in parallel and if the fourth value is not less than the maximum allowable number of bits that can be programmed in parallel and if the first value is less than the maximum allowable number of bits that can be programmed in parallel, then writing the bits in the first block of the plurality of second data blocks into the memory array; and if the second value is not less than the maximum allowable number of bits that can be programmed in parallel and if the fourth value is not less than the maximum allowable number of bits that can be programmed in parallel and if the third value is less than the maximum allowable number of bits that can be programmed in parallel, then writing the bits in the first block of the plurality of fourth data blocks into the memory array.