🎓 BookMCQ
← Back to 10. Error Detection and Correction

📝 Block Coding in Data Link Layer (8 MCQs)

Fixed-Length Datawords and Codewords in Block Coding

Block coding processes data in fixed-size groups rather than treating the entire message as one continuous sequence. Each k-bit dataword is mapped to a corresponding n-bit codeword, where added check bits create structured redundancy. The receiver applies the same block definition to test or recover each codeword independently. This distinction helps the receiver choose an appropriate integrity check for each frame.

The n and k Parameters of a Block Code

The notation (n,k) identifies a block code with n transmitted bits for every k information bits. The number of check bits is n minus k, and the code rate is k divided by n. A code containing 2-k possible datawords selects 2-k valid patterns from the 2-n possible n-bit patterns. Both endpoints must use matching parameters for the check to be interpreted correctly.

Independent Encoding and Decoding of Data Blocks

The sender divides a bit stream into k-bit blocks, looks up or calculates each n-bit codeword, and transmits the encoded sequence. The receiver groups bits into n-bit blocks, checks each against the code rules, and decodes valid or correctable patterns back into k-bit datawords. This check takes place before the receiver accepts the protected information.

A Three-Bit Repetition Code as a Block Code

In a (3,1) repetition code, data bit 0 becomes 000 and data bit 1 becomes 111. A received word 110 is decoded as 1 by majority voting. The extra two bits permit correction of one changed bit, but the code rate is only one-third. The example makes the coding rule visible through a reproducible bit sequence.

Where Block Codes Fit in Link Error Control

Block codes include simple parity codes, Hamming codes, and cyclic codes. They can provide detection or correction depending on the distance between codewords. Framing is still needed to establish where blocks begin and end; coding does not by itself replace frame delimiters or link addressing. Its suitability depends on traffic type, delay limits, and acceptable redundancy overhead.

Block Boundaries and Codeword Interpretation

'Block coding means blocks are routed independently' confuses coding with packet forwarding; it encodes fixed bit groups. 'n is the number of data bits' reverses the notation; n is the codeword length. 'Every block code corrects errors' is false; some only detect them. These distinctions prevent confusion between detection, recovery, and general data integrity.

Calculating Block-Code Length and Rate

Given an (n,k) code, calculate check-bit count and code rate, then trace dataword-to-codeword mapping. Identify valid codewords, examine a received block, and relate minimum Hamming distance to the error capability. Also distinguish fixed-length coding blocks from network-layer packets and data-link frames. Show intermediate steps and state assumptions behind any calculated result.

Block-Code Parameters and Terminology

  • Block code - Encodes fixed-size data groups.
  • k - Counts input information bits.
  • n - Counts output codeword bits.
  • Check bits - Support error checking operations.
  • Code rate - Information fraction per codeword.
  • Codeword set - Contains permitted encoded patterns.
2
Easy
4
Medium
2
Hard

📝 All Block Coding in Data Link Layer MCQs

Q1. In block coding, what symbol represents the total length of a codeword after adding redundant bits?

A.nn ✅
B.kk
C.rr
D.k+rk + r
💡 Difficulty: easy | ✅ Correct: A

📖 Explanation: The total length of each transmitted block after redundancy is denoted by nn. It equals the sum of the original data bits kk and the added redundant bits rr. Therefore the correct symbol is nn, which directly reflects the expanded block size used for encoding.

Q2. If a received block matches one of the valid codewords, which inference is most accurate regarding the transmission?

A.No errors occurred
B.At most one bit error occurred
C.The block is guaranteed error‑free
D.The block may still contain undetected errors ✅
💡 Difficulty: easy | ✅ Correct: D

📖 Explanation: Matching a valid codeword tells the receiver that the pattern conforms to the predefined set, but it does not guarantee that the transmission was flawless. Certain error patterns can transform one valid codeword into another, leaving the error hidden. Hence the safest inference is that undetected errors remain possible.

Q3. Which statement best compares block coding to convolution coding in terms of implementation complexity?

A.Both have identical complexity
B.Block coding is generally simpler to implement than convolution coding ✅
C.Convolution coding requires fewer redundant bits
D.Block coding cannot be used for error detection
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: Block coding operates on fixed‑size blocks and uses straightforward linear transformations, making its hardware or software realization relatively simple. Convolution coding, by contrast, processes a continuous stream with memory elements, requiring shift registers and more intricate circuitry. Therefore block coding is typically less complex to implement.

Q4. Given a block code with dataword size k=4k = 4 and redundant bits r=3r = 3, how many codewords are invalid (unused)?

A.96
B.112 ✅
C.128
D.16
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: First compute the total length n=k+r=7n = k + r = 7. The total number of possible 7‑bit patterns is 27=1282^{7}=128. The number of valid datawords is 2k=24=162^{k}=2^{4}=16. Subtracting gives 128−16=112128-16=112 invalid codewords. Thus option B is correct.

Q5. A transmitted codeword is altered by flipping exactly two bits, and the resulting word is still a valid codeword. What does this reveal about the minimum Hamming distance dmin⁡d_{\min} of the code?

A.dmin⁡≥3d_{\min} \ge 3
B.dmin⁡=2d_{\min} = 2 ✅
C.dmin⁡=1d_{\min} = 1
D.Cannot be determined from the information
💡 Difficulty: hard | ✅ Correct: B

📖 Explanation: If two‑bit errors can map one valid codeword to another, the closest pair of distinct codewords is at a Hamming distance of two. The minimum Hamming distance therefore equals two, meaning the code can reliably detect single‑bit errors but not all double‑bit errors. Hence option B is correct.

Q6. If the number of redundant bits rr is increased while keeping the dataword size kk fixed, what happens to the code rate R=kk+rR = \frac{k}{k+r}?

A.The code rate increases
B.The code rate stays the same
C.The code rate decreases ✅
D.The code rate becomes undefined
💡 Difficulty: hard | ✅ Correct: C

📖 Explanation: The code rate measures the proportion of useful data in each transmitted block. With kk constant and rr growing, the denominator k+rk+r becomes larger while the numerator stays the same, so the fraction kk+r\frac{k}{k+r} gets smaller. Consequently the code rate declines, making option C correct.

Q7. Which of the following generator matrices GG defines a \(5,3)\ block code capable of detecting any single‑bit error?

A.G = \\begin{bmatrix}1&0&0&1&0\\\\0&1&0&0&1\\\\0&0&1&1&1\\end{bmatrix} \ ✅
B.G = \\begin{bmatrix}1&0&0&0&0\\\\0&1&0&0&0\\\\0&0&1&0&0\\end{bmatrix} \
C.G = \\begin{bmatrix}1&1&0&0&1\\\\0&1&1&1&0\\\\1&0&1&1&0\\end{bmatrix} \
D.G = \\begin{bmatrix}1&0&1&0&1\\\\0&1&0&1&0\\\\1&1&0&0&1\\end{bmatrix} \
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: A generator matrix that adds parity bits to each data bit ensures any single‑bit alteration changes at least one parity check, making the error detectable. Matrix A appends three parity columns that are linear combinations of the three data columns, providing the necessary redundancy. The other matrices either lack parity or do not guarantee single‑error detection, so A is correct.

Q8. A receiver does not have an explicit list of valid codewords but knows the generator matrix used for encoding. Can it still detect errors, and if so, how?

A.No, a list is required for any detection
B.Yes, by recomputing the codeword and comparing
C.Yes, by calculating the syndrome and checking if it is zero ✅
D.Only for burst errors
💡 Difficulty: medium | ✅ Correct: C

📖 Explanation: Even without a stored list, the receiver can multiply the received vector by the parity‑check matrix derived from the generator matrix to obtain a syndrome. If the syndrome equals the zero vector, the block is considered valid; any non‑zero syndrome indicates an error. This syndrome‑checking method enables error detection, making option C correct.

🔗 Related Topics (MCQs)