Giter VIP home page Giter VIP logo

modified-hamming-code's Introduction

Modified-Hamming-Code

Project implementing the journal paper Modified Hamming Codes To Improve Burst Error using C++.

Basic Outline

Classical Hamming Codes are implemented by taking bits that are located at powers of two as redundancy bits. The value of these bits are calculated as follows:
Bit 1: (BIT 3) XOR (BIT 5) XOR (BIT 7) XOR (BIT 9)...
Bit 2: (BIT 3) XOR (BIT 6) XOR (BIT 7) XOR (BIT 10)...
Bit 4: (BIT 5) XOR (BIT 6) XOR (BIT 7) XOR (BIT 12)...
For instance, if we were to convert 10011010 to a 12 bit Hamming code, it would be represented as __1_001_1010 where _ have to be filled in with redundancy bits.
Bit 1 = 1 XOR 0 XOR 1 XOR 1 XOR 1 = 0
Bit 2 = 1 XOR 0 XOR 1 XOR 0 XOR 1 = 1
Bit 4 = 0 XOR 0 XOR 1 XOR 0 = 1
Bit 8 = 1 XOR 0 XOR 1 XOR 0 = 0 Thus, the final codeword would be 011100101010.

Theoretically, Hamming Codes can correct any 1 bit error that occurs, and detect 2 bit errors. Howerever, practically, we can see that 2 bit burst errors may be incorrectly detected as 1 bit burst errors and corrected. By reordering the bits, we can attempt to maximize the detection of 2 bit and 3 bit errors.

Implementation Details

This project is based on simulating a simple Stop and Wait ARQ to test the error detecting capabilities. The project contains two folder, Original Hamming and Modified Hamming, which implements each respectively. Check.cpp generates Hamming Codes for all 32 bit values and places it into a file Test.txt.
1 bit, 2 bit and 3 bit burst errors are randomly introduced by the program. The sender displays how many errors are being generated, while the receiver displays the detected errors.
H.txt contains the parity bit matrix being used. Errors.txt contains the codewords that would be received if 1 bit errors were produced. Checking against this file allows us to fix all 1 bit burst errors. If an error has occured not belonging to this file, then either a 2 bit or 3 bit burst error has occured.

Executing the Program

  • Compile both Server.cpp and Client.cpp.
  • Run the executable for server, then for client.
  • The server will ask which file to send to the client.
  • The client then stores the transferred file as Out.txt.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.