Reference no: EM132155906
Use C program:
Objective:
To check a Hamming code for a single-bit error, and to report and correct the error (if any).
Inputs: The maximum length of a Hamming code The parity of the check bits (even=0, odd=1) The Hamming code
Outputs: The erroneous bit (if any) The corrected Hamming code (if there was an error) Specification:
The program checks a Hamming code for a single-bit error based on choosing from a menu of choices, where each choice calls the appropriate procedure, where the choices are:
1) Enter parameters
2) Check Hamming code
3) Quit program
To use the Math library, use: "#include <math.h>" to access various functions, such as pow(base, exp), log(number), etc. To perform the XOR function, use the operator "^".
To use the String library, use: "#include <string.h>" to access various functions, such as
strlen(string) which returns an integer representing the length of a string of characters.
PLEASE MAKE SURE THE POGRAM RUNSSSSSS.
TEST CASES ARE:
1
12
0
2
1000110
1
21
1
2
1000110
2
1000111
3