Hamming Code Examples Solutions
Hamming Code Examples Solutions
1 0 1 R8 1 0 0 R 4 1 R 2 0
R2-1
2,3,6,7,10,11
1 0 1 R8 1 0 0 R 4 1 1 0
R4- 1
4,5,6,7,12
1 0 1 R8 1 0 0 1 1 1 0
R8- 0
8,9,10,11
1 0 1 0 1 0 0 1 1 1 0 – message that will be transmitted
with the introduction of redundant bits of parity
1 0 1 0 1 1 0 1 1 1 0 – in the receiving part we have this
stream of information bits.
R1- (1,3,5,7,9,11)- there are 4 so even number no error
--------- 0
1 0 1 0 1 1 0 11 10
R2- (2,3,6,7,10,11)- there are 5 so odd number of 1s so
there is an error ----------1
1 0 1 0 1 1 0 11 10
R4- (4,5,6,7)- there are 3 ones so an odd number of 1s
so there is an error --------1
1 0 1 0 1 1 0 11 10
R8- (8,9,10,11)-there are 2 ones so an even number of
1s so there is no error --------0
R8 R4 R2 R1
0 1 1 0 - 610
We need to check if the message were transmitted
without errors with Hamming code (we get the
information bits plus the redundant bits).
Example 1
110001101010 – 11001100 (original message after
omit the redundant bits)
R1(1,3,5,7,9,11)- 2 bits are 1 so even number of 1s no
error --------0
110001101010
R2(2,3,6,7,10,11)- 4 bits are 1 so even number of 1s no
error ------0
110001101010
R4(4,5,6,7,12)- 4 bits are 1 so even number of 1s no
error ------0
110001101010
R8(8,9,10,11,12)-2 bits are 1 so even number of 1s no
error ------0
So there are no errors in this transmission
Example 2
001100011111- message transmitted
00110001 – original message after correction and
eliminating the redundant bits
001100011111
R1- even number of 1s so we don’t error detected by
this parity bit -----------0
001100011111
R2- odd number of 1s there is an error detected by this
parity bit -----------------1
001100011111
R4 – even number of 1s there is not an error detected
by this parity bit ---------0
001100011111
R8 – even number of 1s there are no errors detected by
this parity bit so ---------0
R8 R4 R2 R1
0 0 1 0 – 210
Example 3
010100010000 – message received
00010010 – original message that I got
010100010000
R1 – 3 bits are 1 and we have an odd number of 1s
there is an error detected ----------1
010100010000
R2- 1 bit is 1 so odd number of 1s there is an error
detected -------------1
010100010000
R4- 1 bit is 1 so odd number of 1s there is an error
detected -------------1
010100010000
R8- even number of 1s so there are no errors detected
by the parity bit 8 ----0
R8 R4 R2 R1
0 1 1 1 -710
Example 4
010100110000 – message received (01010010)
010100110000
R1- odd number of 1s it detects an error ----- 1
010100110000
R2- even number of 1s so no error ------------0
010100110000
R4- even number of 1s no error ---------------0
010100110000
R8- even number of 1s no error --------------0