#define ODD_PARITY(b) (EvenParity(b) ^ 1)

unsigned char EvenParity(unsigned char b)
{
    b ^= b >> 4;
    b ^= b >> 2;
    b ^= b >> 1;

    return (b & 1);
}