Đối với mã sửa sai Hamming, cho xâu gốc là 10000011010011, xâu truyền đi là:
Trả lời:
Đáp án đúng: C
To find the transmitted string using Hamming error correction code, we need to insert parity bits into the original string. Parity bits are placed at positions that are powers of 2 (1, 2, 4, 8, 16,...). We have the original string 10000011010011, which has a length of 14.
1. **Determine the number of parity bits needed:** The number of parity bits (p) must satisfy the formula: 2^p >= m + p + 1, where m is the length of the original string (14). In this case, 2^4 = 16, 16 >= 14 + 4 + 1 = 19 (false). 2^5 = 32, 32 >= 14 + 5 + 1 = 20 (true). So we need 5 parity bits.
2. **Insert parity bits:** Insert parity bits (p1, p2, p4, p8, p16) into the corresponding positions: _ _ 1 _ 0 0 0 _ 0 1 1 0 1 0 0 1 1. Replace with p1 p2 1 p4 0 0 0 p8 0 1 1 0 1 0 0 1 1. The new string has length 19.
3. **Calculate the value of the parity bits:**
- p1: Check the bits at positions 1, 3, 5, 7, 9, 11, 13, 15, 17, 19. p1 = bit 3 ^ bit 5 ^ bit 7 ^ bit 9 ^ bit 11 ^ bit 13 ^ bit 15 ^ bit 17 ^ bit 19 = 1 ^ 0 ^ 0 ^ 0 ^ 0 ^ 1 ^ 0 ^ 1 ^ 1 = 0
- p2: Check the bits at positions 2, 3, 6, 7, 10, 11, 14, 15, 18, 19. p2 = bit 3 ^ bit 6 ^ bit 7 ^ bit 10 ^ bit 11 ^ bit 14 ^ bit 15 ^ bit 18 ^ bit 19 = 1 ^ 0 ^ 0 ^ 1 ^ 0 ^ 0 ^ 0 ^ 0 ^ 1 = 1
- p4: Check the bits at positions 4, 5, 6, 7, 12, 13, 14, 15. p4 = bit 5 ^ bit 6 ^ bit 7 ^ bit 12 ^ bit 13 ^ bit 14 ^ bit 15 = 0 ^ 0 ^ 0 ^ 1 ^ 1 ^ 0 ^ 0 = 0
- p8: Check the bits at positions 8, 9, 10, 11, 12, 13, 14, 15. p8 = bit 9 ^ bit 10 ^ bit 11 ^ bit 12 ^ bit 13 ^ bit 14 ^ bit 15 = 0 ^ 1 ^ 0 ^ 1 ^ 1 ^ 0 ^ 0 = 1
- p16: Check the bits at positions 16, 17, 18, 19. p16 = bit 17 ^ bit 18 ^ bit 19 = 1 ^ 0 ^ 1 = 0
4. **Transmitted string:** Replace the parity bits with their corresponding values: 0 1 1 0 0 0 0 1 0 1 1 0 1 0 0 1 1
Therefore, the transmitted string is 01100001011010011.





