4.7k views
1 vote
I'm currently trying to compute the data (M) bits and check (K) bits of a binary file (transmitfile.bin).

I need help as to how to compute and solve for data (m) bits and check (k) bits.
To start, would m = 21 since that's the total number of bytes read? I went ahead and computed this assuming m = 21 and I got k = 5, which is correct according to the example output in the picture below but now I'm confused as to how m = 16 in the example since it was 21 to begin with. Did they subtract k (5) from the initial m (21) to get 16 bits?
Any explanation would be helpful. 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: 2
K−1≥M+K This is then displayed as the following: M data bits is: 16 K check bits is: 5

1 Answer

2 votes

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:

  1. Let's assume m = 21, which is the total number of bytes.
  2. 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.
  3. 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.

User Gautam M
by
7.4k points