Skip to main content

(7,4) cyclic code with g(x) = x³ + x² + 1 for 1011

Short answer

For data 1011 (polynomial x^3+x+1), non-systematic codeword is 1111111. Systematic: multiply by x^3, divide by g(x)=x^3+x^2+1, remainder x^2 gives parity 100, so systematic codeword is 1011100.

What is binary Cyclic code? Construct a (7,4) binary Cyclic Code using a generator polynomial g(x) = x³ + x² + 1 with data Vector (1011).

Binary cyclic code

A binary cyclic code is a linear block code in which every cyclic shift of a codeword is also a codeword. If (c0,c1,…,cn−1)(c_0,c_1,\dots,c_{n-1}) is a codeword, so is (cn−1,c0,…,cn−2)(c_{n-1},c_0,\dots,c_{n-2}).

Code vectors are treated as polynomials c(x)=c0+c1x+⋯+cn−1xn−1c(x)=c_0+c_1x+\dots+c_{n-1}x^{n-1}. An (n,k)(n,k) cyclic code is defined by a generator polynomial g(x)g(x) of degree n−kn-k that divides xn+1x^n+1. Every codeword is a multiple of g(x)g(x). Cyclic codes are easy to encode and decode with shift registers (used in CRC).

Given

(n,k)=(7,4)(n,k)=(7,4), n−k=3n-k=3, g(x)=x3+x2+1g(x)=x^3+x^2+1. It is a valid generator since x7+1=(x+1)(x3+x+1)(x3+x2+1)x^7+1=(x+1)(x^3+x+1)(x^3+x^2+1).

Convention: the leftmost data bit is the highest power. Data 10111011:

d(x)=x3+x+1d(x)=x^3+x+1

All arithmetic is modulo 2 (1+1=01+1=0).

(a) Non-systematic codeword

c(x)=d(x) g(x)=(x3+x+1)(x3+x2+1)=x6+x5+x3+x4+x3+x+x3+x2+1=x6+x5+x4+x3+x2+x+1\begin{aligned} c(x)&=d(x)\,g(x)=(x^3+x+1)(x^3+x^2+1)\\ &=x^6+x^5+x^3+x^4+x^3+x+x^3+x^2+1\\ &=x^6+x^5+x^4+x^3+x^2+x+1 \end{aligned}

(three x3x^3 terms leave one x3x^3.)

Non-systematic code vector: 1 1 1 1 1 1 1

(b) Systematic codeword

Steps: multiply by xn−k=x3x^{n-k}=x^3, divide by g(x)g(x), append the remainder as parity bits.

x3d(x)=x6+x4+x3x^3d(x)=x^6+x^4+x^3

Long division by g(x)=x3+x2+1g(x)=x^3+x^2+1:

              x^3 + x^2            <- quotient
          ---------------------------
x^3+x^2+1 ) x^6 +     x^4 + x^3
            x^6 + x^5 +       x^3
            -----------------------
                  x^5 + x^4
                  x^5 + x^4 +       x^2
                  -------------------
                                    x^2   <- remainder

Remainder p(x)=x2p(x)=x^2, i.e. parity bits (x2,x1,x0)=1 0 0(x^2,x^1,x^0)=1\,0\,0.

c(x)=x3d(x)+p(x)=x6+x4+x3+x2c(x)=x^3d(x)+p(x)=x^6+x^4+x^3+x^2

Check: c(x)=(x3+x2) g(x)c(x)=(x^3+x^2)\,g(x), a multiple of g(x)g(x), so it is a valid codeword.

Systematic code vector: 1 0 1 1 | 1 0 0 (data bits followed by parity bits).

Shift-register encoder check

The remainder can be produced by a 3-stage feedback shift register (taps at the non-zero coefficients of g(x)=1+x2+x3g(x)=1+x^2+x^3). With feedback f=input⊕r2f=\text{input}\oplus r_2, the update is r0←fr_0\leftarrow f, r1←r0r_1\leftarrow r_0, r2←r1⊕fr_2\leftarrow r_1\oplus f.

Input (MSB first)ffr0r_0r1r_1r2r_2
start000
11101
01111
10011
10001

After 4 shifts the register holds (r0,r1,r2)=(0,0,1)(r_0,r_1,r_2)=(0,0,1), i.e. remainder x2x^2; read out r2r1r0=100r_2r_1r_0=100, the same parity bits as the long division. The 4 data bits are sent first, then the gate opens and the 3 parity bits follow.

FormCode vector
Non-systematic1111111
Systematic1011100

✓ Answer checked by Claude Opus 5.5 (high effort)

All Communication Systems chapter 8 questions →