SlideShare a Scribd company logo
Module IV – Perfect Codes & Hamming Codes
Lakshmi V.S.
Assistant Professor
Electronics & Communication Department
Sree Chitra Thirunal College of Engineering, Trivandrum
Perfect Codes
• Perfect codes are binary codes which satisfies Hamming bound with equality
• A Perfect Code is a t-error correcting code where its standard array has all error patterns of
t or fewer errors and no others as coset leaders
• Examples
 odd-length binary repetition codes (eg. (3, 1), (5,1),..) (these codes contain two
codewords: an all-zero codeword and an all-one codeword),
 binary Hamming codes with dmin = 3
2
Hamming Bound ,2
𝑛 −𝑘
≥∑
𝑗=0
𝑡
(𝑛
𝑗)
Department of Applied Electronics & Instrumentation
Hamming Codes
• Hamming codes are single error correcting perfect codes.
• As t = 1, RHS = =+ =1+n
• LHS = (by considering
• Since Hamming codes satisfies Hamming bound with equality
3
Department of Applied Electronics & Instrumentation
Hamming Codes - Parameters
• Hamming codes are single error correcting perfect codes.
• For any positive integer m≥3, there exists a Hamming code such that:
 Code Length: n = 2m
- 1
 No. of information symbols: k = n-m =2m
- m-1
 No. of parity check symbols: n-k = m
 Error correcting capability: t = 1 (i.e., dmin=3)
• m = 3  (7, 4) Hamming code (n = 2m
-1=7 & k = n-m = 4)
• m = 4  (15, 11) Hamming code (n = 2m
-1=15 & k = n-m = 11)
• m = 5  (31, 26) Hamming code (n = 2m
-1=31 & k = n-m = 26)
4
Department of Applied Electronics & Instrumentation
Hamming Codes
• The parity-check matrix H of Hamming code consists of all possible nonzero m-tuple ((n-k)
tuple) as its columns since n = 2m
- 1
• For (7, 4) systematic Hamming code, H matrix is of size 3 x 7 (n-k x n)
5
PT
3 x 4
I3
3 x 3
I3
3 x 3
PT
3 x 4
Department of Applied Electronics & Instrumentation
Systematic Hamming Codes
•
•
6
I3
3 x 3
PT
3 x 4
P
4 x 3
I4
4 x 4
dmin = 3
edet s  dmin –1, s = 2
ecorr , t = 1
Department of Applied Electronics & Instrumentation
Hamming Codes
• Using the G matrix, the codewords can be generated as v = u.G as in the case of LBC.
• Decoding can be done using standard array and syndrome decoding.
• Encoder circuit, syndrome circuit and decoder circuit are same as that
of LBC.
7
Department of Applied Electronics & Instrumentation
• = .
 v0  u0  u2  u3
 v1  u0  u1  u2
 v2  u1  u2  u3
 v3  u0
 v4  u1
 v5  u2
 v6  u3
8
Encoder – (7, 4) Systematic Hamming Code
Department of Applied Electronics & Instrumentation
Encoder – (7, 4) Systematic Hamming Code
 v0  u0  u2  u3
 v1  u0  u1  u2
 v2  u1  u2  u3
 v3  u0
 v4  u1
 v5  u2
 v6  u3
9
Department of Applied Electronics & Instrumentation
Decoder – (7, 4) Systematic Hamming Code
• = .
 s0  r0  r3  r5  r6
 s1  r1  r3  r4  r5
 s2  r2  r4  r5  r6
10
Department of Applied Electronics & Instrumentation
Decoder – (7, 4) Systematic Hamming Code
11
Department of Applied Electronics & Instrumentation
Decoder – (7, 4) Systematic Hamming Code
12
Department of Applied Electronics & Instrumentation
Decoder – (7, 4) Systematic Hamming Code
13
Department of Applied Electronics & Instrumentation
Decoder – (7, 4) Systematic Hamming Code
14


H T =
[
1 0 0
0 1 0
0 0 1
1 1 0
0 1 1
1 1 1
1 0 1
]
Department of Applied Electronics & Instrumentation
Decoding Circuit for (7, 4) Systematic Hamming Code
15
 s0  r0  r3  r5  r6
 s1  r1  r3  r4  r5
 s2  r2  r4  r5  r6


Non Systematic Hamming Codes
• A non-systematic Hamming code can be constructed by placing the parity check bits at 2l
(l
= 0, 1, 2, 3, …) locations of G matrix
• Procedure for constructing non-systematic Hamming code
 Step 1: Write the BCD of length (n – k) for decimals from 1 to n.
 Step 2: Arrange the sequences in the reverse order in a matrix form.
 Step 3: Transpose of the matrix obtained in step 2 gives the parity check matrix, H for
the code.
16
Department of Applied Electronics & Instrumentation
(7, 4) Non Systematic Hamming Codes
 Step 1: Write the BCD of length (n – k) for decimals from 1 to n.
17
Department of Applied Electronics & Instrumentation
(7, 4) Non Systematic Hamming Codes
 Step 2: Arrange the sequences in the reverse order in a matrix form to form HT
.
 Step 3: Transpose of the matrix obtained in step 2 gives the parity check matrix, H for
the code.
18
(7, 4) Non Systematic Hamming Codes
• A non-systematic Hamming code can be constructed by placing the parity check bits at 2l
(l
= 0, 1, 2, 3, …) locations of G matrix
• 1, 2 & 4 columns in H matrix are part of identity matrix
• Select each row elements from remaining columns of H as part of PT
and place it as 1, 2 and
4 columns of G.
• Fill the remaining columns of G with columns of identity matrix.
19
• The parity bit equations are
• .The codeword format for non-systematic Hamming code is
(7, 4) Non Systematic Hamming Codes
20
Department of Applied Electronics & Instrumentation
(7, 4) Non Systematic Hamming Codes
21
v = u.G
Decoding - (7, 4) Non Systematic Hamming Codes
22
s = e.HT
Department of Applied Electronics & Instrumentation
THANK YOU…
Department of Electronics & Communication 23

More Related Content

PPTX
Presentation for the Project on VLSI and Embedded
PPTX
Error Detection N Correction
PPT
The Data Link Layer
PPT
5 linear block codes
PPT
Hamming codes
PPTX
Hamming code system
PPT
f33-ft-computing-lec09-correct.ppt
Presentation for the Project on VLSI and Embedded
Error Detection N Correction
The Data Link Layer
5 linear block codes
Hamming codes
Hamming code system
f33-ft-computing-lec09-correct.ppt

Similar to Error Control Codes or Channel Codes -Haming Codes (20)

PPTX
PDF
Decoding Parity Code Error(S): Analysis Of Algorithmic Method Of Hamming Code...
PDF
B041306015
PPTX
Error Detection and Correction presentation
PPTX
Lecture7.pptxhfjgjgjghcgzgzfzfzvzgxhchchc
PDF
Error Control coding
PPT
3F4ecc.ppt
PPTX
Linear Block Codes
PPT
3F4ecc.ppten cje cen cne cdn en c e cnec cen
PDF
Hamming code checksum
PDF
Design and implementation of single bit error correction linear block code sy...
PDF
Hamming net based Low Complexity Successive Cancellation Polar Decoder
PPTX
MODULE_2_Ch4_01082014.pptx .
PDF
Coding theory.pdf
PPT
Error detection and correction codes
PPT
Digital Communication: Channel Coding
PDF
Checksum & Hamming Code
PPTX
Error Correcting and Error Detecting Codes.pptx
PDF
Module 5 of internet to things vtu notes
DOCX
Calculating the hamming code (tutorial)
Decoding Parity Code Error(S): Analysis Of Algorithmic Method Of Hamming Code...
B041306015
Error Detection and Correction presentation
Lecture7.pptxhfjgjgjghcgzgzfzfzvzgxhchchc
Error Control coding
3F4ecc.ppt
Linear Block Codes
3F4ecc.ppten cje cen cne cdn en c e cnec cen
Hamming code checksum
Design and implementation of single bit error correction linear block code sy...
Hamming net based Low Complexity Successive Cancellation Polar Decoder
MODULE_2_Ch4_01082014.pptx .
Coding theory.pdf
Error detection and correction codes
Digital Communication: Channel Coding
Checksum & Hamming Code
Error Correcting and Error Detecting Codes.pptx
Module 5 of internet to things vtu notes
Calculating the hamming code (tutorial)
Ad

More from ssuser478d0e (9)

PPTX
Arduino basics & programming skill development
PPTX
INTRODUCTION_TO_ARDUINO uno, applications
PPTX
Arduino uno details and Workshop contents
PPT
Arduino description and interfacing details
PPTX
Error Control Codes or Channel Codes - Cyclic Codes
PPT
Bandpass Signalling & Communication Aspects
PPT
Chaos based cryprography - encryption & hash function
PDF
Irrigation PPT.pdf
PPTX
chap3.pptx
Arduino basics & programming skill development
INTRODUCTION_TO_ARDUINO uno, applications
Arduino uno details and Workshop contents
Arduino description and interfacing details
Error Control Codes or Channel Codes - Cyclic Codes
Bandpass Signalling & Communication Aspects
Chaos based cryprography - encryption & hash function
Irrigation PPT.pdf
chap3.pptx
Ad

Recently uploaded (20)

PDF
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
PDF
Well-logging-methods_new................
PDF
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
PPTX
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
PPT
Project quality management in manufacturing
PDF
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
PPTX
UNIT-1 - COAL BASED THERMAL POWER PLANTS
PPT
CRASH COURSE IN ALTERNATIVE PLUMBING CLASS
PPTX
additive manufacturing of ss316l using mig welding
PDF
Digital Logic Computer Design lecture notes
PPTX
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
PPTX
Welding lecture in detail for understanding
PDF
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
PPTX
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
PDF
composite construction of structures.pdf
PDF
Automation-in-Manufacturing-Chapter-Introduction.pdf
PPT
Mechanical Engineering MATERIALS Selection
PPTX
CH1 Production IntroductoryConcepts.pptx
DOCX
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
Well-logging-methods_new................
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
Project quality management in manufacturing
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
UNIT-1 - COAL BASED THERMAL POWER PLANTS
CRASH COURSE IN ALTERNATIVE PLUMBING CLASS
additive manufacturing of ss316l using mig welding
Digital Logic Computer Design lecture notes
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
Welding lecture in detail for understanding
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
composite construction of structures.pdf
Automation-in-Manufacturing-Chapter-Introduction.pdf
Mechanical Engineering MATERIALS Selection
CH1 Production IntroductoryConcepts.pptx
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx

Error Control Codes or Channel Codes -Haming Codes

  • 1. Module IV – Perfect Codes & Hamming Codes Lakshmi V.S. Assistant Professor Electronics & Communication Department Sree Chitra Thirunal College of Engineering, Trivandrum
  • 2. Perfect Codes • Perfect codes are binary codes which satisfies Hamming bound with equality • A Perfect Code is a t-error correcting code where its standard array has all error patterns of t or fewer errors and no others as coset leaders • Examples  odd-length binary repetition codes (eg. (3, 1), (5,1),..) (these codes contain two codewords: an all-zero codeword and an all-one codeword),  binary Hamming codes with dmin = 3 2 Hamming Bound ,2 𝑛 −𝑘 ≥∑ 𝑗=0 𝑡 (𝑛 𝑗) Department of Applied Electronics & Instrumentation
  • 3. Hamming Codes • Hamming codes are single error correcting perfect codes. • As t = 1, RHS = =+ =1+n • LHS = (by considering • Since Hamming codes satisfies Hamming bound with equality 3 Department of Applied Electronics & Instrumentation
  • 4. Hamming Codes - Parameters • Hamming codes are single error correcting perfect codes. • For any positive integer m≥3, there exists a Hamming code such that:  Code Length: n = 2m - 1  No. of information symbols: k = n-m =2m - m-1  No. of parity check symbols: n-k = m  Error correcting capability: t = 1 (i.e., dmin=3) • m = 3  (7, 4) Hamming code (n = 2m -1=7 & k = n-m = 4) • m = 4  (15, 11) Hamming code (n = 2m -1=15 & k = n-m = 11) • m = 5  (31, 26) Hamming code (n = 2m -1=31 & k = n-m = 26) 4 Department of Applied Electronics & Instrumentation
  • 5. Hamming Codes • The parity-check matrix H of Hamming code consists of all possible nonzero m-tuple ((n-k) tuple) as its columns since n = 2m - 1 • For (7, 4) systematic Hamming code, H matrix is of size 3 x 7 (n-k x n) 5 PT 3 x 4 I3 3 x 3 I3 3 x 3 PT 3 x 4 Department of Applied Electronics & Instrumentation
  • 6. Systematic Hamming Codes • • 6 I3 3 x 3 PT 3 x 4 P 4 x 3 I4 4 x 4 dmin = 3 edet s  dmin –1, s = 2 ecorr , t = 1 Department of Applied Electronics & Instrumentation
  • 7. Hamming Codes • Using the G matrix, the codewords can be generated as v = u.G as in the case of LBC. • Decoding can be done using standard array and syndrome decoding. • Encoder circuit, syndrome circuit and decoder circuit are same as that of LBC. 7 Department of Applied Electronics & Instrumentation
  • 8. • = .  v0  u0  u2  u3  v1  u0  u1  u2  v2  u1  u2  u3  v3  u0  v4  u1  v5  u2  v6  u3 8 Encoder – (7, 4) Systematic Hamming Code Department of Applied Electronics & Instrumentation
  • 9. Encoder – (7, 4) Systematic Hamming Code  v0  u0  u2  u3  v1  u0  u1  u2  v2  u1  u2  u3  v3  u0  v4  u1  v5  u2  v6  u3 9 Department of Applied Electronics & Instrumentation
  • 10. Decoder – (7, 4) Systematic Hamming Code • = .  s0  r0  r3  r5  r6  s1  r1  r3  r4  r5  s2  r2  r4  r5  r6 10 Department of Applied Electronics & Instrumentation
  • 11. Decoder – (7, 4) Systematic Hamming Code 11 Department of Applied Electronics & Instrumentation
  • 12. Decoder – (7, 4) Systematic Hamming Code 12 Department of Applied Electronics & Instrumentation
  • 13. Decoder – (7, 4) Systematic Hamming Code 13 Department of Applied Electronics & Instrumentation
  • 14. Decoder – (7, 4) Systematic Hamming Code 14   H T = [ 1 0 0 0 1 0 0 0 1 1 1 0 0 1 1 1 1 1 1 0 1 ] Department of Applied Electronics & Instrumentation
  • 15. Decoding Circuit for (7, 4) Systematic Hamming Code 15  s0  r0  r3  r5  r6  s1  r1  r3  r4  r5  s2  r2  r4  r5  r6  
  • 16. Non Systematic Hamming Codes • A non-systematic Hamming code can be constructed by placing the parity check bits at 2l (l = 0, 1, 2, 3, …) locations of G matrix • Procedure for constructing non-systematic Hamming code  Step 1: Write the BCD of length (n – k) for decimals from 1 to n.  Step 2: Arrange the sequences in the reverse order in a matrix form.  Step 3: Transpose of the matrix obtained in step 2 gives the parity check matrix, H for the code. 16 Department of Applied Electronics & Instrumentation
  • 17. (7, 4) Non Systematic Hamming Codes  Step 1: Write the BCD of length (n – k) for decimals from 1 to n. 17 Department of Applied Electronics & Instrumentation
  • 18. (7, 4) Non Systematic Hamming Codes  Step 2: Arrange the sequences in the reverse order in a matrix form to form HT .  Step 3: Transpose of the matrix obtained in step 2 gives the parity check matrix, H for the code. 18
  • 19. (7, 4) Non Systematic Hamming Codes • A non-systematic Hamming code can be constructed by placing the parity check bits at 2l (l = 0, 1, 2, 3, …) locations of G matrix • 1, 2 & 4 columns in H matrix are part of identity matrix • Select each row elements from remaining columns of H as part of PT and place it as 1, 2 and 4 columns of G. • Fill the remaining columns of G with columns of identity matrix. 19
  • 20. • The parity bit equations are • .The codeword format for non-systematic Hamming code is (7, 4) Non Systematic Hamming Codes 20 Department of Applied Electronics & Instrumentation
  • 21. (7, 4) Non Systematic Hamming Codes 21 v = u.G
  • 22. Decoding - (7, 4) Non Systematic Hamming Codes 22 s = e.HT Department of Applied Electronics & Instrumentation
  • 23. THANK YOU… Department of Electronics & Communication 23