---
title: "Cyclic codes"
subject: "Data Communication"
chapter: 8
key: "semester_5/data_communication:cyclic-codes"
source: https://www.bctengineer.com/q/semester_5/data_communication/cyclic-codes
site: BCT Engineering
---

# Cyclic codes

Data Communication · Chapter 8: Information Theory and Coding

- Asked in: 2078 Kartik, 3 marks; 2071 Shrawan, 3 marks; 2070 Chaitra, 5 marks (asked 3 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 Sonnet 5.5 on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_5/data_communication/cyclic-codes
- Whole chapter: https://www.bctengineer.com/md/semester_5/data_communication/chapter-8

## Question

Define cyclic codes. Under what conditions does a linear code become a cyclic code? Explain with example.

## Short answer

A cyclic code is a linear block code where every cyclic shift of a codeword is also a codeword. A linear code becomes cyclic if it is generated by a polynomial g(x) that divides x^n+1. For example, the (7,4) code with g(x)=x^3+x+1 gives codeword 1001110; its shifts like 0011101 are also codewords.

## Answer

#### Definition
A **cyclic code** is a linear block code with the extra property that a cyclic (end-around) shift of any codeword gives another codeword of the same code. If (c₀ c₁ … c_{n−1}) is a codeword, then (c_{n−1} c₀ … c_{n−2}) is also a codeword.

#### Conditions for a linear code to be cyclic
1. The code is **linear**: the sum (modulo 2) of any two codewords is also a codeword (and the all-zero word is a codeword).
2. It is **closed under cyclic shift**.

In polynomial form, a code of length n with codeword polynomial c(x) is cyclic if it is generated by a **generator polynomial g(x)** of degree n − k that is a **factor of xⁿ + 1**. Every codeword is c(x) = m(x)·g(x), where m(x) is the message polynomial.

#### Example: (7,4) cyclic code
xⁿ + 1 = x⁷ + 1 = (x + 1)(x³ + x + 1)(x³ + x² + 1). Choose **g(x) = x³ + x + 1** (1011).

Systematic encoding of m = 1001: m(x) = x³ + 1.
- x³·m(x) = x⁶ + x³ → 1001000
- Divide 1001000 by 1011: remainder = 110
- Codeword = 1001**110**

Cyclic shifts of 1001110: 0011101, 0111010, 1110100, 1101001, 1010011, 0100111. Each of them is again a codeword of this code (for example 0011101 = (x + 1)·g(x)), which shows the cyclic property.

Cyclic codes are easily implemented with shift registers and XOR gates, and CRC and BCH codes belong to this family.

## Check yourself

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

1. What defines a cyclic code?
   A. Linear code where a cyclic shift of a codeword is also a codeword
   B. Any code with parity
   C. Non-linear code
   D. A code with fixed weight
   Answer: A. It is linear and closed under cyclic shift. (Key point: Definition)

2. What must g(x) satisfy?
   A. Degree n-k and factor of x^n + 1
   B. Degree k
   C. Any polynomial
   D. Degree n+1
   Answer: A. g(x) has degree n-k and divides x^n + 1. (Key point: Generator condition)

3. How are codewords formed?
   A. c(x) = m(x) g(x)
   B. c(x) = m(x) + g(x)
   C. c(x) = g(x)/m(x)
   D. c(x) = m(x)^2
   Answer: A. Every codeword is a multiple of g(x). (Key point: Codeword formation)

4. Cyclic codes are easily implemented using
   A. Shift registers and XOR gates
   B. Large memories
   C. ROM only
   D. Analog filters
   Answer: A. Shift registers and XORs; CRC and BCH are examples. (Key point: Implementation)

## Related in Data Communication

- [Redundancy, Hamming distance, linear vs cyclic](https://www.bctengineer.com/question.md?key=semester_5%2Fdata_communication%3Aredundancy-hamming-linear-cyclic) — Data Communication, chapter 8
- [Design a C(8,4) linear block code](https://www.bctengineer.com/question.md?key=semester_5%2Fdata_communication%3Alinear-block-code-84) — Data Communication, chapter 8
- [Hamming codes and their properties](https://www.bctengineer.com/question.md?key=semester_5%2Fdata_communication%3Ahamming-code-properties) — Data Communication, chapter 8
- [(6,3) block code words, weights, dmin](https://www.bctengineer.com/question.md?key=semester_5%2Fdata_communication%3Ablock-code-63-matrix-weights) — Data Communication, chapter 8
- [All code words of the (6,3) code with given G](https://www.bctengineer.com/question.md?key=semester_5%2Fdata_communication%3Ablock-code-63-all-codewords) — Data Communication, chapter 8

## Related in other subjects

- [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 with g(x) = x³ + x² + 1 for 1011](https://www.bctengineer.com/question.md?key=semester_6%2Fcommunication_systems%3Acyclic-code-7-4-1011-x3x2) — Communication Systems, chapter 8, asked 2×
- [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×
- [(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×
