SlideShare a Scribd company logo
1 of 16
Hamming Code System
Name- Dilshad Ahmad
Roll No-MT/EC/10007/19
Subject Code-EC564
Name- Richa Anand
Roll No-MT/EC/10014/19
Subject Code-EC564
ECE Dept. , BIT Mesra, Ranchi, 835215
5/30/2020
1
Content
 Introduction
 Errors
 Type of Errors
 Hamming Bound
 Hamming Code system
 Implementation of Hamming Code
 Syndrome and Decoding
 MATLAB Implementation Flow chart
 Source Code
 Output
 Conclusion
5/30/2020
2
Introduction
 Data can be corrupted during transmission, For reliable communication, errors must be
detected and corrected
 So we required a ‘Coding technique’ to overcome these errors at receiver.
 There is always some Bit Error Rate so to maintain some QoS we do encoding and
Decoding with a particular coding Scheme
 So There are Various coding scheme used according to need and Application, like
Hamming code, cyclic coding convolutional code etc.
5/30/2020
3
Errors
 What is Error?
o Error is a condition when the output information does not match with the input information. During
transmission, digital signals suffer from noise that can introduce errors in the binary bits travelling
from one system to other.
o That means a 0 bit may change to 1 or a 1 bit may change to 0.
 Error Detection: Error detection is the detection of errors caused by noise or other
impairments during transmission from the transmitter to the receiver.
 Error correction: Error correction is the detection of errors and reconstruction of the original,
error-free data.
5/30/2020
4
Type of Error:
 There are Mainly Three Types of Errors Occurs
1. Single bit error.
2. Multi bits error.
3. Burst bits error.
1 0 1 0 1 0 1 1 1 0 1 0
Single bit error: In a frame, there is only one bit, anywhere though, which is corrupt
1 0 1 0 1 0 0 1 1 0 1 0
Multi bit error: Frame is received with more than one bits in corrupted state.
1 0 1 0 1 0 0 1 1 1 1 1
Burst bit error: Frame contains more than1 consecutive bits corrupted..
5/30/2020
5
Hamming code:
 Around 1947 Richard W. Hamming developed technique for detecting and correcting single bit
errors in transmitted data. His technique requires that three parity bits (or check bits) be
transmitted with every four data bits. The algorithm is called a (7, 4) code, because it requires seven
bits to encoded four bits of data.
 In communication, Hamming codes are a family of linear error-correcting. Hamming codes can
detect up to two-bit or correct one-bit errors without detection of uncorrected errors.
0 0 1 1 0 1 0 1 1 1 1 0 1 0
0 0 1 1 0 1 0
1 1 1 1 0 1 0
Detection
Hamming Decoding
At Receiver
2 bit Detected
At Transmitter
1 0 1 1 0 1 0
Channel
At Receiver
1 bit Error Corrected
 Now Lets See what is these Hamming codes…
5/30/2020
6
Hamming Bound
 Any ( n, k ) code which is capable of correcting ‘t’ errors should satisfy the following condition
Called Hamming Bound
2 𝑛−𝑘 ≥ 𝑖=0
𝑡
𝑛𝐶𝑖 For t=1(Single Error Correcting code)
2 𝑛−𝑘 ≥n+1
 Any code which satisfy the equality condition in the hamming bound called perfect code
 For n=7, k=4 Equality condition hold
 So (7,4 ) single error correcting perfect code is called Hamming code
5/30/2020
7
Implementation of Hamming Code
 To implement Hamming code firstly we calculate Parity Bits
 Generator Matrix- It is matrix of [I,P] use to encode message bits
 For Example
 p1 = d2 + d3 + d4
p2 = d1 + d3 + d4
p3 = d1 + d2 + d4
5/30/2020
8
Continued…
 So for any Message bits (4 bits) we can get code directly using Generator matrix
C=[d]*[G]
 We send this Codeword through Channel and at receiver we decode this codeword
using parity check matrix also we find error is there or not
 Let at Receiver we get a received codeword “r”
5/30/2020
9
Syndrome and Decoding
 Syndrome-The pattern of errors, called the error syndrome, identifies the bit in error.
 If all parity bits are correct, there is no error. Otherwise, the sum of the positions of the
erroneous parity bits identifies the erroneous bit.
S=[r]. [HT]
If S =0 No Errors
S ≠ 0 Errors are there and we got Error Vector e
 S also gives location of error and this location vector verified from [HT]
5/30/2020
10
Continued…
 At last after getting the error vector e
Correct codeword= r + e
 This Syndrome Decoding for Hamming Code and error vector can’t correct more than
one error vector
 For correction more errors we have to add more redundancy
5/30/2020
11
MATLAB Implementation
 Flow Chart
Transmitter Receiver side
Channel
Start
Generator
Matrix
creation
Encoding
Parity
Generation
AWGN
Channel
Decoding
BER
Calculation
Error
Calculations
Stop 5/30/2020
12
Source Code
EbN0dB=2; Energy Per Bit
R=4/7; % (7,4) Hamming code Rate
EbN0=10^(EbN0dB/10); % Anti Log
sigma=sqrt(1/2*R*EbN0);
k=4; n=7;
Nerrs=0; Nblocks=1000; % 1000 blocks
for i = 1:Nblocks
msg=randi([0,1],1,k); %Random Msg Generation
%Encoding
cword=[msg mod(msg(1)+msg(2)+msg(3),2)...
mod(msg(2)+msg(3)+msg(4),2)...
mod(msg(1)+msg(2)+msg(4),2)];
s=1-2*cword;% BPSK bit to symbol conversion
r= s+sigma*randn(1,n); % AWGN CHANNEL
% Hard Decoding
b=(r<0); % Thresholg at Zero
dist= mod(repmat(b,16,1)+cwords,2)*ones(7,1);
[mind1,pos]=min(dist);
msg_cap1=cwords(pos,1:4);
%Soft Decoding
corr=(1-2*cwords).*r;
[mind2,pos]=max(corr);
msg_cap2=cwords(pos,1:4); % Decoded msg
Nerrs=Nerrs+sum(msg~=msg_cap1); % Eroors Calculation
end
BER_sim=Nerrs/k/Nblocks; % BER Calculation
% Name:
disp([EbN0dB BER_sim Nerrs k*Nblocks]);
5/30/2020
13
Output
For EbN0dB=2 ;
disp([EbN0dB R BER_sim Nerrs k*Nblocks]);
2 0.57143 0.05505 2202 40000
msg = % Random Input msg
0 0 0 1
cword =
0 0 0 1 0 1 1
%After AWGN Channel Received Code
r =
1.9644 0.455 1.1051 -1.89 1.2222
-0.62404 2.2142
msg_cap1 =% Decoded Msg
0 0 0 1
For EbN0dB=4 ;
disp([EbN0dB R BER_sim Nerrs k*Nblocks]);
4 0.57143 0.01545 618 40000
msg = % Random Input msg
0 1 0 0
cword =
0 1 0 0 1 1 1
%After AWGN Channel Received Code
r = 1.4018 -0.29702 0.51536 0.94538 -1.5975 -1.9073
0.36304
msg_cap1 =
0 1 0 0
5/30/2020
14
Conclusion
 Hamming Code system is very much important where we need only one
error correction and two error detection system, it is very easy to
implement and for large number of block of bits it is more efficient.
5/30/2020
15
5/30/2020
16

More Related Content

What's hot

Error detection correction (CRC)
Error detection correction  (CRC)Error detection correction  (CRC)
Error detection correction (CRC)Karam Munir Butt
 
Error Detection and Correction
Error Detection and CorrectionError Detection and Correction
Error Detection and CorrectionTechiNerd
 
Error Detection And Correction
Error Detection And CorrectionError Detection And Correction
Error Detection And CorrectionRenu Kewalramani
 
Convolution codes and turbo codes
Convolution codes and turbo codesConvolution codes and turbo codes
Convolution codes and turbo codesManish Srivastava
 
Error Detection and Correction - Data link Layer
Error Detection and Correction - Data link LayerError Detection and Correction - Data link Layer
Error Detection and Correction - Data link LayerAbdullaziz Tagawy
 
Digital to analog conversion
Digital to analog conversionDigital to analog conversion
Digital to analog conversionWaseemKhan00
 
Digital to Analog conversion
Digital to Analog conversionDigital to Analog conversion
Digital to Analog conversionMariam Butt
 
Computer Networks Unit 1 Introduction and Physical Layer
Computer Networks Unit 1 Introduction and Physical Layer Computer Networks Unit 1 Introduction and Physical Layer
Computer Networks Unit 1 Introduction and Physical Layer Dr. SELVAGANESAN S
 
Digital modulation techniques...
Digital modulation techniques...Digital modulation techniques...
Digital modulation techniques...Nidhi Baranwal
 
Sampling Theorem, Quantization Noise and its types, PCM, Channel Capacity, Ny...
Sampling Theorem, Quantization Noise and its types, PCM, Channel Capacity, Ny...Sampling Theorem, Quantization Noise and its types, PCM, Channel Capacity, Ny...
Sampling Theorem, Quantization Noise and its types, PCM, Channel Capacity, Ny...Waqas Afzal
 

What's hot (20)

Error detection correction (CRC)
Error detection correction  (CRC)Error detection correction  (CRC)
Error detection correction (CRC)
 
Error Detection and Correction
Error Detection and CorrectionError Detection and Correction
Error Detection and Correction
 
Ethernet
EthernetEthernet
Ethernet
 
Convolutional codes
Convolutional codesConvolutional codes
Convolutional codes
 
Error Detection And Correction
Error Detection And CorrectionError Detection And Correction
Error Detection And Correction
 
Convolution codes and turbo codes
Convolution codes and turbo codesConvolution codes and turbo codes
Convolution codes and turbo codes
 
Turbo codes.ppt
Turbo codes.pptTurbo codes.ppt
Turbo codes.ppt
 
Chapter 10
Chapter 10Chapter 10
Chapter 10
 
Error Detection and Correction - Data link Layer
Error Detection and Correction - Data link LayerError Detection and Correction - Data link Layer
Error Detection and Correction - Data link Layer
 
Turbo Code
Turbo Code Turbo Code
Turbo Code
 
Digital to analog conversion
Digital to analog conversionDigital to analog conversion
Digital to analog conversion
 
BCH Codes
BCH CodesBCH Codes
BCH Codes
 
Chapter 03 cyclic codes
Chapter 03   cyclic codesChapter 03   cyclic codes
Chapter 03 cyclic codes
 
BCH CODE AND DECODING BCH
BCH CODE AND DECODING BCHBCH CODE AND DECODING BCH
BCH CODE AND DECODING BCH
 
Digital to Analog conversion
Digital to Analog conversionDigital to Analog conversion
Digital to Analog conversion
 
Computer Networks Unit 1 Introduction and Physical Layer
Computer Networks Unit 1 Introduction and Physical Layer Computer Networks Unit 1 Introduction and Physical Layer
Computer Networks Unit 1 Introduction and Physical Layer
 
Shannon Fano
Shannon FanoShannon Fano
Shannon Fano
 
Digital modulation techniques...
Digital modulation techniques...Digital modulation techniques...
Digital modulation techniques...
 
Channel coding
Channel coding  Channel coding
Channel coding
 
Sampling Theorem, Quantization Noise and its types, PCM, Channel Capacity, Ny...
Sampling Theorem, Quantization Noise and its types, PCM, Channel Capacity, Ny...Sampling Theorem, Quantization Noise and its types, PCM, Channel Capacity, Ny...
Sampling Theorem, Quantization Noise and its types, PCM, Channel Capacity, Ny...
 

Similar to Hamming code system

Digital logic designing presentation
Digital logic designing presentationDigital logic designing presentation
Digital logic designing presentationHassan Hashmi
 
DCN Error Detection & Correction
DCN Error Detection & CorrectionDCN Error Detection & Correction
DCN Error Detection & CorrectionRohan Bhatkar
 
Performance Comparision of Coded and Un-Coded OFDM for Different Fic Code
Performance Comparision of Coded and Un-Coded OFDM for Different Fic CodePerformance Comparision of Coded and Un-Coded OFDM for Different Fic Code
Performance Comparision of Coded and Un-Coded OFDM for Different Fic CodeIJERA Editor
 
M.TECH, ECE 2nd SEM LAB RECORD
M.TECH, ECE 2nd SEM LAB RECORD M.TECH, ECE 2nd SEM LAB RECORD
M.TECH, ECE 2nd SEM LAB RECORD Arif Ahmed
 
Design and implementation of single bit error correction linear block code sy...
Design and implementation of single bit error correction linear block code sy...Design and implementation of single bit error correction linear block code sy...
Design and implementation of single bit error correction linear block code sy...TELKOMNIKA JOURNAL
 
Single-Bit Parity Detection and Correction using Hamming Code 7-Bit Model
Single-Bit Parity Detection and Correction using Hamming Code 7-Bit ModelSingle-Bit Parity Detection and Correction using Hamming Code 7-Bit Model
Single-Bit Parity Detection and Correction using Hamming Code 7-Bit ModelUniversitas Pembangunan Panca Budi
 
International Journal of Computational Engineering Research(IJCER)
International Journal of Computational Engineering Research(IJCER)International Journal of Computational Engineering Research(IJCER)
International Journal of Computational Engineering Research(IJCER)ijceronline
 
Presentation for the Project on VLSI and Embedded
Presentation for the Project on VLSI and EmbeddedPresentation for the Project on VLSI and Embedded
Presentation for the Project on VLSI and Embeddedlthanuja01
 
13-DataLink_02.ppt
13-DataLink_02.ppt13-DataLink_02.ppt
13-DataLink_02.pptWinterSnow16
 
Reed Solomon Coding For Error Detection and Correction
Reed Solomon Coding For Error Detection and CorrectionReed Solomon Coding For Error Detection and Correction
Reed Solomon Coding For Error Detection and Correctioninventionjournals
 
FPGA Based Decimal Matrix Code for Passive RFID Tag
FPGA Based Decimal Matrix Code for Passive RFID TagFPGA Based Decimal Matrix Code for Passive RFID Tag
FPGA Based Decimal Matrix Code for Passive RFID TagIJERA Editor
 
Forward Bit Error Correction - Wireless Communications
Forward Bit Error Correction - Wireless Communications Forward Bit Error Correction - Wireless Communications
Forward Bit Error Correction - Wireless Communications Surya Chandra
 
Hard Decision Viterbi Decoder: Implementation on FPGA and Comparison of Resou...
Hard Decision Viterbi Decoder: Implementation on FPGA and Comparison of Resou...Hard Decision Viterbi Decoder: Implementation on FPGA and Comparison of Resou...
Hard Decision Viterbi Decoder: Implementation on FPGA and Comparison of Resou...IJERA Editor
 
IRJET- FPGA Implementation of Orthogonal Codes for Efficient Digital Communic...
IRJET- FPGA Implementation of Orthogonal Codes for Efficient Digital Communic...IRJET- FPGA Implementation of Orthogonal Codes for Efficient Digital Communic...
IRJET- FPGA Implementation of Orthogonal Codes for Efficient Digital Communic...IRJET Journal
 
Survey on Error Control Coding Techniques
Survey on Error Control Coding TechniquesSurvey on Error Control Coding Techniques
Survey on Error Control Coding TechniquesIJTET Journal
 

Similar to Hamming code system (20)

Digital logic designing presentation
Digital logic designing presentationDigital logic designing presentation
Digital logic designing presentation
 
DCN Error Detection & Correction
DCN Error Detection & CorrectionDCN Error Detection & Correction
DCN Error Detection & Correction
 
Performance Comparision of Coded and Un-Coded OFDM for Different Fic Code
Performance Comparision of Coded and Un-Coded OFDM for Different Fic CodePerformance Comparision of Coded and Un-Coded OFDM for Different Fic Code
Performance Comparision of Coded and Un-Coded OFDM for Different Fic Code
 
M.TECH, ECE 2nd SEM LAB RECORD
M.TECH, ECE 2nd SEM LAB RECORD M.TECH, ECE 2nd SEM LAB RECORD
M.TECH, ECE 2nd SEM LAB RECORD
 
Design and implementation of single bit error correction linear block code sy...
Design and implementation of single bit error correction linear block code sy...Design and implementation of single bit error correction linear block code sy...
Design and implementation of single bit error correction linear block code sy...
 
Single-Bit Parity Detection and Correction using Hamming Code 7-Bit Model
Single-Bit Parity Detection and Correction using Hamming Code 7-Bit ModelSingle-Bit Parity Detection and Correction using Hamming Code 7-Bit Model
Single-Bit Parity Detection and Correction using Hamming Code 7-Bit Model
 
International Journal of Computational Engineering Research(IJCER)
International Journal of Computational Engineering Research(IJCER)International Journal of Computational Engineering Research(IJCER)
International Journal of Computational Engineering Research(IJCER)
 
Presentation for the Project on VLSI and Embedded
Presentation for the Project on VLSI and EmbeddedPresentation for the Project on VLSI and Embedded
Presentation for the Project on VLSI and Embedded
 
13-DataLink_02.ppt
13-DataLink_02.ppt13-DataLink_02.ppt
13-DataLink_02.ppt
 
error control coding
error control coding error control coding
error control coding
 
Data links
Data links Data links
Data links
 
crc_checksum.pdf
crc_checksum.pdfcrc_checksum.pdf
crc_checksum.pdf
 
Channel Coding (Error Control Coding)
Channel Coding (Error Control Coding)Channel Coding (Error Control Coding)
Channel Coding (Error Control Coding)
 
Reed Solomon Coding For Error Detection and Correction
Reed Solomon Coding For Error Detection and CorrectionReed Solomon Coding For Error Detection and Correction
Reed Solomon Coding For Error Detection and Correction
 
FPGA Based Decimal Matrix Code for Passive RFID Tag
FPGA Based Decimal Matrix Code for Passive RFID TagFPGA Based Decimal Matrix Code for Passive RFID Tag
FPGA Based Decimal Matrix Code for Passive RFID Tag
 
Forward Bit Error Correction - Wireless Communications
Forward Bit Error Correction - Wireless Communications Forward Bit Error Correction - Wireless Communications
Forward Bit Error Correction - Wireless Communications
 
Hard Decision Viterbi Decoder: Implementation on FPGA and Comparison of Resou...
Hard Decision Viterbi Decoder: Implementation on FPGA and Comparison of Resou...Hard Decision Viterbi Decoder: Implementation on FPGA and Comparison of Resou...
Hard Decision Viterbi Decoder: Implementation on FPGA and Comparison of Resou...
 
IRJET- FPGA Implementation of Orthogonal Codes for Efficient Digital Communic...
IRJET- FPGA Implementation of Orthogonal Codes for Efficient Digital Communic...IRJET- FPGA Implementation of Orthogonal Codes for Efficient Digital Communic...
IRJET- FPGA Implementation of Orthogonal Codes for Efficient Digital Communic...
 
Unit-4.pptx
Unit-4.pptxUnit-4.pptx
Unit-4.pptx
 
Survey on Error Control Coding Techniques
Survey on Error Control Coding TechniquesSurvey on Error Control Coding Techniques
Survey on Error Control Coding Techniques
 

More from DILSHAD AHMAD

Spectrum Sensing in Cognitive Radio Network
Spectrum Sensing in Cognitive Radio NetworkSpectrum Sensing in Cognitive Radio Network
Spectrum Sensing in Cognitive Radio NetworkDILSHAD AHMAD
 
Link adaptation and Adaptive coding,modulation system
Link adaptation and Adaptive coding,modulation systemLink adaptation and Adaptive coding,modulation system
Link adaptation and Adaptive coding,modulation systemDILSHAD AHMAD
 
Wireless power transmission for implantable medical devices
Wireless power transmission for implantable medical devicesWireless power transmission for implantable medical devices
Wireless power transmission for implantable medical devicesDILSHAD AHMAD
 
Network information theory,Multiterminal Network,Guassian channels
Network information theory,Multiterminal Network,Guassian channelsNetwork information theory,Multiterminal Network,Guassian channels
Network information theory,Multiterminal Network,Guassian channelsDILSHAD AHMAD
 
MIMO Antenna and Technology installation
MIMO Antenna and Technology installationMIMO Antenna and Technology installation
MIMO Antenna and Technology installationDILSHAD AHMAD
 
Broadband technology wired and wireless
Broadband technology wired and wireless Broadband technology wired and wireless
Broadband technology wired and wireless DILSHAD AHMAD
 
Disaster Risk Reduction Agenda of Urban Africa
Disaster Risk Reduction Agenda of Urban Africa Disaster Risk Reduction Agenda of Urban Africa
Disaster Risk Reduction Agenda of Urban Africa DILSHAD AHMAD
 

More from DILSHAD AHMAD (8)

Spectrum Sensing in Cognitive Radio Network
Spectrum Sensing in Cognitive Radio NetworkSpectrum Sensing in Cognitive Radio Network
Spectrum Sensing in Cognitive Radio Network
 
Link adaptation
Link adaptationLink adaptation
Link adaptation
 
Link adaptation and Adaptive coding,modulation system
Link adaptation and Adaptive coding,modulation systemLink adaptation and Adaptive coding,modulation system
Link adaptation and Adaptive coding,modulation system
 
Wireless power transmission for implantable medical devices
Wireless power transmission for implantable medical devicesWireless power transmission for implantable medical devices
Wireless power transmission for implantable medical devices
 
Network information theory,Multiterminal Network,Guassian channels
Network information theory,Multiterminal Network,Guassian channelsNetwork information theory,Multiterminal Network,Guassian channels
Network information theory,Multiterminal Network,Guassian channels
 
MIMO Antenna and Technology installation
MIMO Antenna and Technology installationMIMO Antenna and Technology installation
MIMO Antenna and Technology installation
 
Broadband technology wired and wireless
Broadband technology wired and wireless Broadband technology wired and wireless
Broadband technology wired and wireless
 
Disaster Risk Reduction Agenda of Urban Africa
Disaster Risk Reduction Agenda of Urban Africa Disaster Risk Reduction Agenda of Urban Africa
Disaster Risk Reduction Agenda of Urban Africa
 

Recently uploaded

Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSCAESB
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 
Analog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAnalog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAbhinavSharma374939
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 

Recently uploaded (20)

Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentation
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
Analog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAnalog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog Converter
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 

Hamming code system

  • 1. Hamming Code System Name- Dilshad Ahmad Roll No-MT/EC/10007/19 Subject Code-EC564 Name- Richa Anand Roll No-MT/EC/10014/19 Subject Code-EC564 ECE Dept. , BIT Mesra, Ranchi, 835215 5/30/2020 1
  • 2. Content  Introduction  Errors  Type of Errors  Hamming Bound  Hamming Code system  Implementation of Hamming Code  Syndrome and Decoding  MATLAB Implementation Flow chart  Source Code  Output  Conclusion 5/30/2020 2
  • 3. Introduction  Data can be corrupted during transmission, For reliable communication, errors must be detected and corrected  So we required a ‘Coding technique’ to overcome these errors at receiver.  There is always some Bit Error Rate so to maintain some QoS we do encoding and Decoding with a particular coding Scheme  So There are Various coding scheme used according to need and Application, like Hamming code, cyclic coding convolutional code etc. 5/30/2020 3
  • 4. Errors  What is Error? o Error is a condition when the output information does not match with the input information. During transmission, digital signals suffer from noise that can introduce errors in the binary bits travelling from one system to other. o That means a 0 bit may change to 1 or a 1 bit may change to 0.  Error Detection: Error detection is the detection of errors caused by noise or other impairments during transmission from the transmitter to the receiver.  Error correction: Error correction is the detection of errors and reconstruction of the original, error-free data. 5/30/2020 4
  • 5. Type of Error:  There are Mainly Three Types of Errors Occurs 1. Single bit error. 2. Multi bits error. 3. Burst bits error. 1 0 1 0 1 0 1 1 1 0 1 0 Single bit error: In a frame, there is only one bit, anywhere though, which is corrupt 1 0 1 0 1 0 0 1 1 0 1 0 Multi bit error: Frame is received with more than one bits in corrupted state. 1 0 1 0 1 0 0 1 1 1 1 1 Burst bit error: Frame contains more than1 consecutive bits corrupted.. 5/30/2020 5
  • 6. Hamming code:  Around 1947 Richard W. Hamming developed technique for detecting and correcting single bit errors in transmitted data. His technique requires that three parity bits (or check bits) be transmitted with every four data bits. The algorithm is called a (7, 4) code, because it requires seven bits to encoded four bits of data.  In communication, Hamming codes are a family of linear error-correcting. Hamming codes can detect up to two-bit or correct one-bit errors without detection of uncorrected errors. 0 0 1 1 0 1 0 1 1 1 1 0 1 0 0 0 1 1 0 1 0 1 1 1 1 0 1 0 Detection Hamming Decoding At Receiver 2 bit Detected At Transmitter 1 0 1 1 0 1 0 Channel At Receiver 1 bit Error Corrected  Now Lets See what is these Hamming codes… 5/30/2020 6
  • 7. Hamming Bound  Any ( n, k ) code which is capable of correcting ‘t’ errors should satisfy the following condition Called Hamming Bound 2 𝑛−𝑘 ≥ 𝑖=0 𝑡 𝑛𝐶𝑖 For t=1(Single Error Correcting code) 2 𝑛−𝑘 ≥n+1  Any code which satisfy the equality condition in the hamming bound called perfect code  For n=7, k=4 Equality condition hold  So (7,4 ) single error correcting perfect code is called Hamming code 5/30/2020 7
  • 8. Implementation of Hamming Code  To implement Hamming code firstly we calculate Parity Bits  Generator Matrix- It is matrix of [I,P] use to encode message bits  For Example  p1 = d2 + d3 + d4 p2 = d1 + d3 + d4 p3 = d1 + d2 + d4 5/30/2020 8
  • 9. Continued…  So for any Message bits (4 bits) we can get code directly using Generator matrix C=[d]*[G]  We send this Codeword through Channel and at receiver we decode this codeword using parity check matrix also we find error is there or not  Let at Receiver we get a received codeword “r” 5/30/2020 9
  • 10. Syndrome and Decoding  Syndrome-The pattern of errors, called the error syndrome, identifies the bit in error.  If all parity bits are correct, there is no error. Otherwise, the sum of the positions of the erroneous parity bits identifies the erroneous bit. S=[r]. [HT] If S =0 No Errors S ≠ 0 Errors are there and we got Error Vector e  S also gives location of error and this location vector verified from [HT] 5/30/2020 10
  • 11. Continued…  At last after getting the error vector e Correct codeword= r + e  This Syndrome Decoding for Hamming Code and error vector can’t correct more than one error vector  For correction more errors we have to add more redundancy 5/30/2020 11
  • 12. MATLAB Implementation  Flow Chart Transmitter Receiver side Channel Start Generator Matrix creation Encoding Parity Generation AWGN Channel Decoding BER Calculation Error Calculations Stop 5/30/2020 12
  • 13. Source Code EbN0dB=2; Energy Per Bit R=4/7; % (7,4) Hamming code Rate EbN0=10^(EbN0dB/10); % Anti Log sigma=sqrt(1/2*R*EbN0); k=4; n=7; Nerrs=0; Nblocks=1000; % 1000 blocks for i = 1:Nblocks msg=randi([0,1],1,k); %Random Msg Generation %Encoding cword=[msg mod(msg(1)+msg(2)+msg(3),2)... mod(msg(2)+msg(3)+msg(4),2)... mod(msg(1)+msg(2)+msg(4),2)]; s=1-2*cword;% BPSK bit to symbol conversion r= s+sigma*randn(1,n); % AWGN CHANNEL % Hard Decoding b=(r<0); % Thresholg at Zero dist= mod(repmat(b,16,1)+cwords,2)*ones(7,1); [mind1,pos]=min(dist); msg_cap1=cwords(pos,1:4); %Soft Decoding corr=(1-2*cwords).*r; [mind2,pos]=max(corr); msg_cap2=cwords(pos,1:4); % Decoded msg Nerrs=Nerrs+sum(msg~=msg_cap1); % Eroors Calculation end BER_sim=Nerrs/k/Nblocks; % BER Calculation % Name: disp([EbN0dB BER_sim Nerrs k*Nblocks]); 5/30/2020 13
  • 14. Output For EbN0dB=2 ; disp([EbN0dB R BER_sim Nerrs k*Nblocks]); 2 0.57143 0.05505 2202 40000 msg = % Random Input msg 0 0 0 1 cword = 0 0 0 1 0 1 1 %After AWGN Channel Received Code r = 1.9644 0.455 1.1051 -1.89 1.2222 -0.62404 2.2142 msg_cap1 =% Decoded Msg 0 0 0 1 For EbN0dB=4 ; disp([EbN0dB R BER_sim Nerrs k*Nblocks]); 4 0.57143 0.01545 618 40000 msg = % Random Input msg 0 1 0 0 cword = 0 1 0 0 1 1 1 %After AWGN Channel Received Code r = 1.4018 -0.29702 0.51536 0.94538 -1.5975 -1.9073 0.36304 msg_cap1 = 0 1 0 0 5/30/2020 14
  • 15. Conclusion  Hamming Code system is very much important where we need only one error correction and two error detection system, it is very easy to implement and for large number of block of bits it is more efficient. 5/30/2020 15