Tobias K. answered 03/23/21
UCLA Electrical Engineering Undergraduate
TL;DR: Convert the hexadecimal to binary, count how many ones are in the 32-bit string. If there are an odd number of ones, add a zero. Otherwise, add a one to make the number of ones odd.
The parity bit depends on whether there are an even or odd number of ones in the original 32-bit string. If the number of ones is odd, the added parity will be zero since we already have an odd number of ones, but if the numbers of ones is even, we need to add an additional "one" to make the number of ones odd. (The sent 33-bit string should always have an odd-number of ones)
Now for the actual calculating. First, convert each hexadecimal symbol into binary:
1 => 0001, 2 => 0010, 3 => 0011, 4 => 0100, 5 => 0101, 6 => 0110, 7 => 0111, 8 => 1000
Now, count how many groups have an odd number of ones. In this case, that number of groups would be five since 1, 2, 4, 7, and 8 have odd number of ones. Since the number of odd groups is odd, our parity bit will be zero.
(As for how the above works, no matter how many times you add even numbers together, you'll always get an even number. Thus, we can safely rule out the even groupings from our calculations. However, when adding odd numbers together, the final sum will either be odd or even depending on how many odds are added. Adding odd numbers an even number of times sums to an even number and adding odd numbers an odd number of times sums to an odd number.)