Question: DONOT DO IT IN CHATGPT EITHER. DO NOT COPY FROM OTHER CHEGG ANSWERS THEY DO NOT WORK. I WILL RATE THE ANSWERS IF YOU COPY
DONOT DO IT IN CHATGPT EITHER. DO NOT COPY FROM OTHER CHEGG ANSWERS THEY DO NOT WORK. I WILL RATE THE ANSWERS IF YOU COPY THEM. [JAVA]
Develop a Single Error Correcting (SEC) Code in the Java programming language, which recives two (binary) files and computes if a transmission error has occurred, and if detected, the bit location of the error.
The input of the program is the following:
Transmit file a binary file containing the transmitted bits (data and check bits)
Receive file a binary file containing the received bits (data and check bits). Four different received files are provided with different data and scenarios.
The program should do the following:
Retrieve the binary data from the transmitted file and calculate its size (in bytes).
Compute the data () and check () bits in the file
Calculate and display the bit location of the check bits.
Extract and display the check bits.
Retrieve the binary data from the received file and calculate its size (in bytes).
Compare the file sizes, and if they are different, display error message and exit program.
If file sizes are the same then:
o Compute the data () and check () bits in the file
o Calculate and display the bit location of the check bits.
o Extract and display the check bits.
Compute the syndrome word, by doing the XOR between the two check bits of the transmitted and received files.
o If the syndrome contains all 0s, no error has been detected.
o If the syndrome contains one and only one bit set to 1, then an error has occurred in one of the check bits. No correction is needed.
o If the syndrome contains more than one bit set to 1, then the numerical value of the syndrome indicates the position of the data bit in error.
Here is an example of what it supposed to look like using Java 

![YOU COPY THEM. [JAVA] Develop a Single Error Correcting (SEC) Code in](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f3bd699196e_76966f3bd698d04a.jpg)
Example Assume that the transmitted file contains the following data using the SEC correction code: 111011001011011001100 Transmitted file read The program should read in the transmitted file data and display the following in the console as given below. Transmitted file content: 111011001011011001100 Total number of bytes read: 21 bytes Calculate the data (M) and check (K) bits The program should compute the M and K bits from the data using the following equation: 2K1M+K This is then displayed as the following: M data bits is: 16 K check bits is: 5 Display the check bits for transmitted file The bit location and those bits from the transmitted file should then be displayed as the following: Location of the k check bits are: 013715 The k check bit values are: 11100 Received file read The program should then read in the received file data and display the following in the console as given below. Assume that it is 111011101011001000111. Received file content: 111011101011001000111 Total number of bytes read: 21 bytes File size checking The program should then check if both the files are the same size. If they are not (assume that the file data is 1110110010110110011001), then it should display an error message and terminate as given below. Received file content: 1110110010110110011001 Total number of bytes read: 22 bytes Files are not the same size! Display the check bits for received file The bit location and those bits from the received file should then be displayed as the following: Location of the k check bits are: 013715 The k check bit values are: 10011 The following is the total program convocation: Transmitted file content: 111011001011011001100 Total number of bytes read: 21 bytes M data bits is: 16 K check bits is: 5 Location of the k check bits are: 013715 The k check bit values are: 11100 Received file content: 111011101011001000111 Total number of bytes read: 21 bytes Location of the k check bits are: 013715 The k check bit values are: 10011 The syndrome word is: 01111 The location of the error bit in the received data is: 15 Experiment One transmitted file and four different received files are provided and the code needs to be test on all these different files. Please ensure that the code is properly documented
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
