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

DCN Microproject

The document is a microproject report on the implementation of Hamming Code using C, submitted by a group of students as part of their Diploma in Information Technology. It includes sections on introduction, methodology, code, output, conclusion, future scope, and references, detailing how Hamming Code is used for error detection and correction in digital communication. The project was guided by Ms. Arati Gaikar and is part of the curriculum set by the Maharashtra State Board of Technical Education.

Uploaded by

kartikd2290
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)
6 views

DCN Microproject

The document is a microproject report on the implementation of Hamming Code using C, submitted by a group of students as part of their Diploma in Information Technology. It includes sections on introduction, methodology, code, output, conclusion, future scope, and references, detailing how Hamming Code is used for error detection and correction in digital communication. The project was guided by Ms. Arati Gaikar and is part of the curriculum set by the Maharashtra State Board of Technical Education.

Uploaded by

kartikd2290
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/ 19

MICROPROJECT REPORT ON

“IMPLEMENTATIION OF HAMMING CODE USING C ”

IN PARTIAL FULFILMENT OF DIPLOMA IN INFORMATION TECHNOLOGY


(Fourth Semester)

In the Subject of
“DATA COMMUNICATION & COMPUTER NETWORK”

AFFILIATED TO
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION ,
MUMBAI

Submitted in partial fulfilment of the requirement of the diploma of Information


Technology

GROUP MEMBERS

Sr.No. NAME ENROLLMENT NO.


1. PRANAY JADHAV 23112230391
2. ASHMIT NAGAONKAR 23112230413
3. GANESH DESHMUKH 23112230422
4. DHANESH VISHE 24112230424

GUIDED BY
Ms. Arati Gaikar

G. V. ACHARYA POLYTECHNIC, SHELU

ACADEMIC YEAR
2024-2025
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION,
MUMBAI

CERTIFICATE

This is to certify that,

The Students of Fourth Semester of Diploma in INFORMATION TECHNOLOGY at


G.V.ACHARYA POLYTECHNIC,SHELU has completed the Micro Project
satisfactorily in Subject Data Communication & Computer Network in the academic
year 2024-2025,as per the MSBTE prescribed curriculum of K Scheme.

Place:-Shelu Enrollment No.:-23112230391


23112230413
23112230422
24112230424
Date:- / / Exam Seat No.:-

Project Guide Head of the Department Principal


Ms. Arati Mrs. Madhura Mrs. Madhura
Gaikar Mahindrakar Mahindrakar
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION,
MUMBAI

CERTIFICATE

This is to certify that Mr.Pranay Rajendra Jadhav,

Enrollment No.23112230391 of Fourth Semester of Diploma in INFORMATION


TECHNOLOGY at G.V.ACHARYA POLYTECHNIC,SHELU has completed the Micro
Project satisfactorily in Subject Data Communication & Computer Network in the
academic year 2024-2025,as per the MSBTE prescribed curriculum of K Scheme.

Place:-Shelu EnrollmentNo.:-23112230391

Date:- / / Exam Seat No.:-

Project Guide Head of the Department Principal


Ms. Arati Mrs.Madhura Mrs.Madhura
Gaikar Mahindrakar Mahindrakar
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION,
MUMBAI

CERTIFICATE

This is to certify that Mr.Ashmit Sandeep Nagaonkar,

Enrollment No.23112230413 of Fourth Semester of Diploma in INFORMATION


TECHNOLOGY at G.V.ACHARYA POLYTECHNIC,SHELU has completed the Micro
Project satisfactorily in Subject Data Communication & Computer Network in the
academic year 2024-2025,as per the MSBTE prescribed curriculum of K Scheme.

Place:-Shelu EnrollmentNo.:-23112230413

Date:- / / Exam Seat No.:-

Project Guide Head of the Department Principal


Ms. Arati Mrs.Madhura Mrs.Madhura
Gaikar Mahindrakar Mahindrakar
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION,
MUMBAI

CERTIFICATE

This is to certify that Mr.Ganesh Sanjay Deshmukh,

Enrollment No.23112230422 of Fourth Semester of Diploma in INFORMATION


TECHNOLOGY at G.V.ACHARYA POLYTECHNIC,SHELU has completed the Micro
Project satisfactorily in Subject Data Communication & Computer Network in the
academic year 2024-2025,as per the MSBTE prescribed curriculum of K Scheme.

Place:-Shelu EnrollmentNo.:-23112230422

Date:- / / Exam Seat No.:-

Project Guide Head of the Department Principal


Ms. Arati Mrs.Madhura Mrs.Madhura
Gaikar Mahindrakar Mahindrakar
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION,
MUMBAI

CERTIFICATE

This is to certify that Mr.Dhanesh Prakash Vishe,

Enrollment No.24112230424 of Fourth Semester of Diploma in INFORMATION


TECHNOLOGY at G.V.ACHARYA POLYTECHNIC,SHELU has completed the Micro
Project satisfactorily in Subject Data Communication & Computer Network in the
academic year 2024-2025,as per the MSBTE prescribed curriculum of K Scheme.

Place:-Shelu EnrollmentNo.:-24112230424

Date:- / / Exam Seat No.:-

Project Guide Head of the Department Principal


Ms. Arati Mrs.Madhura Mrs.Madhura
Gaikar Mahindrakar Mahindrakar
DECLARATION

I under signed hereby declare that the micro project report entitled
"Implementation of Hamming Code Using C". I further declare that
contents of this report are properly citied and well acknowledge. This
present report is not submitted to any other examination of this or any
other institute for the award of any diploma.

Place : Shelu

Date:

Signature of Student

1.

2.

3.

4.
ACKNOWLEDGEMENT

We extend our special thanks to all teaching and non-teaching staff. Success is
nourished under the combination of perfect guidance, care and blessing.
Acknowledgement is the best way to convey Last few years spend in estimated
institution has moulded us into confident and aspiring engineers. We express our
sense of gratitude towards our project guide Ms. Arati Gaikar. It is because of her
valuable guidance, analytical approach encouragement that we could learn, work and
complete the project. We will always cherish great experience work under the
enthusiastic guidance.

We are also grateful to our principal and our vice principal who not only supported us
in our project but also encouraged for every creative activity. We also sincerely give
thanks to our head of department Mrs.Madhura Mahindrakar of computer and its
sector, friends and well-wishers to directly or indirectly contribute for the success of
our maiden mission.
INDEX

SR.NO. TITLE PAGE NO.

1. INTRODUCTION 1

2. METHODOLOGY 2

3. CODE 3

4. OUTPUT 6

5. CONCLUSION 7

6. FUTURE SCOPE 8

7. REFERENCES 10
INTRODUCTION

Hamming Code is an error-detection and error-correction technique used in digital


communication and computer memory systems. It was invented by Richard Hamming
in 1950 to detect and correct single-bit errors in transmitted or stored data.

The implementation of Hamming Code involves adding redundant bits (parity bits) to
the original data to ensure error detection and correction. These parity bits are
strategically placed at specific positions in the data to enable the identification and
correction of errors.

Key Steps in Hamming Code Implementation

1. Determine the Number of Parity Bits

 The number of parity bits (p) is calculated based on the length of the data bits (d)
using the formula:

2p >=d+p+1

 These parity bits help identify error locations in case of single-bit errors.

2. Positioning the Parity Bits

 The parity bits are placed at positions that are powers of 2 (1st, 2nd, 4th, 8th, etc.).
 The remaining positions hold the actual data bits.

3. Calculating Parity Bits

 Each parity bit covers specific bits in the data sequence and is calculated using
even or odd parity.
 Even parity ensures that the number of 1s in the covered set is even, while odd
parity ensures it is odd.

4. Transmitting the Data

 The encoded Hamming Code is transmitted with both data and parity bits.

5. Error Detection and Correction

 On the receiver side, parity checks are performed.


 If an error is detected, the parity bits help pinpoint the exact bit that needs
correction.

Applications of Hamming Code:

 Data transmission in networking to ensure error-free communication.


 Computer memory (ECC RAM) to detect and correct single-bit errors.

1
METHODOLOGY

Hamming Code is an error-detecting and error-correcting code that allows the


detection and correction of single-bit errors in data transmission or storage. The
methodology of implementing Hamming Code involves the following steps:

1. Understanding Hamming Code Basics

Hamming Code adds redundant parity bits to the original data bits to enable error
detection and correction. The position of these parity bits is carefully chosen to ensure
each bit's contribution to error detection.

2. Determining the Number of Parity Bits

The number of parity bits ppp required for ddd data bits is determined using the
formula:

2p >=d+p+1

where:

 d = number of data bits,


 p = number of parity bits.

3. Placing the Parity Bits

The parity bits are inserted at positions that are powers of 2 (1, 2, 4, 8, ...). The
remaining positions are used for data bits.

4. Calculating Parity Bits

Each parity bit covers a specific set of data and parity bits based on their binary
position representation. The parity bits are calculated using even or odd parity:

 Even Parity: The number of 1s in the covered positions (including the parity bit)
should be even.
 Odd Parity: The number of 1s in the covered positions should be odd.

5. Transmitting the Hamming Code

The final encoded message (data + parity bits) is transmitted or stored.

6. Error Detection and Correction

 When the receiver gets the transmitted bits, it recalculates the parity bits and
checks for discrepancies.
 If any parity bit does not match, an error syndrome is generated, which helps
identify the erroneous bit position.

2
CODE
#include <stdio.h>
#include <conio.h>
#include <math.h>

int calculateParityBits(int m) {
int r = 0;
while ((1 << r) < (m + r + 1)) {
r++;
}
return r;
}

void generateHammingCode(int data[], int m) {


int r, n, hammingCode[20];
int i, j, parity;

r = calculateParityBits(m);
n = m + r;
j = 0;

for (i = 0; i < n; i++) {


if ((i + 1) & i) {
hammingCode[i] = data[j++];
} else {
hammingCode[i] = 0;
}
}

for (i = 0; i < r; i++) {


parity = 0;
for (j = 0; j < n; j++) {
if ((j + 1) & (1 << i)) {
parity ^= hammingCode[j];
}
}
hammingCode[(1 << i) - 1] = parity;
}

printf("Hamming code: ");


for (i = 0; i < n; i++) {
printf("%d ", hammingCode[i]);
}

3
printf("\n");
}

void detectError(int hammingCode[], int n) {


int r, errorPos, i, j, parity;

r = calculateParityBits(n - calculateParityBits(n));
errorPos = 0;

for (i = 0; i < r; i++) {


parity = 0;
for (j = 0; j < n; j++) {
if ((j + 1) & (1 << i)) {
parity ^= hammingCode[j];
}
}
if (parity) {
errorPos += (1 << i);
}
}

if (errorPos) {
printf("Error detected at position: %d\n", errorPos);
hammingCode[errorPos - 1] ^= 1;
printf("Corrected Hamming code: ");
for (i = 0; i < n; i++) {
printf("%d ", hammingCode[i]);
}
printf("\n");
} else {
printf("No error detected.\n");
}
}

void main() {
int m, n, data[20], received[20], i;

clrscr();
printf("Enter the number of data bits: ");
scanf("%d", &m);

printf("Enter the data bits: ");


for (i = 0; i < m; i++) {

4
scanf("%d", &data[i]);
}

generateHammingCode(data, m);

n = m + calculateParityBits(m);
printf("Enter received Hamming code: ");
for (i = 0; i < n; i++) {
scanf("%d", &received[i]);
}

detectError(received, n);

getch();
}

5
OUTPUT

6
CONCLUSION

The implementation of Hamming Code is an effective method for error detection and
correction in digital communication and data storage systems. By adding redundant
parity bits to the data, Hamming Code can detect and correct single-bit errors while
detecting (but not correcting) two-bit errors.

Through the process of encoding, transmission, and decoding, Hamming Code


ensures reliable data transfer, making it particularly useful in computer memory (ECC
RAM), networking, and satellite communications. The simplicity of its mathematical
foundation and the efficiency of error correction make it a widely used error control
technique.

However, Hamming Code has limitations, such as increased redundancy and the
inability to correct multiple-bit errors. For higher reliability, advanced error correction
techniques like Hamming (SEC-DED), Reed-Solomon, or BCH codes may be
required.

In conclusion, Hamming Code remains a valuable tool for error correction, balancing
efficiency and simplicity in systems where single-bit error correction is sufficient.

7
FUTURE SCOPE

Hamming Code is a widely used error detection and correction technique, especially
in digital communication and memory systems. While it has been around since the
1950s, its future applications continue to evolve with advancements in technology.
Here are some key areas where Hamming Code is likely to play a significant role in
the future:

1. Quantum Computing and Error Correction

With quantum computing on the rise, error correction remains a critical challenge due
to quantum decoherence.

Modified versions of Hamming Codes could be adapted for quantum error correction
to improve qubit stability.

2. 5G and 6G Communication Networks

As wireless networks become more advanced, the need for efficient error correction
grows.

Hamming Codes can be optimized for low-latency, high-speed data transmission in


next-generation communication networks.

3. Space Communication and Deep Space Missions

Spacecraft and satellites experience high levels of radiation, leading to frequent data
corruption.

Hamming Codes are used in error correction for satellite communication and deep-
space probes, ensuring reliable data transmission over long distances.

4. IoT (Internet of Things) and Embedded Systems

IoT devices operate in challenging environments with noise and interference.

Hamming Codes can provide lightweight error correction mechanisms for IoT sensors
and edge devices.

6. DNA Data Storage and Biotechnology

DNA computing and storage involve encoding information in DNA sequences.

Hamming Codes could help detect and correct errors in DNA sequences, making
biological data storage more reliable.

6. Artificial Intelligence and Machine Learning

AI models require high accuracy in data processing and transmission.

8
Error correction using Hamming Codes could help in improving the reliability of AI-
driven data analytics and cloud computing.

7. Automotive and Autonomous Systems

Self-driving cars and advanced driver-assistance systems (ADAS) rely on massive


amounts of sensor data.

Hamming Codes could be used to ensure error-free transmission in automotive


networks.

8. Cybersecurity and Secure Communication

Data integrity is crucial in secure communications, cryptography, and blockchain


technologies.

Hamming Codes can be integrated into cryptographic protocols to enhance data


protection.

9
REFERENCES

 https://www.geeksforgeeks.org/

 https://en.wikipedia.org/wiki/Hamming_code

10

You might also like