# 循环码

循环码是一种线性纠错码，其中码字的每一次循环移位仍是码字：若 \( (c_0, c_1, \ldots, c_{n-1}) \) 属于该码，则 \( (c_{n-1}, c_0, c_1, \ldots, c_{n-2}) \) 也属于该码。<sup>[1](https://pfister.ee.duke.edu/courses/ece590_ecc/cyclic.pdf)</sup> 这一条封闭性质将循环码与模 \( x^n - 1 \) 的[多项式](https://www.edgepedia.org/zh/polynomial)算术联系起来，这正是其编码与译码在算法和硬件两方面都异常高效的原因。<sup>[1](https://pfister.ee.duke.edu/courses/ece590_ecc/cyclic.pdf)</sup> 循环码在检错方面尤为高效，许多部署最广泛的码族——包括 BCH 码、里德-所罗门码和 CRC 码——都是循环码。<sup>[2](https://personal.oss.unist.hr/~mnizetic/ZASTITNO%20LINIJSKO%20KODIRANJE/SEMINARSKI%20RADOVI/CH05.pdf)</sup>

| 关键事实 | 说明 |
|---|---|
| 定义性质 | 码字的任何循环移位仍是码字<sup>[1](https://pfister.ee.duke.edu/courses/ece590_ecc/cyclic.pdf)</sup> |
| 代数形式 | \( \mathbb{F}_q \) 上长度为 \( n \) 的线性循环码是 \( \mathbb{F}_q[x]/\langle x^n - 1 \rangle \) 中的一个理想<sup>[3](https://arxiv.org/html/2410.12167)</sup> |
| 生成多项式 | 码中次数最低的唯一首一多项式 \( g(x) \)，它整除 \( x^n - 1 \)，校验多项式为 \( h(x) = (x^n - 1)/g(x) \)<sup>[4](https://www.sciencedirect.com/science/article/abs/pii/S0012365X24000499)</sup> |
| 系统编码 | 校验位 \( p(x) = -x^{n-k} m(x) \bmod g(x) \)，由移位寄存器电路计算<sup>[1](https://pfister.ee.duke.edu/courses/ece590_ecc/cyclic.pdf)</sup> |
| BCH 界 | 定义集中 \( \delta - 1 \) 个连续整数意味着最小距离 \( d \ge \delta \)<sup>[4](https://www.sciencedirect.com/science/article/abs/pii/S0012365X24000499)</sup> |
| BCH 码的优良性 | 在所有奇数长度 \( n \le 125 \) 的二进制循环码中，除两种特殊情况外，最佳循环码都是 BCH 码<sup>[4](https://www.sciencedirect.com/science/article/abs/pii/S0012365X24000499)</sup> |
| 里程碑应用 | 里德-所罗门码于 1977 年在旅行者号太空计划中实现，1982 年首次用于大众消费产品的商业用途<sup>[5](https://www.fi.muni.cz/usr/gruska/crypto16/crypto1603_handout.pdf)</sup> |

## 工作原理

将向量 \( (c_0, c_1, \ldots, c_{n-1}) \) 与多项式 \( c(x) = c_0 + c_1 \cdot x + \cdots + c_{n-1} \cdot x^{n-1} \) 等同起来。一次一位的循环移位便对应于模 \( x^n - 1 \) 乘以 \( x \)，因此一个线性码是循环码，当且仅当其码字多项式构成剩余类环 \( \mathbb{F}_q[x]/(x^n - 1) \) 中的一个理想。<sup>[6](https://pages.jh.edu/bcooper8/sigma_files/ERROR_CONTROL_CODING/04cyc.pdf)</sup> 由于该商环是主理想环，每个循环码都由单个多项式生成。<sup>[3](https://arxiv.org/html/2410.12167)</sup>

该生成元是码中次数最低的唯一首一多项式；它整除 \( x^n - 1 \)，校验多项式为 \( h(x) = (x^n - 1)/g(x) \)。<sup>[4](https://www.sciencedirect.com/science/article/abs/pii/S0012365X24000499)</sup> 对于 \( (n, k) \) 二进制循环码，\( \deg g(x) = n - k \)。<sup>[7](https://dept.ee.wits.ac.za/~cheng/ELEN3015/Files/cyclic_FEC.pdf)</sup> 给定长度的循环码的完全分类可由 \( x^n - 1 \) 在 \( \mathbb{F}_q \) 上的因式分解得出，因为 \( x^n - 1 \) 的每个由不可约因子构成的首一因式都生成某个循环码的理想。<sup>[8](https://www.irishmathsoc.org/bull95/wef/Articles/Coding_History/Coding_History-wef.pdf)</sup>

\( g(x) \) 的根决定最小距离。若定义集包含 \( \delta - 1 \) 个连续整数，则 \( d \ge \delta \)；这就是 BCH 界。<sup>[4](https://www.sciencedirect.com/science/article/abs/pii/S0012365X24000499)</sup>

## 实现方法

**系统编码**将消息置于高位，并附加校验位。对于次数低于 \( k \) 的消息多项式 \( m(x) \)，计算余式 \( p(x) = -x^{n-k} m(x) \bmod g(x) \)；则 \( c(x) = p(x) + x^{n-k} m(x) \) 是一个码字，因为它能被 \( g(x) \) 整除。<sup>[1](https://pfister.ee.duke.edu/courses/ece590_ecc/cyclic.pdf)</sup> 该余式由多项式除法得到，\( x^r m(x) = q(x) g(x) + s(x) \)，其中 \( \deg s(x) < \deg g(x) = r \)，码字为 \( x^r m(x) - s(x) \)。<sup>[9](https://users.math.msu.edu/users/halljo/classes/codenotes/Cyclic.pdf)</sup> 在非系统形式中，只需发送 \( c(x) = m(x) g(x) \)。<sup>[10](https://www.ece.uvic.ca/~agullive/cycliccodes405-511-2016.pdf)</sup>

**硬件实现。** 多项式除法由线性反馈移位寄存器（LFSR）完成，其反馈连接与 \( g(x) \) 的系数相匹配；输入移入完毕后，寄存器中保存的即为余式。<sup>[10](https://www.ece.uvic.ca/~agullive/cycliccodes405-511-2016.pdf)</sup> 一个带反馈的 \( (n-k) \) 级移位寄存器同时完成乘以 \( x^{n-k} \) 和除以 \( g(x) \) 的运算，经过 \( k \) 次移位后产生校验系数。<sup>[11](http://charleslee.yolasite.com/resources/elec321/lect_cyc_enc_dec.pdf)</sup> 低重量的生成多项式可简化该电路，这也是缩短循环汉明码子码被用作 CRC 码的原因之一。<sup>[9](https://users.math.msu.edu/users/halljo/classes/codenotes/Cyclic.pdf)</sup>

**译码**分三步进行：伴随式计算、错误图样检测和纠错。伴随式多项式为 \( s(x) = r(x) \bmod g(x) \)，对每个不同的伴随式，选择一个错误图样进行纠正。<sup>[1](https://pfister.ee.duke.edu/courses/ece590_ecc/cyclic.pdf)</sup> 梅吉特译码器利用循环性，仅对最高位 \( x^{n-1} \) 处有错误的错误图样检验伴随式，因此同一检测电路可串行地译出每个接收码元；原则上它可译任何循环码，但在多错纠正时实现复杂度极高，捕错译码是一种实用的变体。

## 起源

循环码的代数框架源于早期的差错控制工作：R. W. 汉明（R. W. Hamming）的论文《检错与纠错码》（《贝尔系统技术期刊》，1950 年）引入了汉明码，后来的循环构造对其进行了推广。<sup>[12](https://doi.org/10.1002/j.1538-7305.1950.tb00463.x)</sup> 向接近容量编码的更广泛转变发生在后来——克洛德·贝鲁（Claude Berrou）、阿兰·格拉维厄（Alain Glavieux）和蓬亚·提提玛吉玛（Punya Thitimajshima）于 1993 年在日内瓦举行的 IEEE 国际通信会议（ICC '93）上发表了《接近香农极限的纠错编码与译码：涡轮码》，提出了涡轮码，不久之后 LDPC 码被重新发现。<sup>[13](https://www.jstage.jst.go.jp/article/transcom/E105.B/8/E105.B_2021EBI0001/_pdf/-char/ja)</sup>

## 变体

**BCH 码**是生成多项式为最小多项式 \( m_{\alpha^{j+b}, K}(x) \)（\( 1 \le j \le t \)）的最小公倍数的循环码；其设计距离为 \( t + 1 \)，最小距离至少为 \( t + 1 \)，维数至少为 \( n - mt \)，其中 \( m = \dim_K \mathbb{F} \)。<sup>[9](https://users.math.msu.edu/users/halljo/classes/codenotes/Cyclic.pdf)</sup> 在许多情况下它们是最佳线性码：在奇数长度 \( n \le 125 \) 的二进制循环码中，除两种特殊情况外，最佳者总是 BCH 码。<sup>[4](https://www.sciencedirect.com/science/article/abs/pii/S0012365X24000499)</sup>

**二进制汉明码**构成一个循环码族，\( n = 2^r - 1 \)，\( k = n - r \)，可纠正所有单个错误。<sup>[1](https://pfister.ee.duke.edu/courses/ece590_ecc/cyclic.pdf)</sup> **里德-所罗门码**是非二进制 BCH 码，广泛用于通信设备和消费电子产品。<sup>[4](https://www.sciencedirect.com/science/article/abs/pii/S0012365X24000499)</sup> **CRC 码**对次数为 \( r \) 的生成多项式 \( g(x) \)，按 \( p(x) = x^r m(x) \bmod g(x) \) 计算校验位，附加余式使所得码字能被 \( g(x) \) 整除，而不约束消息长度；标准中定义的 CRC 常有细微差异。<sup>[1](https://pfister.ee.duke.edu/courses/ece590_ecc/cyclic.pdf)</sup> 其他有名称的循环码族包括[欧几里得几何](https://www.edgepedia.org/zh/euclidean-geometry)码、射影几何码、二次剩余码和法尔码。<sup>[2](https://personal.oss.unist.hr/~mnizetic/ZASTITNO%20LINIJSKO%20KODIRANJE/SEMINARSKI%20RADOVI/CH05.pdf)</sup>

**准循环码**放宽了移位条件：指标为 \( \ell \) 的准循环码是在循环移位 \( \ell \) 位下封闭的线性码。<sup>[3](https://arxiv.org/html/2410.12167)</sup> QC-LDPC 码更进一步：其校验矩阵是循环矩阵的阵列，同构于 \( \mathbb{F}_2 \) 上模 \( x^N - 1 \) 的多项式，这使得高效编码和置信传播译码成为可能。<sup>[14](https://arxiv.org/pdf/2508.07030)</sup> 循环结构也延伸到量子编码：\( \mathbb{F}_{p^2} \) 上的加性循环码由至多两个生成多项式唯一表示，这一表示产生了十个破纪录的二进制量子码，<sup>[15](https://www.aimsciences.org/article/doi/10.3934/amc.2023036)</sup> 非二进制量子码也同样由单生成元准循环码构造，将码字与 \( \mathbb{F}_q[x]/\langle x^n - 1 \rangle \) 中的多项式等同。<sup>[16](https://ar5iv.labs.arxiv.org/html/2412.13613)</sup>

## 应用

用二进制循环码检错，是将接收多项式 \( y(x) \) 除以 \( g(x) \)：余式为零当且仅当 \( y \) 是码字，而长除法直接由电路实现。以太网中的检错在实践中就是这样进行的。<sup>[17](https://personalpages.manchester.ac.uk/staff/yuri.bazlov/code/notes/ch9.pdf)</sup> 循环码在错误成串出现时尤为有用。<sup>[5](https://www.fi.muni.cz/usr/gruska/crypto16/crypto1603_handout.pdf)</sup> 里德-所罗门码于 1977 年在旅行者号太空计划中实现，1982 年首次用于大众消费产品的商业用途。<sup>[5](https://www.fi.muni.cz/usr/gruska/crypto16/crypto1603_handout.pdf)</sup> 缩短循环汉明码子码仍是网络 CRC 码的基础。<sup>[9](https://users.math.msu.edu/users/halljo/classes/codenotes/Cyclic.pdf)</sup>

## 局限与替代方案

梅吉特译码器的串行模式匹配方法在需纠正多个错误时实现复杂度极高，这限制了它在强码中的应用。对于接近容量的性能，现代替代方案的工作方式不同：1993 年提出的涡轮码<sup>[13](https://www.jstage.jst.go.jp/article/transcom/E105.B/8/E105.B_2021EBI0001/_pdf/-char/ja)</sup> 和 LDPC 码在块长 \( n = 10^3 \) 到 \( 10^4 \) 时使用迭代译码，原始涡轮码仍属于已知最佳之列。<sup>[18](https://ocw.mit.edu/courses/6-451-principles-of-digital-communication-ii-spring-2005/1a3ad00d83d1d042da3328a8edd9edc2_chap13.pdf)</sup> [极化码](https://www.edgepedia.org/zh/polar-codes)通过信道极化达到容量，但其有限长性能起初并不具竞争力，因为逐次消除译码是次优的，且其最小距离相对较弱，而串行 SC 译码器的延迟至少随码长线性增长，形成吞吐量瓶颈。<sup>[19](https://ar5iv.labs.arxiv.org/html/1504.03916)</sup> 在无线系统设计中，准循环分组 LDPC 码和双二进制涡轮码成为主要候选方案，而并行化和定点行为等实现方面在码设计中常被忽视。<sup>[20](https://www.vodafone-chair.org/pbls/legacy/e-zimmermann/Block-LDPC_Codes_vs_Duo-Binary_Turbo-Codes_for_European_Next_Generation_Wireless_Systems.pdf)</sup> 近期关于 QC-LDPC 码的工作直接处理设计实际问题，例如从多项式校验矩阵的子式来计算任何 QC-LDPC 码的维数，而非使用 \( O(n^3) \) 的高斯消元。<sup>[14](https://arxiv.org/pdf/2508.07030)</sup>

## References

1. [Cyclic Codes (ECE 590 Error Correction Coding course notes, Duke University, Pfister)](https://pfister.ee.duke.edu/courses/ece590_ecc/cyclic.pdf)
2. [Cyclic codes (textbook chapter, ch. 5)](https://personal.oss.unist.hr/~mnizetic/ZASTITNO%20LINIJSKO%20KODIRANJE/SEMINARSKI%20RADOVI/CH05.pdf)
3. [Elementary Constructions of Best Known Quantum Codes (arXiv, 2024)](https://arxiv.org/html/2410.12167)
4. [BCH cyclic codes (C. Ding and C. Li, Discrete Mathematics 347 (2024) 113918)](https://www.sciencedirect.com/science/article/abs/pii/S0012365X24000499)
5. [Coding, Cryptography and Cryptographic Protocols (Masaryk University handout)](https://www.fi.muni.cz/usr/gruska/crypto16/crypto1603_handout.pdf)
6. [4.0 Cyclic Codes (Johns Hopkins course notes)](https://pages.jh.edu/bcooper8/sigma_files/ERROR_CONTROL_CODING/04cyc.pdf)
7. [Cyclic Codes (ELEN3015 notes, University of the Witwatersrand)](https://dept.ee.wits.ac.za/~cheng/ELEN3015/Files/cyclic_FEC.pdf)
8. [Coding Theory: The story of how an engineering problem evolved into a branch of pure mathematics](https://www.irishmathsoc.org/bull95/wef/Articles/Coding_History/Coding_History-wef.pdf)
9. [Cyclic Codes (Chapter 8, Coding Theory Notes, Michigan State University, J. Hall)](https://users.math.msu.edu/users/halljo/classes/codenotes/Cyclic.pdf)
10. [ELEC405 Error Control Coding: Cyclic codes (University of Victoria)](https://www.ece.uvic.ca/~agullive/cycliccodes405-511-2016.pdf)
11. [Encoding and Syndrome Decoding of Cyclic Codes (ELEC 321 lecture notes, Charles Lee)](http://charleslee.yolasite.com/resources/elec321/lect_cyc_enc_dec.pdf)
12. [R. W. Hamming (1950). Error Detecting and Error Correcting Codes. Bell System Technical Journal.](https://doi.org/10.1002/j.1538-7305.1950.tb00463.x)
13. [LDPC Codes for Communication Systems: Coding Theoretic Perspective (IEICE Trans. Commun.)](https://www.jstage.jst.go.jp/article/transcom/E105.B/8/E105.B_2021EBI0001/_pdf/-char/ja)
14. [Generalized Quasi-Cyclic LDPC Codes: Design and Efficient Encoding (arXiv, 2025)](https://arxiv.org/pdf/2508.07030)
15. [Polynomial representation of additive cyclic codes and new quantum codes (Advances in Mathematics of Communication)](https://www.aimsciences.org/article/doi/10.3934/amc.2023036)
16. [Some New Non-binary Quantum Codes from One-generator Quasi-cyclic Codes (arXiv, Dec 2024)](https://ar5iv.labs.arxiv.org/html/2412.13613)
17. [Cyclic codes (lecture notes, University of Manchester)](https://personalpages.manchester.ac.uk/staff/yuri.bazlov/code/notes/ch9.pdf)
18. [Capacity-approaching codes (MIT OCW 6.451, Ch. 13)](https://ocw.mit.edu/courses/6-451-principles-of-digital-communication-ii-spring-2005/1a3ad00d83d1d042da3328a8edd9edc2_chap13.pdf)
19. [Challenges and some new directions in channel coding (arXiv survey)](https://ar5iv.labs.arxiv.org/html/1504.03916)
20. [Block-LDPC Codes vs Duo-Binary Turbo-Codes for European Next Generation Wireless Systems](https://www.vodafone-chair.org/pbls/legacy/e-zimmermann/Block-LDPC_Codes_vs_Duo-Binary_Turbo-Codes_for_European_Next_Generation_Wireless_Systems.pdf)

---
*Initially written Sep 29, 2026 · Edited: Oct 15, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 人工智能与数据 › Algorithms and computational methods

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/cyclic-code

English original: https://www.edgepedia.org/cyclic-code
