0% found this document useful (0 votes)
20 views18 pages

DCC HammingCode

Uploaded by

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

DCC HammingCode

Uploaded by

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

Maharashtra Board of

Technical Education, Mumbai.


Government Polytechnic,
Solapur.

DIPLOMA IN COMPUTER TECHNOLOGY


Academic year: 2022-2023
A
MICROPROJECT ON

‘ Implementation of Hamming Code in


Java ’
Submitted by:-
Roll
Name Enrollment no.
No.
29 Sushrut Sunil Gaikwad. 2100150029

31 Vivekanand Bharat Garande 2100150031

33 Prajwal Appasaheb Hipparge 2100150034

35 Prajwal Yuvraj Jadhav 2100150036


CERTIFICATE
The micro project report of

‘Implementation of Hamming Code in


Java
Is the work of
Roll No. Name Enrollment
No.
35 Prajwal Yuvraj Jadhav 2100150036

The student of third semester from Diploma in Computer


Technology Engineering of the subject DCC year(2022-23).
This report is partial fulfilment for the award of the Micro-
Project Diploma in Computer Technology Engineering. By
MSBTE, Mumbai

Guide Name:- APARNA DUSSA MAM

Date & sign:-

HOD:-

Principal:-
Index

Sr No. Title

1 Introduction

2 Abstract

3 Acknowledgement
Working of Hamming
4
Code
5 Detection and correction
Implementation of
6
Hamming Code in Java
Limitations of Hamming
7
Code
Applications of
8
Hamming Code
9 Conclusion
Introduction

Hamming code is a type of error-


correcting code used in data
communication. It was developed by
Richard Hamming in the 1950s and has
since become an important tool for
ensuring the accuracy of transmitted data.

The basic idea behind Hamming code is to


add extra bits to a message that allow the
receiver to detect and correct errors that
may have occurred during transmission.
These extra bits are called parity bits and
are calculated based on the original
message using a specific algorithm.
Abstract
. This project implements Hamming Code,
a popular error detection and correction
technique, using the Java programming
language. The report outlines the theory
behind Hamming Code, explains the
design of the Java program, and presents
test results showcasing its effectiveness in
detecting and correcting errors. The
limitations of Hamming Code are
discussed, and alternative techniques are
briefly explored. Overall, this project
contributes to the understanding of error
detection and correction and provides a
valuable resource for future projects in this
area.
Acknowledgement
We would like to express our special
thanks to gratitude to our respected Aparna
Mam, as well as our principal who gave us
the Golden opportunity to do this
wonderful project on the topic, which also
helped in doing a lot to research and also,
we came to know about so many new and
interesting things.
We would like to express our thankfulness
to Head of the department and other
faculty members of our second-year
department for extending their support and
motivation.

Thank you….!!
Working Of Hamming Code

Hamming code works by adding parity bits to a


message in a way that allows the receiver to detect
and correct errors. The number of parity bits added
depends on the length of the original message and
the desired level of error correction.

When a message is transmitted, the receiver


calculates the parity bits using the same algorithm
as the sender. If any errors are detected, the
receiver can use the parity bits to determine which
bit(s) were incorrect and correct them accordingly.
Detection and Correction
• Eg: If the 7 bit Hamming code word
received by a receiver is 1011011.
• Assuming the even parity check
whether code is write or wrong ,if
wrong locate it and correct it.

1 0 1 1 0 1 1

Analyze parity bits apply even parity


result should be 0.
P1 D3 D5 D7=1 0 1 1 =1
P1 error ->so put P1=1 in Error word

1
Error Word
1 0 1 1 0 1 1

0 1

• P2 D3 D6 D7=1 0 0 1=0
P2 there is no error ->so put P2=0 in
Error word
• P4 D5 D6 D7= 1 1 0 1=1
P4 is having error P4 ->so put P4=1 in
Error word
If all P1,P2,P3 result is 0 then
transmitted data is correct.

1 0 1
Write the word
Error word

1 0 1

Here 5th bit is having error


E=(5)10
Error correction

There is error in 5th bit so invert it 1 to 0

1 0 1 1 0 1 1

Corrected Code

1 0 0 1 0 1 1
Implementation of Hamming
Code in Java
Output

PS C:\Users\amitl> cd

"c:\Users\amitl\OneDrive\Documents\jdk1.8.0_202\bin\"; if ($?) { javac


HammingCode.java}; if ($?) javaHammingCode}

Enter the data bits: 101010

Encoded data: 1011100000

Enter the received data: 101010101

Decoded data: 11011

PS C:\Users\amitl\OneDrive\Documents\jdk1.8.0_202\bin>
Limitations of Hamming
Code
While Hamming code is effective at
detecting and correcting errors, it does
have some limitations. One limitation
is that it can only correct single-bit
errors. If multiple bits are flipped
during transmission, Hamming code
may not be able to correct them.

Another limitation is that Hamming


code adds significant overhead to
transmitted data. This means that more
bandwidth is required to transmit the
same amount of information when
using Hamming code compared to not
using error correction.
Applications Of Hamming
Code
Hamming code is used in a variety of
applications where reliable
transmission of data is critical. One
common application is in computer
memory, where error correction is
necessary to ensure that data is stored
and retrieved accurately.

Hamming code is also used in


telecommunications, satellite
communications, and other forms of
digital communication. In these
applications, Hamming code helps to
ensure that data is transmitted
accurately over noisy channels.
Conclusion
Hamming code is a powerful tool for
ensuring the accuracy of transmitted
data. While it has some limitations, its
benefits make it a popular choice for
applications where error-free
transmission of data is critical.

As technology continues to advance, it


is likely that new error-correcting codes
will be developed. However, for now,
Hamming code remains an important
part of the digital communication
landscape.
References
• www.javatutorialspoint.com

• www.geeksforgeeks.org

• En.m.wikipedia.org

You might also like