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 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). 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. 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. As an example, consider the following array and the corresponding horizontal and vertical parity bits marked in blue. 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. It operates by arranging a sequence of bits into a two-dimensional array and then computing the parity values for each row and column. Transcribed image text: A two-dimensional parity check code is used to detect errors that occur in the storage and transmission of bits.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |