Patent ID: 8117172

Claim:
A method for compact encoding in a memory subject to wear from erase operations, the method comprising: providing a first value field allocated in a first portion of a memory, wherein a portion of the first value field is utilized to store a fixed-size variable value; locating a most significant zero bit (MSZB) of a previously stored fixed-size variable value in a first area of the first value field; counting the bits before the MSZB in a value field; determining if there are enough bits to write a new fixed-size variable value in the first area of the value field; and if there are enough bits, allocating those bits for the fixed-size variable and transitioning the first most significant bit (MSB) of the allocated bits to zero; writing the new fixed-size variable value into the first area of the value field without performing an erase operation; and if there are not enough bits, allocating a new area in the memory to change the MSB in the new area to zero.