Electrical Engineering XYZ MCQs

The number of parity bits in a 12-bit Hamming code is:

- 5
- 4
- 8
- 6

Correct answer:

In a Hamming code, if there are *m* parity bits, they can cover the data bits from 1 up to 2* ^{m}*. Subtracting out the parity bits, we are left with 2

*−*

^{m}*m*−1 bits for data.

Given that in the problem there are 12 data bits, we want to find the smallest �*m* such that:

2*m* − *m* − 1

Now we can try different values of �*m* to find the minimum value that satisfies this inequality.

**For**2*m*=1:^{1}−1−1=0; which is less than 12.**For**2*m*=2:^{2}−2−1=3; which is less than 12.**For**2*m*=3:^{3}−3−1=4; which is less than 12.**For**2*m*=4:^{4}−4−1=11; which is equal to 12.

So, *m*=4 satisfies the inequality. Therefore, a 12-bit Hamming code would have 4 parity bits.

Hence, the correct answer to the multiple-choice question is: 2. 4