Question: A two-dimensional parity check code is used to detect errors that occur in the storage and transmission of bits. It operates by arranging a sequence

 A two-dimensional parity check code is used to detect errors that
occur in the storage and transmission of bits. It operates by arranging
a sequence of bits into a two-dimensional array and then computing the

A two-dimensional parity check code is used to detect errors that occur in the storage and transmission of bits. It operates by arranging a sequence of bits into a two-dimensional array and then computing the parity values for each row and column. For a given row (column) of the array, the corresponding parity bit is equal to 1 if the number of ones in that row (column) is odd, and o otherwise. As an example, consider the following array and the corresponding horizontal and vertical parity bits marked in blue. 1011110 100001 001111 1111111 0101010 10111 The horizontal parity of the first line is 0 because there is an even number of ones in that row. Similarly, the corresponding vertical parity of the first column is 1 because there is an odd number of ones in that column You are given a two-dimensional array of size 5x5 that contains only binary values. You are to compute the "parity" values of this array Develop a program that: a) Reads a 5x5 two-dimensional array from file array.txt (create that file). Use the following function prototype for reading the array void readAr (FILE *in, int x( ) 5]) b) Computes the parity bits c) Prints the 2 dim array plus parities on screen Sample Output Parity Array: 10111 10000 00111 1 1 1 1 1 01010 Horizontal Parity: 01110 Vertical Parity: 10111 main.c 1 #include 2 #define SIZE 5 3 4 void readAr(FILE *in, int x[SIZE]); // reads the file values into array x 5 6 int main(void) { 7 8 return 0; 9} 11 void readAr(FILE *in, int x[[SIZE]){ 12 while 13 // read array file in here and store values to x 14 } 10 array 2.txt 1 @ @ @ @ @ 1 1 1 1 1 1 1 1

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!