Final answer:
To compute the data (M) and check (K) bits from a binary file, you need to use the equation 2^K-1 >= M + K. The data bits (M) can be calculated by subtracting K from the total number of bytes (m) read from the file.
Step-by-step explanation:
To compute the data (M) and check (K) bits from a binary file, you need to use the equation 2^K-1 >= M + K. The example you mentioned had a total of 21 bytes read. Let's break down the calculation:
- Let's assume m = 21, which is the total number of bytes.
- Now, we need to find the highest K value that satisfies the equation. In this case, it is 5, because 2^5-1 >= 21 + 5.
- Now, we can find the data bits (M) by subtracting K from m. In the example, 21 - 5 = 16, so m = 16.
Therefore, the data bits (M) is 16 and the check bits (K) is 5.