Question: DATA COMMUNICATION ERROR DETECTION-CORRECTION (java ,c ,or c++) create a bit error detection/correction program that includes two separate programs: an encoder and a correcting decoder.

DATA COMMUNICATION ERROR DETECTION-CORRECTION (java ,c ,or c++)

create a bit error detection/correction program that includes two separate programs: an encoder and a correcting decoder. In each program file, you will implement two functions: one that implements a 2-D parity check (called 2D_Parity), and one that implements a Linear Hamming Code (called Hamming).

The encoder program will prompt the user and get two items from the user:

1. For both the encoder and the decoder, the first item will be the code type (0 for Hamming, 1 for 2D_Parity).

2. For the encoder, the second item is the data. The data should be input as a sequence of 0s and 1s.

3. For the decoder, the second item is the received codeword input as a sequence of 0s and 1s.

OUTPUT

Both the encoder and decoder should produce a sequence of 0s and 1s.

The encoder should output the valid codeword.

The decoders output depends on whether the codeword was corrected. When the decoder receives a modified bitstream as input, it should correct any 1-bit errors, and correctly detect any 2-bit errors. If the codeword was corrected, the decoder should output the correct data, followed by a colon, and then the checkbits. For example, if the codeword is 1001101 where the first four bits are data and the last three are checkbits, then 1001:101 should be returned.

If the codeword was not corrected, but errors exist, the decoder should output a message. For 2-bit errors, o the 2D_Parity function should return the string CODEWORD NOT CORRECTED o the Hamming function should return the modified codeword as if it were valid.

VALIDATION

The code should be tested by taking the output of the encoder, changing some bits, and providing the codeword bits as input to the decoder. When using Hamming Code, only a 4-bit data sequence. When using 2D_Parity, you should use a k2 bit sequence where k is between 2 and 10.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!