Prof. Dr. Thorsten Jungmann (last updated 2026-11-02)
Relates to DET-05 Codes, code converters and standard components
Task
Your smartphone sends data to wireless headphones via Bluetooth, and electromagnetic interference can flip single bits on the way. Bluetooth protects certain packets with a shortened Hamming code. Here, you work with the form with seven bits from the lesson. The data bits , , and carry a decimal digit in the binary-coded decimal (BCD) code, with the weight 8, and three parity bits are added:
| Position | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
|---|---|---|---|---|---|---|---|
| Bit |
With even parity, completes the positions 3, 5 and 7, the positions 3, 6 and 7, and the positions 5, 6 and 7 to an even number of ones.
a) First without the Hamming code: the digit 4 is sent in the BCD code, followed by one parity bit with even parity. Give the five bits.
b) The bit with the weight 1 of a) flips on the way. Does the receiver notice? In another transmission, the bits with the weights 4 and 2 flip instead. Does the receiver notice this, and which digit does it read?
c) Determine the Hamming distance between the digits 4 and 6, first in the BCD code, then in the BCD code with one parity bit.
d) Determine the code words with seven bits for the digits 4 and 6. What is the Hamming distance between them?
e) The receiver gets 1001000. Which bit has flipped, and which digit was sent? Which digit would the data bits have delivered without the correction?
f) The receiver gets 1000100. Which bit has flipped? Does this change the digit?
g) The digit 4 was sent, and the bits at the positions 3 and 5 have flipped: the receiver gets 1011000. Which bit does the receiver invert, and what does it deliver?
h) Let to be the received bits. Give the expressions of the three results , and of the receiver. Then design the correction of the bit at position 3 with an output of a 3-to-8 decoder and an XOR gate.
Solution
a) 0100 1
b) 0101 1 has three ones, an odd number: noticed; 0010 1 has two ones: not noticed, the receiver reads the digit 2
c) distance 1 in the BCD code, distance 2 with the parity bit
d) digit 4: 1001100; digit 6: 1100110; distance 3
e) the bit at position 5 (results 1, 0 and 1 for the weights 1, 2 and 4); sent: the digit 4; without the correction, the data bits deliver the digit 0
f) the parity bit at position 4 (results 0, 0 and 1); the data bits stay 0100, the digit 4
g) the results 0, 1 and 1 point to position 6; the receiver inverts this correct bit and delivers 1011010, with the data bits 1010, not a valid digit
h) , , ; with the decoder output
