Berger code

The check bits of Berger codes are computed by counting all the zeroes in the information word, and expressing that number in natural binary.

Similarly, Berger codes can detect any number of zero-to-one bit-flip errors, as long as no one-to-zero bit-flip errors occur in the same code word.

As stated above, Berger codes detect any number of unidirectional errors.

For case 2, the number of 0-valued bits in the information section have stayed the same, but the value of the check data has changed.

Since the information data has stayed the same, it has the same number of zeros it did before, and that will no longer match the mutated check value.

Therefore, there is no chance that the two will end up mutating in such a way as to become a different valid code word.

A similar analysis can be performed, and is perfectly valid, in the case where the only errors that occur are that some 0-valued bits change to 1.

For instance, in flash memory, bits can more easily be programmed to a 0 than can be reset to a 1.