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

Hamming Code Presentation

The document summarizes insights into Hamming codes. It explains how Hamming codes work by introducing redundant bits to detect and correct errors in binary data. The document notes that Hamming codes improve upon parity checks, which can only detect single-bit errors and are unable to locate the error. Hamming codes achieve this by applying parity checks to specific subsets of bits rather than the entire message, allowing detection and correction of single-bit errors.

Uploaded by

kirthika15cs
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
83 views

Hamming Code Presentation

The document summarizes insights into Hamming codes. It explains how Hamming codes work by introducing redundant bits to detect and correct errors in binary data. The document notes that Hamming codes improve upon parity checks, which can only detect single-bit errors and are unable to locate the error. Hamming codes achieve this by applying parity checks to specific subsets of bits rather than the entire message, allowing detection and correction of single-bit errors.

Uploaded by

kirthika15cs
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 22

HAMMING CODE

CONTENT
INTRO S ENDIN
& G
ORIGIN NOTES

HAMMI MATHS
NG INTUITI
INSIGH ON
BINARY
TS INTUITI
Any file is stored in binary form
Original File’s Binary(bits)
Original Image File
Form
0 0 1 1 1 0 1 1 0 1

ORIGIN
INTRO &
1 0 0 1 0 1 1 1 0 0
1 1 0 1 1 0 0 1 1 0
0 0 0 1 1 0 1 0 0 1
File’s Sequential
0 1 1 0 1 1 0 1 1 0 Arrangement
1 1 0 0 1 0 1 1 0 1 00111011011001010…
1 1 1 0 0 1 1 0 1 0

Now to spot an error Original File


intuitively, we can 00111111011001010… Original File Redundancy
introduce redundant
00111011011001010…
copies (3 copies of each
00111011011001010…
bit) Original File 1/3 rd 2/3 rd
Redundant Copies
00111011011001010… Compare and take best 2 1
out of 3 & flip back Eats up space &
00111011011001010…
Original File 0 fails for 2-bit flips.
00111011011001010…
00111011011001010… 1
Redundant Copies
Original File Redundancy Original File Redundancy

33.7 % 66.7 % 96.5 % 3.5%

ORIGIN
INTRO &
What can we do ?

Implement a efficient technique : HAMMING CODE

Error Correction Code In a 256-bit message :


Methods that correct 1-bit Error = Ability to detect and Correct
Redundant Bits = 9
such errors 2-bit Error = Ability to detect
Message Bits = 247

Richard W. Hamming
00 01 12 13 00 01 12 13

INSIGHTS
HAMMING
14 05 16 07 NOISE 14 05 16 07
SENDER

RECEIVER
08 09 1 10 0 11 08 09 1 10 0 11
1 12 0 13 0 14 1 15 1 12 0 13 0 14 1 15
16-Bits Block 12 (~11) -Bits of Data
04-Bits for Redundancy
Method to detect the error but not correct it – PARITY CHECK

00 01 12 13 Reserve one special bit • Odd Parity does not

INSIGHTS
HAMMING
(a.k.a Parity Bit) necessarily mean there is only
one error; there might be more
14 05 16 07 The rest contain than 3 or 5 or 11 or any other
odd number of errors.
message
• Similarly if Receiver sees Even
08 09 1 10 0 11 Task : Count the # of 1’s
Parity it does not necessarily
imply that there are no errors.
Even 1’s  Parity Bit (0)
0 12 1 13 1 14 1 15 Odd 1’s Parity Bit (1)
• Parity check will fail for
messages more than 1 flips
(i.e., 2 or 4 or any other even
number flips) and it is not easy
to detect these flips since the
parity bit will remain 0.

Though Parity Method are weak


on their own, they are the
fundamental building blocks for
other sophisticated techniques
such as Hamming Error
Correction.
Capable of detecting a change anywhere in the message using a
single bit of information in the form of Parity
INSIGHT:
Don't apply Parity to the whole
message but to a certain selected OR

INSIGHTS
HAMMING
Subsets of the message
Assumption: There is at-most 1 Error
in the complete block

10 01 02 13 OR

04 15 06 07
OR

08 19 0 10 1 11

OR
1 12 0 13 1 14 1 15
10 01 02 13
OR
04 15 06 07

INSIGHTS
HAMMING
0 8 1 9 0 10 1 11
1 12 0 13 1 14 1 15 OR

Parity Bit

10 11 02 13 OR

04 15 06 07
0 8 1 9 0 10 1 11
OR
1 12 0 13 1 14 1 15
10 11 02 13
04 15 06 17

INSIGHTS
HAMMING
OR
0 8 1 9 0 10 1 11
1 12 0 13 1 14 1 15

Case: 1 – Error at odd numbered positions


Looking at Parity Bit the receiver will detect 1-bit error in odd numbered positions.

Case: 2 – No Error / Error at even numbered positions


If there is no 1-bit error detected at odd numbered positions, then there is possibility
that the error is present in the even numbered positions or there is also the possibility
that there are no error.

Case: 3 – More than two errors (Case beyond our assumption)


If there is no 1-bit error detected at odd numbered positions, then there is possibility
that there are more than two errors present.
10 01 02 13
OR
04 15 06 07

INSIGHTS
HAMMING
0 8 1 9 0 10 1 11
1 12 0 13 1 14 1 15 OR

Parity Bit

10 01 02 13 OR

04 15 06 07
0 8 1 9 0 10 1 11
OR
1 12 0 13 1 14 1 15
10 01 02 13
OR
04 15 06 07

INSIGHTS
HAMMING
0 8 1 9 0 10 1 11
1 12 0 13 1 14 1 15 OR

Parity Bit

10 01 02 13 OR

04 15 06 07
0 8 1 9 0 10 1 11
OR
1 12 0 13 1 14 1 15
10 01 02 13
OR

INSIGHTS
HAMMING
04 15 06 07
0 8 1 9 0 10 1 11
1 12 0 13 1 14 1 15 OR

Parity Bit

10 01 02 13 OR

04 15 06 07
18 1 9 0 10 1 11
OR
1 12 0 13 1 14 1 15
HAMMING
INSIGHTS
HAMMING
INSIGHTS
HAMMING
INSIGHTS


Ability to Scale What happens if Parity Bit changes

INSIGHTS
HAMMING
Well in that case also, we carry out
similar procedure. However our main
concern is regarding the message not
the parity bit. Hence it does not matter
at the end of the day.

Why are the Parity bits sitting in the positions What to do with the 0th Parity Bit ?
which are power of 2 ??

Why this ? Why not this ? (15,11) Hamming Code Extended Hamming
Code
The position which are power of 2 are such that 15 – Bit Block Use it to detect 2-bit
they correspond to exactly one and only one of 11 – Bits of Message error by performing
the four parity groups. Hence it is logical to 4 – Bits Redundancy normal parity check
consider position that are power of 2. on the whole block.
7

INTUITION
BINARY
1 1 1 0
0111  7
(YES) (YES) (YES) (NO)
For an error condition, does the
position contain 1 in it’s unit place
(_ _ _ 1 ) ?
0000 0001 0010 0011
Also note, the positions
For an error condition, does the which are power of 2
position contain 1 in it’s ten’s that are taken as Parity
place (_ _ 1 _) ? Bit, it’s binary represe-
0100 0101 0110 0111
-ntation has only a
For an error condition, does the single bit turned on
position contain 1 in it’s hundred’s (i.e., contains only 1)
1000 1001 1010 1011 place (_ 1 _ _ ) ?

For an error condition, does the


1100 1101 1110 1111 position contain 1 in it’s thousand’
place (1 _ _ _ ) ?
MATHS INTUITION
MATHS INTUITION
MATHS INTUITION
MATHS INTUITION
ENDING
NOTES
REFERENCES :
BOOKS :
• COMPUTER NETWORKS BY ANDREW S.
TANENBAUM & DAVID J. WETHERALL.
• DATA COMMUNICATIONS AND
Any
NETWORKING BY BEHROUZ
A.FOROUZAN Questions?
VIDEOS (Ref. Link) :
• https://www.youtube.com/watch?v=X8jsijhllIA
• https://www.youtube.com/watch?v=b3NxrZOu R.KIRHTIKA
_CE&t=817s
• https://www.youtube.com/watch?v=h0jloehRKa
s&t=0s 23MCS001 – M.Tech (1st Sem)
• https://www.youtube.com/watch?v=NQ4gLJYs Dept. of Computer Science and Engineering
pdA National Institute of Technology, Hamirpur.
• https://www.youtube.com/watch?
v=t4kiy4Dsx5Y

You might also like