Step 1: After receiving the codeword, the receiver calculates the parity checks for each parity bit position (p1, p2, p4, etc.) using the same method as encoding.
Step 2: If any of the parity checks yield a non-zero result, it indicates an error in the transmitted codeword. The binary result of all parity checks is used to locate the position of the error.
Step 3: Once the error position is identified, the receiver can flip the corresponding bit in the received codeword to correct the error.