Menu Close

Error control coding: UPSC Electrical Engineering Optional PYQ Solutions (2000–2026)

All 32 questions UPSC has asked on error control coding in the Electrical Engineering Optional (Paper II, Digital Communication) from 2000 to 2026, solved step by step – latest first.

Try them yourself first: the same questions, without solutions, are on our Digital Communication topic-wise PYQs page. Circuit diagrams have been redrawn from the question papers.

How we check these solutions

These are our own solutions, prepared with AI help. UPSC does not publish official answers. Every solution is checked a second way before it goes up, and says how:

  • ✓ Checked by computer the numbers were worked out again independently in code (SymPy and NumPy: circuit equations, power balance, matrices, integrals).
  • ✓ Proof checked step by step or ✓ Derivation checked step by step for “prove” and “derive” questions, every step was checked against the definitions and standard results.
  • ✓ Answer checked step by step for theory and descriptive questions, every point was checked against the standard theory.

Where a printed question is wrong, unclear or incomplete, we say so and solve the intended version.

Spotted a mistake or a neater method? Tell us in the comments below or through Report an error.

Jump to a question (year · question number):

2026 · 7b(ii) 2025 · 1e 2025 · 8b 2023 · 4a 2022 · 5e 2022 · 7a 2021 · 2c 2021 · 8a(i) 2021 · 8a(ii) 2020 · 1e 2020 · 5e 2020 · 8b 2019 · 8a(ii) 2019 · 8a(iii) 2018 · 5c(i) 2017 · 6a 2016 · 4c(i) 2016 · 6c(i) 2015 · 5e 2015 · 8c 2014 · 6c 2013 · 4c(i) 2013 · 6c(ii) 2012 · 3c(i) 2012 · 5f(i) 2012 · 7b(i) 2011 · 4b(i) 2011 · 7c(i) 2010 · 6c 2009 · 7c 2006 · 1d 2000 · 4b

Cover of the UPSC Prelims Topic-wise PYQ book with detailed explanations

From the Optional Province team

Preparing for Prelims too?

Our UPSC Prelims Topic-wise PYQ Book covers every Prelims question with detailed explanations, so you can see exactly where UPSC asks from. Now available as a hard copy and an eBook.

Buy Hard Copy on AmazonBuy eBook (PDF)

Download a free sample

A parity check code has the parity check matrix: H=[101100110010011001] I. Determine the generator matrix G. II. Find the code word that begins with 101… . III. Suppose that the received word is 110110. Decode this received word.

2026 · Paper II · Q7b(ii) · 10 marks

Solution

I. Generator matrix

H has the systematic form [PT|I3], with the message in the first three positions:

PT=[101110011]⇒P=[110011101]

G=[I3|P]=[100110010011001101]

II. Codeword beginning with 101

c=(101)G=row1⊕row3=101011

III. Decoding 110110

The syndrome is

s=rHT=(0,1,1)

This equals the 2nd column of H, (0,1,1)T. So there is a single error in bit 2.

  • Corrected word: 100110, i.e. message 100.
  • Check: (100)G=100110 ✓.

✓ Checked by computer We derived G and decoded the received word by syndrome in Python.

↑ Back to the question list

If the generator polynomial is (x4+x+1) and the message bits are 1101101, then obtain the CRC code.

2025 · Paper II · Q1e · 10 marks

Solution

Data

g(x)=x4+x+1→10011(degree 4, so 4 check bits)

M(x)→1101101

Procedure

Append four zeros, giving 1101101 0000, and divide (modulo 2) by 10011. The successive XOR steps (bit position: segment ⊕ 10011 → result) are:

Step Segment ⊕ 10011 →
1 11011 01000
2 10000 00011
3 11100 01111
4 11110 01101
5 11010 01001

Remainder (CRC): 1001

Transmitted CRC codeword: 11011011001

At the receiver, dividing 11011011001 by 10011 leaves a zero remainder if there are no errors.

✓ Checked by computer We carried out the polynomial division in Python.

↑ Back to the question list

Draw the diagram of a 1/3 rate convolution encoder. Write the corresponding code tree for the 1/3 rate convolution encoder.

2025 · Paper II · Q8b · 20 marks

Solution

Rate-1/3 convolutional encoder

The question does not specify the generators. We take a standard rate-1/3, constraint-length-3 code with g1=(100), g2=(101), g3=(111):

  • one input bit enters a 2-stage shift register;
  • three modulo-2 adders form the outputs v1=uk, v2=uk⊕uk−2, v3=uk⊕uk−1⊕uk−2;
  • a commutator sends v1v2v3 for each input bit, giving 3 output bits per input bit (rate 1/3).
inputFF1FF2v1 g1 = 100v2 g2 = 101v3 g3 = 111commutator takes v1, v2, v3 in turn for each input bit

Code tree

0000000000000001111011110001011101111110001010110010010110110100110111upper branch: input 0; lower branch: input 1; branch label: output; grey: next state
  • Start at the root, in state 00.
  • At each node, the upper branch corresponds to input 0 and the lower branch to input 1. Each branch is labelled with the 3-bit output, and the next state is shown.
  • After K = 3 levels, the tree repeats: nodes with the same state have identical subtrees. This is why the tree can be collapsed into a trellis.

Example: the input 101 follows lower, upper, lower branches, giving 111 001 100.

✓ Answer checked step by step Encoder chosen with g1 = 100, g2 = 101, g3 = 111; tree generated in Python.

↑ Back to the question list

Consider a systematic linear block code with binary elements whose parity check equations are p1=m1+m2+m3 p2=m2+m3+m4 p3=m1+m3+m4 p4=m1+m2+m4 where mi are message digits and pi are parity check digits. (i) Find the generator matrix and parity check matrix for the code. (ii) How many errors can this code detect? How many errors can be corrected? (iii) If 10100100 is the received code word, find the corresponding transmitted code word assuming that single-bit error has been made during transmission.

2023 · Paper II · Q4a · 20 marks

Solution

(i) Generator and parity-check matrices (c=m1m2m3m4p1p2p3p4)

P=[1011110111100111]

(Row i shows which parity bits contain mi.)

G=[I4|P]=[10001011010011010010111000010111]

H=[PT|I4]=[11101000011101001011001011010001]

(ii) Error capability

Listing the 16 codewords gives dmin=4 (every non-zero codeword has weight 4 or 8). So it can:

  • detect up to dmin−1=3 errors;
  • correct ⌊(dmin−1)/2⌋=1 error (and simultaneously detect double errors).

(iii) Decoding 10100100

s=rHT=(0,0,0,1)

This matches the 8th column of H, the p4 position. So the error is in the last bit.

  • Corrected codeword: 10100101, i.e. message 1010.
  • Check: p=(1010)P=0101 ✓.

✓ Checked by computer We built G and H, found dmin and decoded the received word in Python.

↑ Back to the question list

Prove that all vectors in the same coset have the same syndrome that is unique to that coset in the standard array for any linear block code.

2022 · Paper II · Q5e · 10 marks

Solution

Standard array

For an (n,k) linear code C, the 2n n-tuples are arranged in 2n−k rows (cosets). Each row is

ei+C={ei+c1,ei+c2,…,ei+c2k}

where the coset leader ei is a minimum-weight vector not in an earlier row.

(a) All vectors in a coset have the same syndrome

Take any two vectors in the coset of ei: v=ei+cj and w=ei+cl. Since every codeword satisfies cHT=0:

vHT=eiHT+cjHT=eiHT,wHT=eiHT+clHT=eiHT

So every vector in the coset has the syndrome si=eiHT, the syndrome of its coset leader.

(b) Different cosets have different syndromes

Suppose two cosets with leaders ei≠ej (in different rows) had the same syndrome:

eiHT=ejHT⇒(ei+ej)HT=0⇒ei+ej=c∈C

Then ej=ei+c would lie in the coset of ei. But the standard array is built so that each new leader is chosen from vectors not already in any earlier row, so this is impossible. Hence distinct cosets have distinct syndromes.

Conclusion: the syndrome is the same for all vectors of a coset, and unique to that coset. There are exactly 2n−k syndromes for the 2n−k cosets. The decoder can therefore identify the coset, and hence the most likely error pattern (the coset leader), from the syndrome alone. ∎

✓ Proof checked step by step We proved the result step by step.

↑ Back to the question list

The figure below shows the encoder for a rate r=12, constraint length k=4 convolutional code: (i) Determine the encoder output produced by the message sequence 11011 … . (ii) Also, construct the code tree for the encoder. Trace the path through the tree that corresponds to the message 11011 … . Compare the resulting output with that determined in (i).

inputFF1FF2FF3v1 g1 = 1111v2 g2 = 1101commutator takes v1, v2 in turn for each input bit
Figure redrawn from the question paper. On a phone, swipe sideways to see all of it.

2022 · Paper II · Q7a · 20 marks

Solution

Generators (from the figure)

  • Upper adder: input + FF1 + FF2 + FF3, so g(1)=(1111), i.e. g(1)(x)=1+x+x2+x3.
  • Lower adder: input + FF1 + FF3, so g(2)=(1101), i.e. g(2)(x)=1+x+x3.

(i) Encoder output for 11011 (followed by three 0s to flush the register)

v(1)(x)=m(x)g(1)(x),v(2)(x)=m(x)g(2)(x)

with m(x)=1+x+x3+x4. Interleaving the two outputs:

Input 1 1 0 1 1 0 0 0
Output v1v2 11 00 01 10 11 01 01 11

Output: 11 00 01 10 11 01 01 11

(ii) Code tree and path for 11011

0000000000000000000000000111001110011010001101110011010100010110100110010111011111100110101000111000001000110100010111100011001011010011010110111100110111111100110101000111000000001110000100110100011001101000101000101101111100101110111001100101101001110000010010101000101111010111100110100110101011111001101111upper branch: input 0; lower branch: input 1; branch label: output; grey: next state

From the root, the path goes lower (1), lower (1), upper (0), lower (1), lower (1). The branch labels along it read 11, 00, 01, 10, 11, the same as the first five output pairs in (i). (The flushing zeros continue the path along upper branches: 01, 01, 11.)

✓ Checked by computer We encoded the message and traced the tree path in Python.

↑ Back to the question list

A convolutional code is described by g1=[110],g2=[101],g3=[111]. Find the transfer function and the free distance for this code. Also verify whether or not this code is catastrophic.

2021 · Paper II · Q2c · 10 marks

Solution

Encoder and state diagram (K=3; state = last two inputs)

inputFF1FF2v1 g1 = 110v2 g2 = 101v3 g3 = 111commutator takes v1, v2, v3 in turn for each input bit
001001110/0001/1110/1011/0100/0111/1000/1101/001state = (last input, input before); label: input / output; teal: input 0, gold: input 1

Transfer function

Split state 00 into a start and an end node. Label each branch DwNbL, where w is the output weight and b the input bit. Solving the state equations:

X10=D3NLX00+DNLX01

X01=D2LX10+D2LX11

X11=DNLX10+DNLX11

X00,end=D2LX01

T(D,N,L)=D7NL31−DNL−D3NL2

With N=L=1:

T(D)=D71−D−D3=D7+D8+D9+2D10+3D11+⋯

Free distance: the lowest power of D is 7, so

dfree=7

There is one path of weight 7: input 1 followed by zeros, output 111 101 011.

Catastrophic?

g1(D)=1+D,g2(D)=1+D2=(1+D)2,g3(D)=1+D+D2

Their greatest common divisor is 1, since 1+D+D2 is irreducible and not divisible by 1+D. Equivalently, the only zero-output-weight loop in the state diagram is the self-loop at state 00: the loop at 11 has output 001, of weight 1. So the code is not catastrophic.

✓ Checked by computer We obtained the transfer function symbolically and the free distance by search in Python.

↑ Back to the question list

Prove that the minimum distance of any linear (n,k) block code satisfies dmin≤1+n−k.

2021 · Paper II · Q8a(i) · 5 marks

Solution

Proof

Consider a linear (n,k) code in systematic form, G=[Ik|P]. Take a message with a single 1, e.g. m=(1,0,…,0). Its codeword is

c=(1,0,…,0,p1,p2,…,pn−k)

Its weight is

w(c)≤1+(n−k)

because at most all n−k parity bits can be 1.

For a linear code, dmin equals the minimum weight of the non-zero codewords. So

dmin≤w(c)≤1+n−k

(Alternative, for any code with 2k codewords: delete the first dmin−1 positions of every codeword. The shortened words are still all distinct, since two codewords differ in at least dmin places. There are 2k distinct words of length n−dmin+1, so 2k≤2n−dmin+1, i.e. dmin≤n−k+1.)

Hence

dmin≤n−k+1

the Singleton bound. Codes achieving equality are maximum-distance-separable (MDS), e.g. Reed–Solomon codes. ∎

✓ Proof checked step by step We proved the Singleton bound step by step.

↑ Back to the question list

Show that the minimum Hamming distance of a linear block code is equal to the minimum number of columns of its parity check matrix that are linearly dependent. From this conclude that the minimum Hamming distance of a Hamming code is always equal to 3.

2021 · Paper II · Q8a(ii) · 15 marks

Solution

dmin equals the smallest number of linearly dependent columns of H

Let h1,…,hn be the columns of H. A vector c is a codeword if and only if cHT=0:

∑i=1ncihi=0

  1. If c is a codeword of weight w, with non-zero entries at positions i1,…,iw, then hi1+…+hiw=0. So these w columns are linearly dependent.
  2. Conversely, if some w columns are linearly dependent, i.e. sum to zero (in GF(2)), the vector with 1s in those positions satisfies cHT=0. It is a codeword of weight w.

So the minimum weight of a non-zero codeword, which for a linear code equals dmin, is the smallest number of columns of H that are linearly dependent.

Hamming codes have dmin=3

For a Hamming code, with n=2r−1 and k=n−r, the columns of H are all the distinct non-zero r-tuples.

  • No column is zero, so no single column is dependent: dmin>1.
  • All columns are distinct, so no two columns sum to zero: dmin>2.
  • But for any two columns hi and hj, their sum hi+hj is also a non-zero r-tuple, and hence another column hk of H. So hi+hj+hk=0: three columns are dependent.

Hence dmin=3 for every Hamming code. It corrects all single errors (and is a perfect code). ∎

✓ Proof checked step by step We proved both results step by step.

↑ Back to the question list

For a linear block code Cb(4,2) over GF(3), the generator matrix (G) is given by G=[10211202] (i) Determine all right code words for this code. (ii) How many errors can this code correct?

2020 · Paper II · Q1e · 10 marks

Solution

Codewords

c=ag1+bg2(mod3),a,b∈{0,1,2}

where g1=(1021) and g2=(1202).

(a,b) Codeword Weight
(0, 0) 0000 0
(0, 1) 1202 3
(0, 2) 2101 3
(1, 0) 1021 3
(1, 1) 2220 3
(1, 2) 0122 3
(2, 0) 2012 3
(2, 1) 0211 3
(2, 2) 1110 3

(i) There are 32=9 codewords, listed above.

(ii) The minimum non-zero weight is 3, so dmin=3. The code corrects

t=⌊3−12⌋=1error

(any single symbol error).

✓ Checked by computer We listed the codewords over GF(3) in Python.

↑ Back to the question list

(i) Write down Hamming bound condition for code C(n, k) of size M in GF(q), which can correct t errors. (ii) Explain perfect code using Hamming bound condition in GF(2). (iii) Check whether n-repetition code (for odd value of n) is perfect code or not.

2020 · Paper II · Q5e · 10 marks

Solution

(i) Hamming (sphere-packing) bound

A code of length n with M codewords over GF(q) that corrects t errors must have non-overlapping spheres of radius t around its codewords. Each sphere contains ∑i=0t(ni)(q−1)i vectors, and there are only qn vectors in all:

M∑i=0t(ni)(q−1)i≤qn

For a linear (n,k) code, M=qk.

(ii) Perfect code (GF(2))

For binary codes:

2k∑i=0t(ni)≤2n⇔∑i=0t(ni)≤2n−k

A perfect code meets the bound with equality. The spheres of radius t around the codewords exactly fill the space, so every received vector is within distance t of exactly one codeword. Every syndrome corresponds to a correctable error pattern of weight at most t, and no others.

Example: Hamming codes (t=1, n=2r−1): 1+n=2r ✓. The (23, 12) Golay code (t=3) is also perfect.

(iii) The n-repetition code (n odd)

  • M=2 codewords (all 0s, all 1s), k=1, and dmin=n, so t=(n−1)/2.
  • Left side:

2∑i=0(n−1)/2(ni)=2×12∑i=0n(ni)=2×2n−1=2n

using the symmetry (ni)=(nn−i): for odd n, the first half of the binomial sum is exactly half of 2n.

  • This equals the right side, 2n.

So the odd-length repetition code is a perfect code. Every received word is decoded by majority vote to the nearer of the two codewords. ∎

✓ Proof checked step by step We stated the bound and checked the repetition code step by step.

↑ Back to the question list

(i) Consider the primitive polynomial p(x)=x3+x+1 over GF(2). Construct GF(8) field using the given primitive polynomial. (ii) Find the minimal polynomial for the primitive element α. (iii) Find the BCH code of length n = 15, which can correct at least one error.

2020 · Paper II · Q8b · 20 marks

Solution

(i) GF(8) from p(x)=x3+x+1

Let α be a root, so α3=α+1. The non-zero elements are the powers of α:

Power Polynomial Vector (1,α,α2)
0 0 000
α0 1 100
α1 α 010
α2 α² 001
α3 1 + α 110
α4 α + α² 011
α5 1 + α + α² 111
α6 1 + α² 101
α7 1 100

All 7 non-zero elements appear, so α is primitive. Addition is the vector XOR; multiplication adds exponents modulo 7.

(ii) Minimal polynomial of α

The conjugates of α are α,α2,α4. Then

m1(x)=(x+α)(x+α2)(x+α4)

=x3+(α+α2+α4)x2+(α3+α5+α6)x+α7

Now α+α2+α4=010+001+011=000=0, and α3+α5+α6=110+111+101=100=1. So

m1(x)=x3+x+1

(As expected: p(x) is itself the minimal polynomial of its root.)

(iii) BCH code of length 15 correcting one error

  • For n=15=24−1, work in GF(16), generated by a primitive polynomial of degree 4: p(x)=x4+x+1.
  • For t=1, the generator is the minimal polynomial of β (a primitive element of GF(16)):

g(x)=m1(x)=x4+x+1

  • Degree 4 gives n−k=4. So this is the (15, 11) BCH code, which is the (15, 11) Hamming code, with dmin=3 and correcting 1 error.
  • (For t=2: g=m1m3=(x4+x+1)(x4+x3+x2+x+1), giving the (15, 7) code.)

✓ Checked by computer We built GF(8) and checked the minimal polynomial by direct computation.

↑ Back to the question list

The generator matrix of a (7, 4) linear block code is given by 𝐆=[1101000011010011100101010001]=[𝐏∣𝐈k] (1) Determine a parity check matrix H for this code. (2) Show that 𝐆⋅𝐇T=0. (3) Determine all right code words of the dual code. (4) Find the minimum distance of the dual code.

2019 · Paper II · Q8a(ii) · 8 marks

Solution

(1) Parity-check matrix

G=[P|I4] with

P=[110011111101]

H=[I3|PT]=[100101101011100010111]

(2) GHT=0

GHT=[P|I4][I3P]=P+P=0(mod2)

Direct multiplication confirms that all 12 entries are 0.

(3) Codewords of the dual code (generated by H; a (7, 3) code)

Message Codeword Weight
000 0000000 0
001 0010111 4
010 0101110 4
011 0111001 4
100 1001011 4
101 1011100 4
110 1100101 4
111 1110010 4

(4) Minimum distance of the dual code

Every non-zero codeword has weight 4, so

dmin=4

(This is the (7, 3) simplex code, the dual of the (7, 4) Hamming code.)

✓ Checked by computer We formed H, checked GHᵀ = 0 and listed the dual code in Python.

↑ Back to the question list

The figure shows the encoder for a rate R=12, constraint length K = 4 convolutional code. Determine the encoder output produced by the message sequence u = 1011.

inputFF1FF2FF3v1 g1 = 1111v2 g2 = 1101commutator takes v1, v2 in turn for each input bit
Figure redrawn from the question paper. On a phone, swipe sideways to see all of it.

2019 · Paper II · Q8a(iii) · 6 marks

Solution

Generators (from the figure)

g(1)=(1111),g(2)=(1101)

(The upper adder sums the input and all three flip-flops; the lower sums the input, FF1 and FF3.)

Encoding u = 1011 (three zeros appended to clear the register)

Input 1 0 1 1 0 0 0
Register (FF1 FF2 FF3) before 000 100 010 101 110 011 001
v1 = sum of all four 1 1 0 1 0 0 1
v2 = in + FF1 + FF3 1 1 1 1 1 1 1

Output: 11 11 01 11 01 01 11

(Equivalently, v(1)(x)=(1+x2+x3)(1+x+x2+x3) and v(2)(x)=(1+x2+x3)(1+x+x3), interleaved.)

✓ Checked by computer We encoded the message in Python.

↑ Back to the question list

A convolutional encoder is shown below:

inputFF1FF2V1 g1 = 111V2 g2 = 101commutator takes v1, v2 in turn for each input bit
Figure redrawn from the question paper.

(i) Write down all the generator sequences and corresponding generator polynomial.

(ii) Determine the output sequence V, if the input sequence is U=(10011).

2018 · Paper II · Q5c(i) · 4 marks · also asked 2018 (Q5c(ii))

Solution

(i) Generator sequences and polynomials

From the figure:

  • V1 = input + stage 1 + stage 2:

g(1)=(111),g(1)(D)=1+D+D2

  • V2 = input + stage 2:

g(2)=(101),g(2)(D)=1+D2

This is the standard rate-1/2, K=3 code (7, 5 in octal), with dfree=5.

(ii) Output for U = (1 0 0 1 1) (two flushing zeros added)

Input 1 0 0 1 1 0 0
V1V2 11 10 11 11 01 01 11

V = 11 10 11 11 01 01 11

Check:

U(D)=1+D3+D4

V1(D)=U(D)(1+D+D2)=1+D+D2+D3+D6→1111001

V2(D)=U(D)(1+D2)=1+D2+D3+D4+D5+D6→1011111

Interleaving gives the sequence above ✓.

✓ Checked by computer We encoded the input in Python.

↑ Back to the question list

A convolutional code is described by the following generator sequences: g1=[100] g2=[101] g3=[111] (i) Construct the encoder circuit corresponding to this code. (ii) Draw the state diagram for this code. (iii) Draw the trellis diagram for a message sequence length of 5 bits. (iv) Determine the encoded sequence for the message sequence 10111.

2017 · Paper II · Q6a · 20 marks

Solution

(i) Encoder (g1=100, g2=101, g3=111; K=3, rate 1/3)

inputFF1FF2v1 g1 = 100v2 g2 = 101v3 g3 = 111commutator takes v1, v2, v3 in turn for each input bit

(ii) State diagram (state = last two inputs; label = input/output)

001001110/0001/1110/0011/1100/0111/1000/0101/101state = (last input, input before); label: input / output; teal: input 0, gold: input 1
Present state Input 0: next / output Input 1: next / output
00 00 / 000 10 / 111
10 01 / 001 11 / 110
01 00 / 011 10 / 100
11 01 / 010 11 / 101

(iii) Trellis (5 message bits + 2 flushing zeros)

001001111110011001101010100111011100input:

(iv) Encoded sequence for 10111

Input 1 0 1 1 1 0 0
Output 111 001 100 110 101 010 011

Codeword: 111 001 100 110 101 010 011 (the red path in the trellis). The code’s free distance is 6.

✓ Checked by computer We encoded the message and drew the state diagram and trellis in Python.

↑ Back to the question list

Cover of the UPSC Mains Topic-wise and Year-wise PYQs book (2013–2026)

From the Optional Province team

Strengthen your GS papers

Our UPSC Mains Topic-wise & Year-wise PYQ Book (2013–2026) maps every GS question to the syllabus, so you know what UPSC asks and how often. Now available as a hard copy and an eBook.

Buy Hard Copy on AmazonBuy eBook (PDF)

Download a free sample

Discuss the concept of ‘Hamming distance’. How is the minimum Hamming distance between a set of code words related to the error detection and error correction properties of the code? Find the correct 4-bit messages from the following two Hamming codes, assuming at most a single error has occurred: C1=0110101 C2=1011001

2016 · Paper II · Q4c(i) · 10 marks

Solution

Hamming distance

The Hamming distance d(x,y) between two codewords is the number of positions in which they differ. The minimum distance dmin of a code is the smallest distance between any two distinct codewords. For a linear code, this equals the smallest non-zero codeword weight.

Relation to error control

  • Detection: up to s errors can be detected if dmin≥s+1.
  • Correction: up to t errors can be corrected if dmin≥2t+1.
  • Both: correct t and detect s>t errors if dmin≥t+s+1.

Example: the (7, 4) Hamming code has dmin=3, so it corrects 1 error or detects 2.

Decoding the two Hamming (7, 4) words

We use the standard arrangement: positions 1, 2, 4 are parity bits (p1p2d1p3d2d3d4), and positions 3, 5, 6, 7 are data. The syndrome (error position) is the XOR of the position numbers of all 1-bits.

C₁ = 0110101

  • 1s at positions 2, 3, 5, 7.
  • Syndrome 2⊕3⊕5⊕7=3: error in bit 3.
  • Corrected word: 0100101.
  • Data (positions 3, 5, 6, 7): 0101.

C₂ = 1011001

  • 1s at positions 1, 3, 4, 7.
  • Syndrome 1⊕3⊕4⊕7=1: error in bit 1 (a parity bit).
  • Corrected word: 0011001.
  • Data: 1001.

Answer: the messages are 0101 and 1001.

✓ Checked by computer We decoded both words by syndrome (bit positions 1–7) in Python.

↑ Back to the question list

Show that the (7, 4) cyclic codes generated by the two polynomials g1(P)=P3+P2+1, and g2(P)=P3+P+1 are equivalent. Find the codes for the four messages: (0011), (0101), (1010), (1101)

2016 · Paper II · Q6c(i) · 10 marks

Solution

Equivalence of the two codes

g2(P)=P3+P+1,P3g1(1/P)=P3(P−3+P−2+1)=1+P+P3=g2(P)

So g2 is the reciprocal of g1. Both divide P7+1:

P7+1=(P+1)(P3+P+1)(P3+P2+1)

so both generate (7, 4) cyclic codes.

If c(P) is a codeword of the g1 code, then its reversal P6c(1/P) is a multiple of P3g1(1/P)=g2(P), i.e. a codeword of the g2 code. So the codewords of one code are the bit-reversals of those of the other. The two codes have the same weight distribution and the same dmin (= 3): they are equivalent (both are Hamming codes), differing only by a permutation (reversal) of positions.

Codes for the four messages (systematic form: message followed by parity, parity = remainder of P3m(P)/g(P))

Message Code with g1=P3+P2+1 Code with g2=P3+P+1
0011 0011 010 0011 101
0101 0101 110 0101 100
1010 1010 001 1010 011
1101 1101 000 1101 001

(Non-systematic encoding, c(P)=m(P)g(P), gives other codewords of the same codes. For example, with g1: 0011 → 0010111.)

✓ Checked by computer We encoded the four messages with both polynomials in Python.

↑ Back to the question list

Differentiate between the problems of error detection and correction. How many check/parity bits are required to correct a single error in a message of m bits?

2015 · Paper II · Q5e · 10 marks

Solution

Error detection and error correction

  • Error detection: the receiver only needs to know whether errors have occurred, from a check that fails (parity, checksum, CRC). The data are then retransmitted (ARQ). Little redundancy is needed. A few check bits detect many error patterns, including bursts.
  • Error correction (FEC): the receiver must find which bits are wrong, and correct them without retransmission. This needs more redundancy: each correctable error pattern must produce a distinct syndrome. It is used where retransmission is impossible or too slow (one-way links, deep space, real-time media, storage).

In terms of distance: detecting s errors needs dmin≥s+1; correcting t errors needs dmin≥2t+1.

Check bits to correct a single error in m message bits

With r check bits there are 2r syndromes. They must distinguish “no error” plus an error in any one of the m+r positions:

2r≥m+r+1

(Hamming condition)

m 1 4 11 26 57
r 2 3 4 5 6

For example, 4 data bits need 3 check bits, giving the (7, 4) Hamming code.

✓ Answer checked step by step Standard explanation.

↑ Back to the question list

Describe the Cyclic Redundancy Check (CRC) scheme for error detection. Explain how the Frame Check Sequence (FCS) and divisor/pattern are chosen. Given a message M=1010001101 (10 bits), pattern P=110101 (6 bits), illustrate how FCS can be calculated.

2015 · Paper II · Q8c · 10 marks

Solution

CRC scheme

  • The k-bit message M is treated as a polynomial.
  • It is shifted left by n bits (multiplied by xn), where n is the degree of the divisor (pattern) P of n+1 bits.
  • The result is divided modulo 2 by P. The n-bit remainder is the frame check sequence (FCS), and it is appended to the message.
  • The transmitted frame T=2nM+FCS is exactly divisible by P.
  • The receiver divides the received frame by P. A non-zero remainder means an error.

Choice of the pattern (generator)

  • Its first and last bits must be 1.
  • It should have a factor (x+1), so that all odd numbers of errors are detected.
  • A degree n gives an n-bit FCS. It detects all bursts of length ≤n, and longer bursts with probability 1−2−n.
  • It should not divide xj+1 for small j (so that double errors are detected).
  • Standard patterns: CRC-12, CRC-16 (x16+x15+x2+1), CRC-CCITT (x16+x12+x5+1), CRC-32.

Example: M = 1010001101 (10 bits), P = 110101 (6 bits), so FCS has 5 bits.

Divide 25M = 101000110100000 by 110101:

Step Segment ⊕ 110101 →
1 101000 011101
2 111011 001110
3 111010 001111
4 111110 001011
5 101100 011001
6 110010 000111

(Each segment is the next 6 bits starting at the leading 1, XOR-ed with 110101.)

Remainder (FCS) = 01110

Transmitted frame: 1010001101 01110. It is divisible by 110101, giving a zero remainder at the receiver.

✓ Checked by computer We carried out the division in Python.

↑ Back to the question list

The parity check matrix H of a linear (7, 4) block code is given by H=[101110011010100111011] Determine the coded word for the data 0101.

2014 · Paper II · Q6c · 10 marks

Solution

Note on the data. As printed, the last three columns of H are not the identity: the third row has an extra 1 in column 6. The code is still systematic, with data in positions 1–4, so we solve cHT=0 directly. The intended H, [PT|I3] with last row 0111001, gives the same answer here.

Codeword c=(d1d2d3d4c5c6c7) with data 0101:

  • Row 1: d1+d3+d4+c5=0, so 0+0+1+c5=0 and c5=1.
  • Row 2: d1+d2+d4+c6=0, so 0+1+1+c6=0 and c6=0.
  • Row 3: d2+d3+d4+c6+c7=0, so 1+0+1+0+c7=0 and c7=0.

Codeword: 0101100

(Check: cHT=(0,0,0) ✓.)

✓ Checked by computer We solved cHᵀ = 0 for the parity bits in Python.

↑ Back to the question list

A systematic (7, 4) linear code has the parity matrix P given as: [P]=[111110101011]

(i) Find the code vectors for message vectors 1000, 0001, 0010 and 0111.

(ii) Draw the corresponding encoding diagram.

(iii) If the received vector [0111110] has a single error, detect the error and correct it.

2013 · Paper II · Q4c(i) · 8 marks · also asked 2013 (Q4c(ii)), 2013 (Q4c(iii))

Solution

Generator matrix

G=[I4|P]=[1000111010011000101010001011]

(i) Code vectors

Message Parity mP Code vector
1000 111 1000111
0001 011 0001011
0010 101 0010101
0111 110 ⊕ 101 ⊕ 011 = 000 0111000

(ii) Encoding diagram

The message bits go straight to the output (systematic). Three XOR gates form the parity bits:

c5=m1⊕m2⊕m3,c6=m1⊕m2⊕m4,c7=m1⊕m3⊕m4

m1m2m3m4c5c6c7c1 c2 c3 c4 = m1 m2 m3 m4 (systematic)

(iii) Received 0111110

H=[PT|I3]=[111010011010101011001]

s=rHT=(1,1,0)

This equals the 2nd column of H: the error is in bit 2.

  • Corrected vector: 0011110, i.e. message 0011.
  • Check: (0011)P=101⊕011=110 ✓.

✓ Checked by computer We encoded the messages and corrected the received vector in Python.

↑ Back to the question list

Consider the convolutional encoder shown in the figure below. The code is systematic: (a) Draw the state diagram using the State Transition Table (b) Draw the Code Tree.

inputFF1C1 g1 = 11C2 g2 = 10commutator takes v1, v2 in turn for each input bit
Figure redrawn from the question paper.

2013 · Paper II · Q6c(ii) · 10 marks

Solution

Encoder (from the figure)

  • C(2)=uk (the input itself: systematic);
  • C(1)=uk⊕uk−1 (the input plus the flip-flop output).

The state is the content of FF1, i.e. the previous input (K=2, two states). The output for each bit is C(1)C(2).

(a) State transition table and state diagram

Present state (uk−1) Input uk Output C(1)C(2) Next state
0 0 00 0
0 1 11 1
1 0 10 0
1 1 01 1
010/001/011/110/10label: input / C1 C2

(b) Code tree

000000000000111111100011111100000111011100011111100000000111111100011011100000111011100011upper branch: input 0; lower branch: input 1; branch label: output; grey: next state

Upper branches are input 0 and lower branches input 1, labelled with the outputs. The tree repeats after each level according to the state (0 or 1).

Example: input 1011 gives 11 10 11 01.

✓ Answer checked step by step We tabulated the transitions and drew the diagrams in Python.

↑ Back to the question list

This question has the following parts.

(i) Explain ASK, FSK and PSK modulation schemes used for transmitting the data. Draw clearly the block diagram for coherent detection and non-coherent detection of FSK modulation scheme.

(ii) A (6, 3) systematic linear block code encodes the information sequence X=(x1,x2,x3) into code word C=(c1,c2,c3,c4,c5,c6) such that c4 is a parity check on c1 and c2, to make the overall parity even, i.e., c1⊕c2⊕c4=0. Similarly c5 is a parity check on c2 and c3, and c6 is a parity check on c1 and c3. (1) Determine the generator matrix of this code. (2) Find the parity check matrix for this code. (3) Using the parity check matrix, determine the minimum distance of this code. (4) How many errors of this code are capable of correcting?

2012 · Paper II · Q3c(i) · 10 marks · also asked 2012 (Q3c(ii))

Solution

(i) ASK, FSK and PSK

  • ASK: the carrier amplitude is switched between two levels (on–off for 1/0):

s(t)=Ab(t)cosωct,b∈{0,1}

  • FSK: the carrier frequency is switched between f1 (for 1) and f2 (for 0), at constant amplitude.
  • PSK: the carrier phase is switched between 0 and π (BPSK), at constant amplitude and frequency.
0011010010data (NRZ)ASKFSKPSK

Coherent and non-coherent FSK detection:

Coherentr(t)×cos 2πf₁t∫ over Tb×cos 2πf₂t∫ over TbΣ−decide 1 if > 0Non-coherentBPF at f₁envelope det.BPF at f₂envelope det.sample at Tb;choose larger
  • Coherent: two correlators with synchronised local carriers at f1 and f2, integrated over Tb. The difference is compared with zero.

Pe=Q(Eb/N0)

  • Non-coherent: band-pass filters at f1 and f2, followed by envelope detectors. The outputs are sampled and compared. No phase reference is needed.

Pe=12e−Eb/2N0

(ii) The (6, 3) code

The parity equations are c4=c1⊕c2, c5=c2⊕c3, c6=c1⊕c3, with c1c2c3=x1x2x3.

(1) Generator matrix (C=XG):

G=[I3|P]=[100101010110001011]

(2) Parity-check matrix:

H=[PT|I3]=[110100011010101001],GHT=0

(3) Minimum distance:

  • The columns of H are all non-zero and distinct, so no single column or pair of columns sums to zero. Hence dmin≥3.
  • Columns 1, 4 and 6 sum to zero: (1,0,1)+(1,0,0)+(0,0,1)=0. Hence dmin=3.
  • Check: the codewords are 000000, 001011, 010110, 011101, 100101, 101110, 110011, 111000. The minimum non-zero weight is 3.

(4) Error correction:

t=⌊dmin−12⌋=1

The code corrects all single errors (and detects double errors).

✓ Checked by computer Same question as 6.2 (2012 Q3c); we built G and H and checked dmin in Python.

↑ Back to the question list

This question has the following parts.

inputS2S3v1 g1 = 110v2 g2 = 101commutator takes v1, v2 in turn for each input bit
Figure redrawn from the question paper.

(i) A convolutional encoder is given in the figure below: (1) Find the impulse response of the encoder. (2) Find the output code word if the input sequence is all 1’s (111111⋯).

(ii) Determine the channel capacity of band-limited waveform AWGN channel with an input power constraint.

2012 · Paper II · Q5f(i) · 5 marks · also asked 2012 (Q5f(ii))

Solution

(i) The encoder

From the figure: S1 holds the current input; upper output = S1 ⊕ S2, lower output = S1 ⊕ S3. So

g(1)=(110),g(2)=(101)

(1) Impulse response (input 1 followed by 0s):

Time 0 1 2
Output 11 10 01

Impulse response: 11 10 01

(2) All-ones input (111…):

Time 0 1 2 3 …
S1 S2 S3 100 110 111 111 …
Output 11 01 00 00 …

Output: 11 01 00 00 00 …

The infinite-weight input produces an output of finite weight 3. This shows the code is catastrophic: g(1)(D)=1+D and g(2)(D)=1+D2=(1+D)2 share the factor (1+D). A few channel errors could then cause infinitely many decoding errors.

inputFF1FF2v1 g1 = 110v2 g2 = 101v3 g3 = 111commutator takes v1, v2, v3 in turn for each input bit

(ii) Capacity of the band-limited AWGN channel with power constraint

  • Setting: the channel has bandwidth W and additive white Gaussian noise of PSD N0/2. The input power is at most P.
  • Sampling: a band-limited signal is represented by 2W samples per second (sampling theorem). Each sample is a use of a discrete-time Gaussian channel Y=X+Z, with noise variance σ2=N0W (noise power in band W) and E[X2]≤P.
  • Capacity per sample: I(X;Y)=h(Y)−h(Z), where h(Z)=12log2(2πeσ2). h(Y) is maximised when Y is Gaussian with variance P+σ2, i.e. when X is Gaussian with variance P:

Cs=12log2(2πe(P+σ2))−12log2(2πeσ2)=12log2(1+Pσ2)bits/sample

  • Capacity per second (2W samples/s):

C=Wlog2(1+PN0W)bits/s

This is the Shannon–Hartley theorem.

  • As W→∞: C→PN0log2e=1.44PN0, which gives the Shannon limit Eb/N0≥ln2 (−1.6 dB).

✓ Derivation checked step by step We computed the responses in Python and derived the capacity step by step.

↑ Back to the question list

This question has the following parts.

(i) Draw the neat sketch of OSI model. What is the significance of data link layer? Explain the flow-control and error-control mechanism.

(ii) Compute the CRC-4 character for the following message, using a modified divisor constant of 10011: 1100 0110 1011 01

2012 · Paper II · Q7b(i) · 10 marks · also asked 2012 (Q7b(ii))

Solution

(i) OSI model

Layer Name Function
7 Application User services: e-mail, file transfer, web
6 Presentation Data representation, encryption, compression
5 Session Dialogue control, synchronisation
4 Transport End-to-end reliable delivery, segmentation, flow control (TCP)
3 Network Routing and logical addressing (IP)
2 Data link Framing, physical addressing, error and flow control on a link
1 Physical Bits over the medium: voltages, timing, connectors

Significance of the data link layer: it turns the raw, error-prone physical link into a reliable link between adjacent nodes. It:

  • frames the bit stream, adding start and end delimiters and addresses;
  • detects (and through retransmission corrects) errors, using a CRC/FCS in each frame;
  • controls the flow so that a fast sender does not swamp a slow receiver;
  • controls access to shared media (MAC sublayer).

Protocols: HDLC, PPP, Ethernet.

Flow control:

  • Stop-and-wait: send one frame, then wait for its acknowledgement.
  • Sliding window: up to W frames may be outstanding; the receiver advances the window with acknowledgements.

Error control (ARQ):

  • Each frame carries a CRC. The receiver checks it and sends an ACK (correct) or NAK, or discards the frame.
  • A timeout triggers retransmission.
  • Stop-and-wait ARQ, go-back-N ARQ (resend from the errored frame) and selective-repeat ARQ (resend only the bad frame).

(ii) CRC-4 for 1100 0110 1011 01 with divisor 10011

Append 4 zeros and divide modulo 2 by 10011:

Step Segment ⊕ 10011 →
1 11000 01011
2 10111 00100
3 10010 00001
4 11011 01000
5 10000 00011
6 11100 01111
7 11110 01101
8 11010 01001

CRC-4 = 1001

Transmitted: 11000110101101 1001

✓ Answer checked step by step We computed the CRC-4 in Python.

↑ Back to the question list

This question has the following parts.

(i) How is error detection handled in data transfer, using checksums and cyclic redundancy characters (CRC)? Explain the concepts.

(ii) Suppose the following data bytes are received and the last byte is the checksum character: 10, 23, 45, 04, 84 Has the data been received correctly?

(iii) Calculate the data polynomial M(X) for the 16-bit data stream 26F0 H. Write the generator polynomial G(X) for bisync and SDLC protocols.

2011 · Paper II · Q4b(i) · 8 marks · also asked 2011 (Q4b(ii)), 2011 (Q4b(iii))

Solution

(i) Error detection with checksums and CRC

  • Checksum: the sender adds the data bytes (or 16-bit words) arithmetically, modulo 256 or modulo 216 (one’s- or two’s-complement). It sends the complement of the sum as the checksum. The receiver adds all bytes including the checksum. The result must be zero (or all 1s); otherwise there is an error.
    • Simple and fast in software (used in IP, TCP, UDP).
    • Misses some errors, e.g. reordering of bytes, or compensating errors in two bytes.
  • Cyclic redundancy check (CRC): the message is treated as a polynomial M(x) and divided (modulo 2) by a generator G(x) of degree r. The r-bit remainder is appended. The receiver divides the frame by G(x): a non-zero remainder means an error.
    • It detects all single and double errors, all odd numbers of errors if (x+1) divides G, and all bursts of length ≤r, plus most longer bursts.
    • Easily implemented with shift registers. Used in HDLC, Ethernet and storage.

(ii) Checking the received bytes

The bytes are taken as hexadecimal. The checksum is the two’s complement of the sum of the data bytes, so the total, including the checksum, must be 00 (mod 256):

10H+23H+45H+04H=7CH,7CH+84H=100H≡00H

The sum is zero, so the data have been received correctly. (The two’s complement of 7CH is 84H ✓.)

(iii) Data polynomial for 26F0H

26F0H=00100110111100002(bit 15 = MSB)

M(X)=X13+X10+X9+X7+X6+X5+X4

Generator polynomials:

  • Bisync (BSC, CRC-16):

G(X)=X16+X15+X2+1

  • SDLC (CRC-CCITT):

G(X)=X16+X12+X5+1

✓ Answer checked step by step We checked the checksum and wrote the polynomial.

↑ Back to the question list

This question has the following parts.

(i) Distinguish among the following terms: (1) Forward error correction and Error detection method (2) Random error and Burst error (3) Block codes and Convolutional codes

(ii) If C is a valid code vector [C=DG], then prove that CHT=0, where HT is the transpose of the parity check matrix H.

(iii) List the merits and demerits of delta modulation.

2011 · Paper II · Q7c(i) · 6 marks · also asked 2011 (Q7c(ii)), 2011 (Q7c(iii))

Solution

(i) Distinctions

(1) FEC and error detection

  • Forward error correction: enough redundancy is added that the receiver can locate and correct errors itself, with no return channel. It needs more redundancy and decoding effort. Used for one-way and real-time links.
  • Error detection (with ARQ): less redundancy, used only to detect errors. Correction is by retransmission over a feedback channel. Throughput falls when the error rate is high.

(2) Random and burst errors

  • Random errors: independent single-bit errors, scattered at random (e.g. thermal noise on AWGN channels).
  • Burst errors: many errors clustered in a short interval (a burst of length b, from the first to the last error), caused by impulse noise, fading or scratches on media.
  • Random-error codes: Hamming, BCH. Burst codes: Fire codes, Reed–Solomon, interleaving.

(3) Block and convolutional codes

  • Block codes: each block of k message bits is encoded independently into an n-bit codeword, with no memory: (n, k) Hamming, cyclic, BCH and RS codes.
  • Convolutional codes: the encoder has memory (a shift register). Each output depends on the current and the previous K−1 inputs. A continuous stream is encoded at rate k/n, and decoded by the Viterbi algorithm.

(ii) If C=DG, then CHT=0

In systematic form, G=[Ik|P] and H=[PT|In−k]. Then

GHT=[Ik|P][PIn−k]=IkP+PIn−k=P+P=0(mod2)

since x+x=0 in GF(2). For any codeword C=DG:

CHT=(DG)HT=D(GHT)=D⋅0=0

Every valid code vector therefore satisfies CHT=0. Conversely, a received vector with a non-zero syndrome rHT cannot be a codeword, so an error is indicated. ∎

(iii) Delta modulation: merits and demerits

Merits:

  • one bit per sample, so a very simple encoder and decoder (comparator and integrator);
  • no framing is needed;
  • robust to bit errors;
  • the bit rate can be adjusted.

Demerits:

  • slope-overload distortion and granular noise;
  • needs a high sampling (bit) rate, so a large bandwidth for good quality;
  • limited dynamic range unless adaptive (ADM, CVSD).

✓ Proof checked step by step We proved CHᵀ = 0 step by step.

↑ Back to the question list

Two important types of error-correcting codes are: (i) block codes and (ii) convolutional codes. Write the main difference between the block codes and convolutional codes. Explain the codes, which are a subclass of linear block codes.

2010 · Paper II · Q6c · 20 marks

Solution

Block codes and convolutional codes

Block codes Convolutional codes
The message is divided into blocks of k bits; each block is encoded independently into an n-bit codeword The encoder has memory: each group of n output bits depends on the current k input bits and on the previous m inputs (constraint length K=m+1)
Described by (n, k), the generator matrix G and the parity-check matrix H Described by generator sequences or polynomials, and state, tree and trellis diagrams
Decoded block by block: syndrome decoding, algebraic decoding (BCH, RS) Decoded by sequential decoding or the Viterbi algorithm (maximum likelihood over the trellis)
Performance set by dmin Performance set by dfree
Suited to bursty channels (RS), storage, error detection (CRC) Suited to random-error channels with soft decisions (satellite, mobile); good coding gain with simple encoders

Subclasses of linear block codes

  1. Repetition codes: each bit repeated n times; (n, 1); dmin=n.
  2. Single parity-check codes: (k+1, k); detect any odd number of errors; dmin=2.
  3. Hamming codes: n=2m−1, k=n−m, dmin=3; single-error-correcting; perfect codes. The columns of H are all the non-zero m-tuples.
  4. Cyclic codes: every cyclic shift of a codeword is a codeword. Generated by a polynomial g(x) dividing xn+1, with easy shift-register encoding and decoding. CRC codes are cyclic codes used for detection.
  5. BCH codes: cyclic codes designed for a chosen number of correctable random errors t (with n=2m−1, n−k≤mt), using roots in GF(2m).
  6. Reed–Solomon codes: non-binary BCH codes over GF(2m); MDS (dmin=n−k+1); excellent for burst errors (CDs, DVDs, deep space, digital TV).
  7. Golay code: (23, 12), t=3, perfect.
  8. Reed–Muller codes, LDPC codes (sparse H; near-capacity performance) and product codes.

✓ Answer checked step by step Standard explanation.

↑ Back to the question list

(i) A (6, 3) linear block code have the following parity-check matrix H: H=[101100011010111001]. Determine: (i) generator matrix G and (ii) code word for the data bit 101. (ii) Give a basic sketch illustrating a convolutional encoder with k = 3, k = 1 and n = 2. What are its advantages and disadvantages over block codes?

2009 · Paper II · Q7c · 20 marks

Solution

(i) Generator matrix and codeword

H is in the form [PT|I3]:

PT=[101011111]⇒P=[101011111]

G=[I3|P]=[100101010011001111]

Codeword for data 101:

c=(101)G=100101⊕001111=101010

Check: cHT=0 ✓. The code has dmin=3.

(ii) Convolutional encoder with K = 3, k = 1, n = 2

inputFF1FF2v1 g1 = 111v2 g2 = 101commutator takes v1, v2 in turn for each input bit
  • One input bit enters a 2-stage shift register.
  • Two modulo-2 adders, with generators g1=111 and g2=101, form two outputs per input bit (rate 1/2), sent in turn by a commutator.
  • The encoder has 4 states; dfree=5.

Advantages over block codes:

  • good coding gain with simple encoders;
  • easy use of soft-decision decoding (Viterbi), which gives about 2 dB more gain;
  • continuous operation, with no block framing;
  • well suited to random-error channels (satellite, mobile).

Disadvantages:

  • the decoder (Viterbi) complexity grows exponentially with K;
  • errors at the decoder output come in bursts;
  • poor against long burst errors unless interleaved;
  • less suited to error detection (CRC) and storage, and lacks the algebraic structure of block codes.

✓ Checked by computer We derived G and encoded the data in Python.

↑ Back to the question list

‘Huffman coding is done to increase the rate of information bits to make them approach the rate of binary digits while in parity-check coding rate of binary digits is increased to make the information transmission more reliable’ Comment.

2006 · Paper II · Q1d · 20 marks

Solution

The statement is correct.

Comment

  • Huffman (source) coding removes redundancy from the source output. Frequent symbols get short codewords and rare symbols long ones, so the average number of binary digits per symbol, L‾, approaches the entropy H (information bits per symbol).
    • The information rate per binary digit, H/L‾ (the efficiency), approaches 1: each binary digit carries nearly one bit of information.
    • In the words of the statement, the rate of information bits is made to approach the rate of binary digits.
    • Example: 2.93 digits for an entropy of 2.90 bits gives 99% efficiency.
  • Parity-check (channel) coding does the opposite. It adds controlled redundancy (check digits), so that n binary digits are sent for every k information digits.
    • The rate of binary digits rises relative to the information rate (code rate k/n<1).
    • The redundancy lets the receiver detect and correct errors, making transmission more reliable.
  • So the two are complementary:
    • source coding makes the representation efficient;
    • channel coding makes the transmission reliable.
    Shannon’s separation theorem allows them to be designed separately: compress to near the entropy, then add just enough redundancy to operate below channel capacity with an arbitrarily small error probability.

✓ Answer checked step by step Standard reasoning.

↑ Back to the question list

Discuss three kinds of error-detection codes and explain how they detect errors.

2000 · Paper II · Q4b · 20 marks

Solution

Three kinds of error-detection codes

1. Parity check (vertical redundancy check, VRC)

  • A parity bit is added to each character or word so that the total number of 1s is even (or odd).
  • The receiver counts the 1s. A wrong parity means an error.
  • It detects all odd numbers of errors in the word, but misses even numbers of errors.
  • Longitudinal / block parity (LRC): parity across the same bit positions of a block of characters (a parity row). Combined with VRC, it can detect most errors and locate (correct) single errors.

2. Checksum

  • The data words are added (modulo 2n, or one’s-complement arithmetic). The complement of the sum is sent as the checksum.
  • The receiver adds all words plus the checksum. A non-zero (or not all-1s) result means an error.
  • Simple in software (Internet protocols, IP and TCP). It detects most errors, but misses errors that cancel in the sum, and the reordering of words.

3. Cyclic redundancy check (CRC)

  • The message polynomial M(x), shifted by r bits, is divided by a generator G(x) of degree r. The remainder (FCS) is appended.
  • The receiver divides the received frame by G(x). A non-zero remainder indicates an error.
  • It detects:
    • all single errors;
    • all double errors (for suitable G);
    • all odd numbers of errors, if (x+1) divides G;
    • all bursts of length ≤r;
    • most longer bursts, with probability 1−2−r.
  • Easily implemented with shift registers and XOR gates. Used in HDLC, Ethernet (CRC-32), USB and storage.

(Other detecting codes include constant-ratio codes, such as 2-out-of-5, and Hamming codes used in detection mode.)

✓ Answer checked step by step Standard description.

↑ Back to the question list

More on Digital Communication

Questions: UPSC Civil Services (Main) Examination, Electrical Engineering Paper II, 2000–2026. Solutions: Optional Province. Found an error? Tell us.

Spotted an error? Tell us.

We classify every PYQ with care, but mistakes can slip in. If a question is in the wrong topic, has a typo, the wrong year, or is missing, let us know. We review every report and update the page.

Report an Error
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted