---
title: "(7,4) cyclic code with g(x) = x³ + x² + 1 for 1011"
subject: "Communication Systems"
chapter: 8
key: "semester_6/communication_systems:cyclic-code-7-4-1011-x3x2"
source: https://www.bctengineer.com/q/semester_6/communication_systems/cyclic-code-7-4-1011-x3x2
site: BCT Engineering
---

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

Communication Systems · Chapter 8: Error Detection and Correction Coding

- Asked in: 2080 Baisakh (CS II), 10 marks; 2070 Asar (CS II), 1+4 marks (asked 2 times)
- Video: [Cyclic Encoder Designing with Example in Digital Communication by Engineering Funda](https://www.youtube.com/watch?v=F8kIEAn6XWk) — Engineering Funda
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_6/communication_systems/cyclic-code-7-4-1011-x3x2
- Whole chapter: https://www.bctengineer.com/md/semester_6/communication_systems/chapter-8

## Question

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).

## 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.

## Answer

#### 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 $(c_0,c_1,\dots,c_{n-1})$ is a codeword, so is $(c_{n-1},c_0,\dots,c_{n-2})$.

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

#### Given

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

Convention: the leftmost data bit is the highest power. Data $1011$:

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

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

#### (a) Non-systematic codeword

$$
\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 $x^3$ terms leave one $x^3$.)

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

#### (b) Systematic codeword

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

$$
x^3d(x)=x^6+x^4+x^3
$$

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

```text
              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)=x^2$, i.e. parity bits $(x^2,x^1,x^0)=1\,0\,0$.

$$
c(x)=x^3d(x)+p(x)=x^6+x^4+x^3+x^2
$$

Check: $c(x)=(x^3+x^2)\,g(x)$, a multiple of $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+x^2+x^3$). With feedback $f=\text{input}\oplus r_2$, the update is $r_0\leftarrow f$, $r_1\leftarrow r_0$, $r_2\leftarrow r_1\oplus f$.

| Input (MSB first) | $f$ | $r_0$ | $r_1$ | $r_2$ |
|---|---|---|---|---|
| start | | 0 | 0 | 0 |
| 1 | 1 | 1 | 0 | 1 |
| 0 | 1 | 1 | 1 | 1 |
| 1 | 0 | 0 | 1 | 1 |
| 1 | 0 | 0 | 0 | 1 |

After 4 shifts the register holds $(r_0,r_1,r_2)=(0,0,1)$, i.e. remainder $x^2$; read out $r_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.

| Form | Code vector |
|---|---|
| Non-systematic | 1111111 |
| Systematic | 1011100 |

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. What defines a binary cyclic code?
   A. Every codeword has even weight
   B. It is a linear block code in which every cyclic shift of a codeword is also a codeword
   C. It has no parity bits
   D. Its codewords are all palindromes
   Answer: B. A cyclic code is a linear block code closed under cyclic shifts. (Key point: Cyclic code property)

2. For an (n,k) cyclic code, what must g(x) satisfy?
   A. Degree n and divide x^k + 1
   B. Degree n-k and divide x^n + 1
   C. Degree k and divide x^n + 1
   D. Degree n-k and equal x^n + 1
   Answer: B. For (7,4), g(x) = x^3 + x^2 + 1 has degree 3 and is a factor of x^7 + 1. (Key point: Generator polynomial condition)

3. With d(x) = x^3 + x + 1 and g(x) = x^3 + x^2 + 1, what is the non-systematic code vector c(x) = d(x)g(x)?
   A. 1011100
   B. 1111111
   C. 1010001
   D. 0001101
   Answer: B. The product is x^6+x^5+x^4+x^3+x^2+x+1 after mod-2 cancellation (three x^3 terms leave one). (Key point: Non-systematic codeword)

4. In the systematic method, what is done with x^3 d(x) = x^6 + x^4 + x^3 and what is the result?
   A. Divide by g(x); remainder x^2 gives parity 100, so codeword 1011100
   B. Multiply by g(x); the product gives 1111111
   C. Divide by g(x); remainder 1 gives codeword 1011001
   D. Add g(x); gives 1010111
   Answer: A. The remainder x^2 gives parity bits 100, appended to the data 1011 to give 1011100, which is a multiple of g(x). (Key point: Systematic codeword)

## Related in Communication Systems

- [Hamming weight and distance; (7,4) cyclic code for 1011](https://www.bctengineer.com/question.md?key=semester_6%2Fcommunication_systems%3Ahamming-weight-cyclic-1011) — Communication Systems, chapter 8, asked 2×
- [Convolutional vs block codes; (7,4) cyclic code for 1011](https://www.bctengineer.com/question.md?key=semester_6%2Fcommunication_systems%3Aconv-vs-block-cyclic-7-4-1011) — Communication Systems, chapter 8, asked 2×
- [(7,4) cyclic code g(x) = 1 + x + x³ for 1011](https://www.bctengineer.com/question.md?key=semester_6%2Fcommunication_systems%3Acyclic-7-4-1x-x3-1011) — Communication Systems, chapter 8, asked 2×
- [(7,4) cyclic code G(p) = p³ + p + 1 for 0101](https://www.bctengineer.com/question.md?key=semester_6%2Fcommunication_systems%3Acyclic-7-4-p3p1-0101) — Communication Systems, chapter 8, asked 2×
- [Convolutional vs block coder; (7,4) cyclic code for 1010](https://www.bctengineer.com/question.md?key=semester_6%2Fcommunication_systems%3Aconv-vs-block-cyclic-7-4-1010) — Communication Systems, chapter 8, asked 2×
- [Significance of dmin; (7,4) cyclic code for 1101 with g(x) = 1 + x + x²](https://www.bctengineer.com/question.md?key=semester_6%2Fcommunication_systems%3Admin-cyclic-7-4-1101) — Communication Systems, chapter 8

## Related in other subjects

- [Construct a (7,4) Hamming code](https://www.bctengineer.com/question.md?key=semester_5%2Fdata_communication%3Ahamming-74-construct) — Data Communication, chapter 8
- [Cyclic Redundancy Code with example](https://www.bctengineer.com/question.md?key=semester_5%2Finstrumentation_ii%3Acrc-example) — Instrumentation II, chapter 3
- [SISO register with 1011 data](https://www.bctengineer.com/question.md?key=semester_3%2Fdigital_logic%3Asiso-1011-data) — Digital Logic, chapter 7, asked 9×
- [PISO shift register with 1011 data](https://www.bctengineer.com/question.md?key=semester_3%2Fdigital_logic%3Apiso-1011-store-retrieve) — Digital Logic, chapter 7, asked 4×
