Constant-weight code
In coding theory, a constant-weight code, also called an m-of-n code or m-out-of-n code, is an error detection and correction code where all codewords share the same Hamming weight. The one-hot code and the balanced code are two widely used kinds of constant-weight code. The theory is closely connected to that of designs (such as t-designs and Steiner systems). Most of the work on this field of discrete mathematics is concerned with binary constant-weight codes. Binary constant-weight codes have several applications, including frequency hopping in GSM networks. Most barcodes use a binary constant-weight code to simplify automatically setting the brightness threshold that distinguishes black and white stripes. Most line codes use either a constant-weight code, or a nearly-constant-weight paired disparity code. In addition to use as error correction codes, the large space between code words can also be used in the design of asynchronous circuits such as delay insensitive circuits. Constant-weight codes, like Berger codes, can detect all unidirectional errors.
In coding theory, a constant-weight code, also called an m-of-n code or m-out-of-n code, is an error detection and correction code where all codewords share the same Hamming weight. The one-hot code and the balanced code are two widely used kinds of constant-weight code. The theory is closely connected to that of designs (such as t-designs and Steiner systems). Most of the work on this field of discrete mathematics is concerned with binary constant-weight codes. Binary constant-weight codes have several applications, including frequency hopping in GSM networks. Most barcodes use a binary constant-weight code to simplify automatically setting the brightness threshold that distinguishes black and white stripes. Most line codes use either a constant-weight code, or a nearly-constant-weight paired disparity code. In addition to use as error correction codes, the large space between code words can also be used in the design of asynchronous circuits such as delay insensitive circuits. Constant-weight codes, like Berger codes, can detect all unidirectional errors. A special case of constant weight codes are the one-of-N codes, that encode \log_2 N bits in a code-word of N bits. The one-of-two code uses the code words 01 and 10 to encode the bits '0' and '1'. A one-of-four code can use the words 0001, 0010, 0100, 1000 in order to encode two bits 00, 01, 10, and 11. An example is dual rail encoding, and chain link used in delay insensitive circuits. For these codes, n=N,~ d=2,~ w=1 and A(n, d, w) = n . Some of the more notable uses of one-hot codes include biphase mark code uses a 1-of-2 code; pulse-position modulation uses a 1-of-n code; address decoder, etc. == m-of-n codes== An m-of-n code is a separable error detection code with a code word length of n bits, where each code word contains exactly m instances of a "one". A single bit error will cause the code word to have either or "ones". An example m-of-n code is the 2-of-5 code used by the United States Postal Service. The simplest implementation is to append a string of ones to the original data until it contains m ones, then append zeros to create a code of length n. Example: Some of the more notable uses of constant-weight codes, other than the one-hot and balanced-weight codes already mentioned above, include Code 39 uses a 3-of-9 code; bi-quinary coded decimal code uses a 2-of-7 code, the 2-of-5 code, etc.
References
No reference rows published for this article.
Cite this article
MLA
"Constant-weight code." encyclopegia.org, 2025, https://encyclopegia.org/wiki/constant-weight-code. Accessed 24 November 2026.
Chicago
"Constant-weight code." encyclopegia.org. Accessed November 24, 2026. https://encyclopegia.org/wiki/constant-weight-code.
APA
encyclopegia.org. (2025). Constant-weight code. Retrieved November 24, 2026, from https://encyclopegia.org/wiki/constant-weight-code
Accessed November 24, 2026 · CC BY-SA 4.0 · citation page · JSON