Tag: Bit Hacks

Compute parity of a number using lookup table

Given an integer, calculate its Parity. The parity refers to the number of 1’s in a given binary number.   Odd parity (encoded as 1) means there are an odd number of 1’s and even parity (encoded as 0) means that there are an even number of 1’s. Parity bits are often used as a …