[an error occurred while processing this directive]
|
// Вариант 1
// Бит четности - младший в байте.
#define mParityEven(x) { (x) ^= (x>>4); \
(x) ^= (x>>2); \
(x) ^= (x>>1); \
}
// Вариант 2
// функция возвращает бит паритета
char parity(char c)
{
c ^= (c >> 4);
c ^= (c >> 2);
c ^= (c >> 1);
c &= 0x01;
return c;
}
E-mail: info@telesys.ru