0% found this document useful (0 votes)
22 views

Hamming Code Examples Solutions

This document discusses how parity bits are used to detect errors in binary data transmission using Hamming codes. It explains that parity bits are calculated based on examining specific bit positions in the binary representation of each data bit. For example, parity bit 1 examines the least significant bit, parity bit 2 examines the second least significant bit, etc. Three examples are provided to demonstrate how the parity bits are used to detect errors by comparing the received bits plus parity bits to the original message bits.

Uploaded by

Kassadi
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views

Hamming Code Examples Solutions

This document discusses how parity bits are used to detect errors in binary data transmission using Hamming codes. It explains that parity bits are calculated based on examining specific bit positions in the binary representation of each data bit. For example, parity bit 1 examines the least significant bit, parity bit 2 examines the second least significant bit, etc. Three examples are provided to demonstrate how the parity bits are used to detect errors by comparing the received bits plus parity bits to the original message bits.

Uploaded by

Kassadi
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Parity bit 1 – 20 it going check all the bits that in binary

presentation the least significant is a 1:


1,3,5,7,9 – 1-1, 3-11, 5-101, 7-111, 9-1001
Parity bit 2 – 21 it going check all the bits that in binary
presentation 1 bit before the least significant bit will be
1:
2,3,6,7,10,11- 2-10, 3-11, 6-110, 7-111, 10-1010, 11-
1011
Parity bit 4 – 22 it is going to check all the bits where in
their binary representation we have a 1 in the second
bit before the least one and it is a 1 value:
4,5,6,7,12- 4-100, 5-101,6-110,7-111,12-1100.
Parity bit 8 -23 it is going to check all the bits where in
their binary representation we have a 1 in the third bit
before the least one and its value is a 1:
8,9,10,11,12 – 8-1000,9-1001,10-1010,11-1011,12-
1100
Parity bit 16 – 24 it is going to check all the bits where in
their binary representation we have a 1 in the fourth bit
before the least bit with a value 1:
16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 – 16-
10000,17-10001

1011001- original message without the redundant bits


introduced

1 0 1 R8 1 0 0 R4 1 R2 R1– redundant bits


introduced through the message bits
1 0 1 R8 1 0 0 R4 1 R 2 R1
R1- 0
1,3,5,7,9,11

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

You might also like