GATE 2026 EC Q.63
The average bit error rate at the input of a (7, 4, 1) Hamming decoder is 0.10. The probability that the decoder will fail to decode a received word correctly is __. (rounded off to two decimal places)
IN THE EC SYLLABUS
Error detection and correction adds controlled redundancy to the data so that the receiver can notice, and sometimes repair, bits flipped by the channel. For GATE you need the distance rules (detect d_min - 1, correct floor((d_min - 1)/2)), the matrix tools of linear block codes (generator matrix, parity-check matrix, syndrome), the Hamming bound, the (7,4) Hamming code in both its systematic and positional forms, block-error probability on a binary symmetric channel, and the CRC computed by polynomial division over GF(2).
5 previous-year questions · 5 solved · 5 practice questions
A block code maps message bits to an -bit codeword, with . The extra bits are redundancy. Only of the possible words are valid codewords, so a received word that is not a codeword tells the receiver that bits were flipped.
CODE RATE
Fraction of transmitted bits that carry message information; for an block code, since .
The Hamming distance between two words of equal length is the number of positions in which they differ. The minimum distance of a code is the smallest Hamming distance between any two distinct codewords. The Hamming weight of a word is its number of 1s. Any pattern of between and flipped bits always turns a codeword into a word that is not a codeword.
DETECTION CAPABILITY
A code with minimum distance is guaranteed to detect every pattern of up to bit errors, when it is used for detection only.
CORRECTION CAPABILITY
Guaranteed number of correctable errors when the receiver decodes to the nearest codeword (the spheres of radius around codewords do not overlap).
SIMULTANEOUS CORRECTION AND DETECTION
With this distance the decoder corrects every pattern of up to errors and, at the same time, detects (flags without miscorrecting) every pattern of up to errors. Here is a total number of errors, not extra errors.
For a linear code the minimum distance equals the smallest Hamming weight among the nonzero codewords, because the sum of two codewords is again a codeword.
EXAM TIP
Detection and correction rules are guarantees. A code may do better on particular error patterns, but the formulas above count only what is certain for every pattern. Also note that correcting errors and detecting errors are alternatives, not both at once: use for a mix.
A single even-parity bit is appended so that the total number of 1s in the codeword is even (odd parity makes it odd). The result is an code with . It detects every odd number of bit errors and misses every even number of errors. It cannot correct anything, because it does not say which bit is wrong.
The repetition code sends each bit times. Its two codewords are all-0s and all-1s, so . For odd , a majority vote corrects up to errors; the rate is only .
A linear block code is one where the sum (modulo 2, bitwise XOR) of any two codewords is a codeword. It is described by a generator matrix . All arithmetic is over GF(2): .
ENCODING
Row vector (length ) times gives the codeword (length ), all operations modulo 2.
SYSTEMATIC FORM
Message bits appear unchanged in the first positions of the codeword; is . Over GF(2), .
PARITY-CHECK CONDITION
is . A word is a codeword exactly when every parity check is satisfied.
DISTANCE FROM H
For a linear code. Equivalently, exactly when all columns of are nonzero and distinct.
Let be the received word, where is the error pattern (1 in each flipped position). The receiver computes the syndrome, which depends on the error pattern only, not on which codeword was sent.
SYNDROME
means is a valid codeword (no detectable error). A nonzero means an error occurred.
Syndrome decoding procedure
Compute .
If , accept .
Otherwise find the lowest-weight error pattern whose syndrome equals ; on a binary symmetric channel with bit-error probability this is the most likely pattern (for a single error, the column of that equals tells the position).
Correct by and read off the message bits.
For a single error in position , the syndrome is the -th column of . So to correct every single error the columns must be nonzero (otherwise an error would be invisible) and distinct (otherwise two error positions would give the same syndrome).
HAMMING (SPHERE-PACKING) BOUND
Any binary code that corrects every pattern of up to errors must satisfy this: the syndromes must label every correctable error pattern, including the no-error pattern. A code that meets it with equality is called perfect.
A Hamming code is a single-error-correcting linear code with . Its parity-check matrix has, as columns, all the nonzero binary vectors of length , each used once.
NUMBER OF PARITY BITS
Smallest that lets data bits be protected against any single error: the check bits must label the error positions plus the no-error case.
HAMMING CODE PARAMETERS
Full-length Hamming code, . Correct one error, or detect two (not both together). Since , it meets the Hamming bound with exactly, so Hamming codes are perfect.
r | n | k | Code | Rate k/n |
|---|---|---|---|---|
3 | 7 | 4 | (7,4) | 4/7 |
4 | 15 | 11 | (15,11) | 11/15 |
5 | 31 | 26 | (31,26) | 26/31 |
The (7,4) code used in this chapter has, in systematic form, the matrices below.
(7,4) HAMMING CODE MATRICES
Codeword is (d1 d2 d3 d4 p1 p2 p3). The seven columns of are the seven distinct nonzero 3-bit vectors, so the code corrects any single error.
An extended Hamming code adds one overall parity bit to a Hamming code. This raises to 4, so it corrects one error and detects two at the same time.
WORKED EXAMPLE
For the (7,4) code with the and above, encode the message . The word is then received. Find the syndrome and the corrected codeword.
Parity bits: . With , add rows 1, 3 and 4 of : (mod 2).
Codeword: . Check: (row 1 uses bits 1, 3, 4, 5: ).
Received differs from in position 3.
Syndrome: row 1 (bits 1, 3, 4, 5) gives ; row 2 (bits 1, 2, 3, 6) gives ; row 3 (bits 2, 3, 4, 7) gives . So .
Column 3 of is , so the error is in bit 3. Flip it: corrected word , message .
Answer: Codeword 1011100; syndrome 111 points to bit 3; corrected word 1011100.
Positional form. The same Hamming code is often written with its bit positions reordered: number the positions to , put the parity bits at the positions that are powers of 2 () and the data bits in the remaining positions in order. Column of is then the binary number , so the syndrome, read as a binary number, is the position of a single error directly.
Positional Hamming code rules (even parity)
The parity bit at position checks every position whose binary index has a 1 in bit (for : checks 1, 3, 5, 7; checks 2, 3, 6, 7; checks 4, 5, 6, 7).
Each parity bit is set so that its group has an even number of 1s.
At the receiver, recompute each check (; 1 = failed). The number in binary is the error position; means no error.
WORKED EXAMPLE
Using the positional (7,4) Hamming code with even parity, encode the data (placed in positions 3, 5, 6, 7 in that order). Bit 6 is then flipped by the channel. Show that the receiver finds the error.
Data: position 3 = 1, position 5 = 0, position 6 = 1, position 7 = 1.
(positions 3, 5, 7): , so . (positions 3, 6, 7): , so . (positions 5, 6, 7): , so .
Codeword (positions 1 to 7): .
Received after bit 6 flips: .
Checks: (1, 3, 5, 7) ; (2, 3, 6, 7) ; (4, 5, 6, 7) .
: the error is in position 6. Flipping it gives back .
Answer: Codeword 0110011; the checks read 110 = 6, the flipped position.
EXAM TIP
Check the data-bit requirement with the inequality before building anything: for , gives , so it just fits, and 11 data bits need 4 parity bits. For , gives , which fails, so .
Assume each bit is flipped independently with probability (a binary symmetric channel). The number of errors in an -bit block is then binomial.
BLOCK DECODING-ERROR PROBABILITY
Probability that a block has more than errors. It is exactly the probability of not decoding the block correctly for a decoder that corrects every pattern of up to errors and no other (for example a Hamming code, ); for a decoder that also corrects some heavier patterns it is an upper bound.
UNDETECTED-ERROR PROBABILITY
For a linear code used for detection only: an error goes undetected exactly when the error pattern is itself a nonzero codeword. is the number of codewords of weight .
A CRC treats the message bits as the coefficients of a polynomial over GF(2), with the leftmost bit as the coefficient of the highest power. It uses an agreed generator polynomial of degree . The check bits are the remainder of a division, appended to the message, so every transmitted word is a multiple of (a CRC code is a cyclic linear code). The receiver divides the whole received word by and accepts it if the remainder is zero.
CRC COMPUTATION
Append zeros to the message, divide by using XOR (no borrow), and the remainder replaces the zeros. The transmitted word is exactly divisible by .
Computing a CRC by long division
Write as a bit string of length (a missing power gives a 0).
Append zeros to the message bits.
Bring down bits; whenever the leading bit of the current window is 1, XOR it with ; if it is 0, XOR with all zeros (just shift).
Continue until all bits are used. The last bits left are the CRC.
Send the message followed by the CRC; the receiver divides the received bits by and expects remainder 0.
WORKED EXAMPLE
The message is and the generator is . Find the transmitted word.
, . Append three zeros: .
Divide: , bring down 0: , bring down 1: , bring down 1: , bring down 0: (leading 0, shift), bring down 0: , bring down 0: (leading 0, shift) leaves remainder .
CRC bits . Transmitted word .
Check: dividing by in the same way leaves remainder .
Answer: Transmitted word 1101011110 (CRC = 110).
Property of g(x) (degree r) | Errors guaranteed to be detected |
|---|---|
Nonzero constant term ( coefficient 1) | Every burst of length (a burst of length is a run from the first to the last flipped bit) |
is a factor | Every error pattern with an odd number of flipped bits |
Nonzero constant term, and does not divide for any with ( = codeword length) | Every double error within the codeword (its error polynomial is ) |
Any of degree with nonzero constant term | A burst of length is missed with probability ; a longer burst with probability (for equally likely patterns) |
An error pattern is missed exactly when divides , since the received polynomial is and already divides . This is why every guarantee in the table is a statement about which cannot divide.
EXAM TIP
Do not confuse the CRC with Hamming codes: in this chapter a CRC is used only to detect errors (a frame that fails the check is discarded or sent again), while a Hamming code locates and corrects a single error. In the long division you XOR bits only (no carries), and the quotient is never needed, only the remainder.
PREVIOUS-YEAR QUESTIONS
Try each question first, then open the answer. We placed each question under a topic ourselves; the exam paper does not label topics.
See these papers in full: GATE ECE 2026 · GATE ECE 2025 · GATE ECE 2024 · GATE ECE 2022 · GATE ECE 2018
The average bit error rate at the input of a (7, 4, 1) Hamming decoder is 0.10. The probability that the decoder will fail to decode a received word correctly is __. (rounded off to two decimal places)
The generator matrix of a (6,3) binary linear block code is given by G = [[1,0,0,1,0,1],[0,1,0,0,1,1],[0,0,1,1,1,0]]. The minimum Hamming distance d_min between codewords equals _____ (answer in integer).
The information bit sequence {1 1 1 0 1 0 1 0 1} is to be transmitted by encoding with Cyclic Redundancy Check 4 (CRC-4) code, for which the generator polynomial is . The encoded sequence of bits is ________.
{1 1 1 0 1 0 1 0 1 1 1 0 0}
{1 1 1 0 1 0 1 0 1 1 1 0 1}
{1 1 1 0 1 0 1 0 1 1 1 1 0}
{1 1 1 0 1 0 1 0 1 0 1 0 0}
Consider communication over a memoryless binary symmetric channel using a (7, 4) Hamming code. Each transmitted bit is received correctly with probability , and flipped with probability . For each codeword transmission, the receiver performs minimum Hamming distance decoding, and correctly decodes the message bits if and only if the channel introduces at most one bit error. For , the probability that a transmitted codeword is decoded correctly is ________ (rounded off to two decimal places).
Consider a binary channel code in which each codeword has a fixed length of 5 bits. The Hamming distance between any pair of distinct codewords in this code is at least 2. The maximum number of codewords such a code can contain is ______.
PRACTICE
A block code has minimum distance . Which of the following statements are guaranteed to be true?
It can detect every pattern of up to 4 bit errors when used for detection only.
It can correct every pattern of up to 2 bit errors when used for correction only.
It can correct every single-bit error and, at the same time, detect every pattern of up to 3 bit errors.
It can correct every pattern of up to 2 bit errors and, at the same time, detect every pattern of up to 3 bit errors.
Answer: (A), (B), (C)
Detection only: errors, so A is true.
Correction only: , so B is true.
Combined correction of and detection of needs .
C: , gives , true.
D: , gives , not guaranteed.
A single-error-correcting Hamming-type code must protect data bits. What is the minimum number of parity bits required, using ?
Answer:
Try : versus , fails.
Try : versus , holds.
So the minimum is (this is the (31,26) Hamming code).
A (7,4) linear code has the parity-check matrix with rows , and (bit positions 1 to 7 left to right). A word is received and it is known that at most one bit is in error. Find the position (1 to 7) of the erroneous bit.
Answer:
Row 1 uses bits 1, 3, 4, 5: .
Row 2 uses bits 1, 2, 3, 6: .
Row 3 uses bits 2, 3, 4, 7: .
Syndrome , which is column 7 of (column 7 is ).
The error is in bit position 7.
A CRC uses the generator polynomial and the 4-bit message . The three CRC bits are appended after the message. Interpreting the three CRC bits as a binary number, what is its decimal value?
Answer:
, . Append three zeros: .
, bring down 0: , bring down 0: , bring down 0: .
Remainder , which is 3 in decimal.
Check with polynomials: , i.e. .
A CRC uses , which factors as . The codewords are 15 bits long. Which one of the following error types is guaranteed to be detected?
Every error pattern with an odd number of flipped bits.
Every error pattern with exactly two flipped bits.
Every burst error of length 5.
Every error pattern whatsoever.
Answer: (A)
has the factor , so divides only if , which means an even number of terms. Hence every odd-weight error is detected: A is true.
B: divides , so two flipped bits 6 positions apart (for example bits 1 and 7, which fit in a 15-bit codeword) are missed. B is false.
C: a burst of length 5 can equal itself (pattern ), which is divisible by and missed. C is false.
D is false because of B and C.
OFFICIAL GATE 2027 SYLLABUS WORDING
Copied from the GATE 2027 syllabus; see all 2027 syllabi.
GATE EC
Fundamentals of error correction, Hamming codes, CRC
Preparing in Kolkata? IAE Academy's course for GATE ECE.