SlideShare a Scribd company logo
1 of 15
Error correction
Hamming Code
Hamming code
• Hamming code is a set of error-correction codes that can be used to detect
and correct the errors that can occur when the data is moved from from
sender to receiver
• The redundant bits play an important role in detecting and correcting
errors.
• In Hamming code the redundant bits used for error detection and
correction is parity bit
• Redundant bits are the extra binary bits that are added to the original data
bits, which are ready to transfer from sender to receiver for ensuring that
no bits were lost during the data transfer.
• Parity bits are the extra bits that are added to the original data(binary bits)
so that the total number of 1s is even in case of even parity or odd in case
of odd parity.
Hamming code
• The number of redundant bits can be calculated using the following
formula:
• 2r ≥ m + r + 1
• where, r = redundant bit, m = data bit
• Suppose the number of data bits is 7, then the number of redundant
bits can be calculated using: = 2^4 ≥ 7 + 4 + 1 Thus, the number of
redundant bits= 4 Parity bits.
Question
• What should be the number of redundant bits if the data bits is 4?
• if data bits are 4 then the number of redundant bits can be calculated
as 2^3 >= 4+3+123>=4+3+1 where 3 is the required number of
redundant data bits so that no data is lost during the transmission
Determining position of parity bits:
• Parity bits are placed at the bit position which is the power of 2 i.e,
(2^0 , 2^1, 2^2, 2^3, 2^420,21,22,23,24,.... so on) which are
(1,2,4,8,... so on ).
• So for example, in the 7-bit data transfer we will be having 4 parity
bits which are (1,2,4,8).
• Similarly in the 4-bit data transfer we will be having 3 parity bits
which are (1,2,4).
Determining position of parity bits and data bit :
• The first step is to identify the bit position of the data and parity bits.
• All the bit positions which are powers of 2 are marked as parity bits
(e.g. 1, 2, 4, 8, etc.).
• Remaining bit positions are for data its
• The following image will help in visualizing the received hamming
code of 7 bits.
Determine the parity
• Parity P1 depends on the data bit D3,D5,D7,D9….(Check one ,skip
one)
• Parity P2 depends on the data bit D3,D6,D7,D10,D11.. (Check two
,skip two)
• Parity P4 depends on the data bit D5,D6,D7,D12,D13,D14,D15(Check
four ,skip four)
Question
• Suppose the data to be transmitted is 1011 using Hamming code
using even parity.
• Since the data bits is 4 bits ,the number of redundant bits is 3.
General Algorithm of Hamming code:
• Hamming Code is simply the use of extra parity bits to allow the
identification of an error.
1. Write the bit positions starting from 1 in binary form (1, 10, 11, 100,
etc).
2. All the bit positions that are a power of 2 are marked as parity bits
(1, 2, 4, 8, etc).
3. All the other bit positions are marked as data bits.
General Algorithm of Hamming code:
• Each data bit is included in a unique set of parity bits, as determined its bit position in
binary form.
• a. Parity bit 1 covers all the bits positions whose binary representation includes a 1 in the
least significant position (1, 3, 5, 7, 9, 11, etc).
• b. Parity bit 2 covers all the bits positions whose binary representation includes a 1 in the
second position from the least significant bit (2, 3, 6, 7, 10, 11, etc).
• c. Parity bit 4 covers all the bits positions whose binary representation includes a 1 in the
third position from the least significant bit (4–7, 12–15, 20–23, etc).
• d. Parity bit 8 covers all the bits positions whose binary representation includes a 1 in the
fourth position from the least significant bit bits (8–15, 24–31, 40–47, etc).
• e. In general, each parity bit covers all bits where the bitwise AND of the parity position
and the bit position is non-zero.
1. Since we check for even parity set a parity bit to 1 if the total number of ones in the
positions it checks is odd.
2. Set a parity bit to 0 if the total number of ones in the positions it checks is even.
Question
• If the 7 bit hamming code received by the receiver 1011011.state
whether the received code word is correct or wrong .If wrong locate
the bit having error.(Assume even parity is used)
Question
• Suppose the data to be transmitted is 1011001 using hamming code.
How the data is transmitted.
Question
• The data received by the receiver is 10101101110.state whether the
received code word is correct or wrong .If wrong locate the bit having
error.(Assume even parity is used)
Question
• The data received by the receiver is 10101101110.state whether the
received code word is correct or wrong .If wrong locate the bit having
error.(Assume even parity is used)
• Solution at
https://www.geeksforgeeks.org/hamming-code-in-computer-network/

More Related Content

What's hot

Error detection and correction
Error detection and correctionError detection and correction
Error detection and correctionMaria Akther
 
Presentation bcd adder
Presentation bcd adderPresentation bcd adder
Presentation bcd adderNokiBul
 
Implementation of reed solomon codes basics
Implementation of reed solomon codes basicsImplementation of reed solomon codes basics
Implementation of reed solomon codes basicsRam Singh Yadav
 
Analog Transmissions
Analog TransmissionsAnalog Transmissions
Analog TransmissionsTechiNerd
 
A Nutshell On Convolutional Codes (Representations)
A Nutshell On Convolutional Codes (Representations)A Nutshell On Convolutional Codes (Representations)
A Nutshell On Convolutional Codes (Representations)alka swara
 
Error Detection and correction concepts in Data communication and networks
Error Detection and correction concepts in Data communication and networksError Detection and correction concepts in Data communication and networks
Error Detection and correction concepts in Data communication and networksNt Arvind
 
Parallel Adder and Subtractor
Parallel Adder and SubtractorParallel Adder and Subtractor
Parallel Adder and SubtractorSmit Shah
 
Types of line coding
Types of line codingTypes of line coding
Types of line codingramalakshmi54
 
Error Detection and Correction
Error Detection and CorrectionError Detection and Correction
Error Detection and CorrectionTechiNerd
 
Line coding presentation
Line coding presentationLine coding presentation
Line coding presentationDibyendu Porey
 

What's hot (20)

Error detection and correction
Error detection and correctionError detection and correction
Error detection and correction
 
Half & Full Adder
Half &  Full AdderHalf &  Full Adder
Half & Full Adder
 
Binary parallel adder
Binary parallel adderBinary parallel adder
Binary parallel adder
 
Check sum
Check sumCheck sum
Check sum
 
Presentation bcd adder
Presentation bcd adderPresentation bcd adder
Presentation bcd adder
 
Implementation of reed solomon codes basics
Implementation of reed solomon codes basicsImplementation of reed solomon codes basics
Implementation of reed solomon codes basics
 
Base band transmission
Base band transmissionBase band transmission
Base band transmission
 
Parallel Adder
Parallel Adder Parallel Adder
Parallel Adder
 
Unit4
Unit4Unit4
Unit4
 
Analog Transmissions
Analog TransmissionsAnalog Transmissions
Analog Transmissions
 
Parity generator & checker
Parity generator & checkerParity generator & checker
Parity generator & checker
 
A Nutshell On Convolutional Codes (Representations)
A Nutshell On Convolutional Codes (Representations)A Nutshell On Convolutional Codes (Representations)
A Nutshell On Convolutional Codes (Representations)
 
2's complement
2's complement2's complement
2's complement
 
Error Detection and correction concepts in Data communication and networks
Error Detection and correction concepts in Data communication and networksError Detection and correction concepts in Data communication and networks
Error Detection and correction concepts in Data communication and networks
 
Hashing
HashingHashing
Hashing
 
Parallel Adder and Subtractor
Parallel Adder and SubtractorParallel Adder and Subtractor
Parallel Adder and Subtractor
 
Shannon Fano
Shannon FanoShannon Fano
Shannon Fano
 
Types of line coding
Types of line codingTypes of line coding
Types of line coding
 
Error Detection and Correction
Error Detection and CorrectionError Detection and Correction
Error Detection and Correction
 
Line coding presentation
Line coding presentationLine coding presentation
Line coding presentation
 

Similar to 5.Error correction-Hamming Code.pptx

Error detection and correction codes
Error detection and correction codesError detection and correction codes
Error detection and correction codesGargiKhanna1
 
Parity check(Error Detecting Codes)
Parity check(Error Detecting Codes)Parity check(Error Detecting Codes)
Parity check(Error Detecting Codes)Imesha Perera
 
Error detection and correction codes r006
Error detection and correction codes   r006Error detection and correction codes   r006
Error detection and correction codes r006arunachalamr16
 
Satellite error detection and correction presentation
Satellite error detection and correction presentationSatellite error detection and correction presentation
Satellite error detection and correction presentationAhmedMuhumed2
 
Digital principles basic
Digital principles basicDigital principles basic
Digital principles basicAbinaya B
 
07 Data Link LayerError Control.pdf
07 Data Link LayerError Control.pdf07 Data Link LayerError Control.pdf
07 Data Link LayerError Control.pdfbaysahcmjames2kblax
 
Skr+3200+chapter+3+(kweh)
Skr+3200+chapter+3+(kweh)Skr+3200+chapter+3+(kweh)
Skr+3200+chapter+3+(kweh)Ammar Shafiq
 
Error dectation and correction
Error dectation and correctionError dectation and correction
Error dectation and correctionfg657
 
Digital logic designing presentation
Digital logic designing presentationDigital logic designing presentation
Digital logic designing presentationHassan Hashmi
 
Calculating the hamming code
Calculating the hamming codeCalculating the hamming code
Calculating the hamming codeUmesh Gupta
 
Calculating the hamming code (tutorial)
Calculating the hamming code (tutorial)Calculating the hamming code (tutorial)
Calculating the hamming code (tutorial)kiriinyaKev
 
Coding theory updated
Coding theory updatedCoding theory updated
Coding theory updated14cs40128
 
4_Datalink__Error_Detection_and Correction.pdf
4_Datalink__Error_Detection_and Correction.pdf4_Datalink__Error_Detection_and Correction.pdf
4_Datalink__Error_Detection_and Correction.pdfkenilpatel65
 
Digital Logic BCA TU Chapter 2.2
Digital Logic BCA TU Chapter 2.2Digital Logic BCA TU Chapter 2.2
Digital Logic BCA TU Chapter 2.2ISMT College
 

Similar to 5.Error correction-Hamming Code.pptx (20)

Hamming code checksum
Hamming code  checksumHamming code  checksum
Hamming code checksum
 
Error detection and correction codes
Error detection and correction codesError detection and correction codes
Error detection and correction codes
 
Parity check(Error Detecting Codes)
Parity check(Error Detecting Codes)Parity check(Error Detecting Codes)
Parity check(Error Detecting Codes)
 
Error detection and correction codes r006
Error detection and correction codes   r006Error detection and correction codes   r006
Error detection and correction codes r006
 
Satellite error detection and correction presentation
Satellite error detection and correction presentationSatellite error detection and correction presentation
Satellite error detection and correction presentation
 
UNIT-V.pptx
UNIT-V.pptxUNIT-V.pptx
UNIT-V.pptx
 
Digital principles basic
Digital principles basicDigital principles basic
Digital principles basic
 
07 Data Link LayerError Control.pdf
07 Data Link LayerError Control.pdf07 Data Link LayerError Control.pdf
07 Data Link LayerError Control.pdf
 
Skr+3200+chapter+3+(kweh)
Skr+3200+chapter+3+(kweh)Skr+3200+chapter+3+(kweh)
Skr+3200+chapter+3+(kweh)
 
Error dectation and correction
Error dectation and correctionError dectation and correction
Error dectation and correction
 
Code Converters & Parity Checker
Code Converters & Parity CheckerCode Converters & Parity Checker
Code Converters & Parity Checker
 
Digital logic designing presentation
Digital logic designing presentationDigital logic designing presentation
Digital logic designing presentation
 
Calculating the hamming code
Calculating the hamming codeCalculating the hamming code
Calculating the hamming code
 
Unit-4.pptx
Unit-4.pptxUnit-4.pptx
Unit-4.pptx
 
Calculating the hamming code (tutorial)
Calculating the hamming code (tutorial)Calculating the hamming code (tutorial)
Calculating the hamming code (tutorial)
 
Codes
CodesCodes
Codes
 
Coding theory updated
Coding theory updatedCoding theory updated
Coding theory updated
 
Binary and EC codes
Binary and EC codesBinary and EC codes
Binary and EC codes
 
4_Datalink__Error_Detection_and Correction.pdf
4_Datalink__Error_Detection_and Correction.pdf4_Datalink__Error_Detection_and Correction.pdf
4_Datalink__Error_Detection_and Correction.pdf
 
Digital Logic BCA TU Chapter 2.2
Digital Logic BCA TU Chapter 2.2Digital Logic BCA TU Chapter 2.2
Digital Logic BCA TU Chapter 2.2
 

Recently uploaded

TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...Nguyen Thanh Tu Collection
 
When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...Gary Wood
 
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjjStl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjjMohammed Sikander
 
OSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsOSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsSandeep D Chaudhary
 
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...Nguyen Thanh Tu Collection
 
Improved Approval Flow in Odoo 17 Studio App
Improved Approval Flow in Odoo 17 Studio AppImproved Approval Flow in Odoo 17 Studio App
Improved Approval Flow in Odoo 17 Studio AppCeline George
 
Major project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategiesMajor project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategiesAmanpreetKaur157993
 
PSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptxPSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptxMarlene Maheu
 
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes GuàrdiaPersonalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes GuàrdiaEADTU
 
Contoh Aksi Nyata Refleksi Diri ( NUR ).pdf
Contoh Aksi Nyata Refleksi Diri ( NUR ).pdfContoh Aksi Nyata Refleksi Diri ( NUR ).pdf
Contoh Aksi Nyata Refleksi Diri ( NUR ).pdfcupulin
 
The Liver & Gallbladder (Anatomy & Physiology).pptx
The Liver &  Gallbladder (Anatomy & Physiology).pptxThe Liver &  Gallbladder (Anatomy & Physiology).pptx
The Liver & Gallbladder (Anatomy & Physiology).pptxVishal Singh
 
Andreas Schleicher presents at the launch of What does child empowerment mean...
Andreas Schleicher presents at the launch of What does child empowerment mean...Andreas Schleicher presents at the launch of What does child empowerment mean...
Andreas Schleicher presents at the launch of What does child empowerment mean...EduSkills OECD
 
8 Tips for Effective Working Capital Management
8 Tips for Effective Working Capital Management8 Tips for Effective Working Capital Management
8 Tips for Effective Working Capital ManagementMBA Assignment Experts
 
An overview of the various scriptures in Hinduism
An overview of the various scriptures in HinduismAn overview of the various scriptures in Hinduism
An overview of the various scriptures in HinduismDabee Kamal
 
e-Sealing at EADTU by Kamakshi Rajagopal
e-Sealing at EADTU by Kamakshi Rajagopale-Sealing at EADTU by Kamakshi Rajagopal
e-Sealing at EADTU by Kamakshi RajagopalEADTU
 
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...EADTU
 
SPLICE Working Group: Reusable Code Examples
SPLICE Working Group:Reusable Code ExamplesSPLICE Working Group:Reusable Code Examples
SPLICE Working Group: Reusable Code ExamplesPeter Brusilovsky
 

Recently uploaded (20)

TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
 
Mattingly "AI & Prompt Design: Named Entity Recognition"
Mattingly "AI & Prompt Design: Named Entity Recognition"Mattingly "AI & Prompt Design: Named Entity Recognition"
Mattingly "AI & Prompt Design: Named Entity Recognition"
 
VAMOS CUIDAR DO NOSSO PLANETA! .
VAMOS CUIDAR DO NOSSO PLANETA!                    .VAMOS CUIDAR DO NOSSO PLANETA!                    .
VAMOS CUIDAR DO NOSSO PLANETA! .
 
When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...
 
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjjStl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
 
OSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsOSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & Systems
 
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
 
Improved Approval Flow in Odoo 17 Studio App
Improved Approval Flow in Odoo 17 Studio AppImproved Approval Flow in Odoo 17 Studio App
Improved Approval Flow in Odoo 17 Studio App
 
Major project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategiesMajor project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategies
 
PSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptxPSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptx
 
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes GuàrdiaPersonalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
 
Contoh Aksi Nyata Refleksi Diri ( NUR ).pdf
Contoh Aksi Nyata Refleksi Diri ( NUR ).pdfContoh Aksi Nyata Refleksi Diri ( NUR ).pdf
Contoh Aksi Nyata Refleksi Diri ( NUR ).pdf
 
The Liver & Gallbladder (Anatomy & Physiology).pptx
The Liver &  Gallbladder (Anatomy & Physiology).pptxThe Liver &  Gallbladder (Anatomy & Physiology).pptx
The Liver & Gallbladder (Anatomy & Physiology).pptx
 
Including Mental Health Support in Project Delivery, 14 May.pdf
Including Mental Health Support in Project Delivery, 14 May.pdfIncluding Mental Health Support in Project Delivery, 14 May.pdf
Including Mental Health Support in Project Delivery, 14 May.pdf
 
Andreas Schleicher presents at the launch of What does child empowerment mean...
Andreas Schleicher presents at the launch of What does child empowerment mean...Andreas Schleicher presents at the launch of What does child empowerment mean...
Andreas Schleicher presents at the launch of What does child empowerment mean...
 
8 Tips for Effective Working Capital Management
8 Tips for Effective Working Capital Management8 Tips for Effective Working Capital Management
8 Tips for Effective Working Capital Management
 
An overview of the various scriptures in Hinduism
An overview of the various scriptures in HinduismAn overview of the various scriptures in Hinduism
An overview of the various scriptures in Hinduism
 
e-Sealing at EADTU by Kamakshi Rajagopal
e-Sealing at EADTU by Kamakshi Rajagopale-Sealing at EADTU by Kamakshi Rajagopal
e-Sealing at EADTU by Kamakshi Rajagopal
 
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
 
SPLICE Working Group: Reusable Code Examples
SPLICE Working Group:Reusable Code ExamplesSPLICE Working Group:Reusable Code Examples
SPLICE Working Group: Reusable Code Examples
 

5.Error correction-Hamming Code.pptx

  • 2. Hamming code • Hamming code is a set of error-correction codes that can be used to detect and correct the errors that can occur when the data is moved from from sender to receiver • The redundant bits play an important role in detecting and correcting errors. • In Hamming code the redundant bits used for error detection and correction is parity bit • Redundant bits are the extra binary bits that are added to the original data bits, which are ready to transfer from sender to receiver for ensuring that no bits were lost during the data transfer. • Parity bits are the extra bits that are added to the original data(binary bits) so that the total number of 1s is even in case of even parity or odd in case of odd parity.
  • 3. Hamming code • The number of redundant bits can be calculated using the following formula: • 2r ≥ m + r + 1 • where, r = redundant bit, m = data bit • Suppose the number of data bits is 7, then the number of redundant bits can be calculated using: = 2^4 ≥ 7 + 4 + 1 Thus, the number of redundant bits= 4 Parity bits.
  • 4. Question • What should be the number of redundant bits if the data bits is 4? • if data bits are 4 then the number of redundant bits can be calculated as 2^3 >= 4+3+123>=4+3+1 where 3 is the required number of redundant data bits so that no data is lost during the transmission
  • 5. Determining position of parity bits: • Parity bits are placed at the bit position which is the power of 2 i.e, (2^0 , 2^1, 2^2, 2^3, 2^420,21,22,23,24,.... so on) which are (1,2,4,8,... so on ). • So for example, in the 7-bit data transfer we will be having 4 parity bits which are (1,2,4,8). • Similarly in the 4-bit data transfer we will be having 3 parity bits which are (1,2,4).
  • 6. Determining position of parity bits and data bit : • The first step is to identify the bit position of the data and parity bits. • All the bit positions which are powers of 2 are marked as parity bits (e.g. 1, 2, 4, 8, etc.). • Remaining bit positions are for data its • The following image will help in visualizing the received hamming code of 7 bits.
  • 7. Determine the parity • Parity P1 depends on the data bit D3,D5,D7,D9….(Check one ,skip one) • Parity P2 depends on the data bit D3,D6,D7,D10,D11.. (Check two ,skip two) • Parity P4 depends on the data bit D5,D6,D7,D12,D13,D14,D15(Check four ,skip four)
  • 8. Question • Suppose the data to be transmitted is 1011 using Hamming code using even parity. • Since the data bits is 4 bits ,the number of redundant bits is 3.
  • 9. General Algorithm of Hamming code: • Hamming Code is simply the use of extra parity bits to allow the identification of an error. 1. Write the bit positions starting from 1 in binary form (1, 10, 11, 100, etc). 2. All the bit positions that are a power of 2 are marked as parity bits (1, 2, 4, 8, etc). 3. All the other bit positions are marked as data bits.
  • 10. General Algorithm of Hamming code: • Each data bit is included in a unique set of parity bits, as determined its bit position in binary form. • a. Parity bit 1 covers all the bits positions whose binary representation includes a 1 in the least significant position (1, 3, 5, 7, 9, 11, etc). • b. Parity bit 2 covers all the bits positions whose binary representation includes a 1 in the second position from the least significant bit (2, 3, 6, 7, 10, 11, etc). • c. Parity bit 4 covers all the bits positions whose binary representation includes a 1 in the third position from the least significant bit (4–7, 12–15, 20–23, etc). • d. Parity bit 8 covers all the bits positions whose binary representation includes a 1 in the fourth position from the least significant bit bits (8–15, 24–31, 40–47, etc). • e. In general, each parity bit covers all bits where the bitwise AND of the parity position and the bit position is non-zero. 1. Since we check for even parity set a parity bit to 1 if the total number of ones in the positions it checks is odd. 2. Set a parity bit to 0 if the total number of ones in the positions it checks is even.
  • 11.
  • 12. Question • If the 7 bit hamming code received by the receiver 1011011.state whether the received code word is correct or wrong .If wrong locate the bit having error.(Assume even parity is used)
  • 13. Question • Suppose the data to be transmitted is 1011001 using hamming code. How the data is transmitted.
  • 14. Question • The data received by the receiver is 10101101110.state whether the received code word is correct or wrong .If wrong locate the bit having error.(Assume even parity is used)
  • 15. Question • The data received by the receiver is 10101101110.state whether the received code word is correct or wrong .If wrong locate the bit having error.(Assume even parity is used) • Solution at https://www.geeksforgeeks.org/hamming-code-in-computer-network/