Skip to Content
EntropyEntropy
  • Article
  • Open Access

9 January 2026

17 Pages

Concatenated Constrained Coding: A New Approach to Efficient Constant-Weight Codes

,
,
and
1
Turing Machines Inc., Willemskade 15, 3016 DK Rotterdam, The Netherlands
2
Department of Applied Mathematics, Delft University of Technology, 2628 CD Delft, The Netherlands
3
Science, Mathematics and Technology Cluster, Singapore University of Technology and Design (SUTD), 8 Somapah Rd, Singapore 487372, Singapore
*
Author to whom correspondence should be addressed.

Abstract

The design of low-complexity and efficient constrained codes has been a major research item for many years. This paper reports on a versatile method named concatenated constrained codes for designing efficient fixed-length constrained codes with small complexity. A concatenated constrained code comprises two (or more) cooperating constrained codes of low complexity enabling long constrained codes that are not practically feasible with prior art methods. We apply the concatenated coding approach to two case studies, namely the design of constant-weight and low-weight codes. In a binary constant-weight code, each codeword has the same number, w, of 1’s, where w is called the weight of a codeword. We specifically focus on the trading between coder complexity and redundancy.

1. Introduction

A constrained channel is not capable to transmit all possible signals, and only certain sequences may be allowed [1]. A constrained code implements these constraints by converting arbitrary source data into permitted signals [2,3,4]. Designing an invertible mapping from arbitrary, unconstrained source sequences into coded, constrained binary sequences is a fundamental challenge. In a conventional block code, the source data are segmented into small, manageable data blocks, which are then translated into sequences of permitted symbols. The resulting codewords satisfy the given constraints, allowing them to be freely cascaded without violating channel constraints. Naturally, larger block sizes enable more efficient encoding into permitted sequences. Numerous implementation strategies have been explored in the literature.
Implementations fall in three main categories: table look-up, replacement techniques, and arithmetic-based implementations. Table look-up is straightforward, but the size of the data blocks is limited by the maximum size of the tables used [5,6]. The replacement technique successively or iteratively removes forbidden subsequences in the source data to obtain a constrained sequence. Enumeration techniques [4,7,8,9,10,11,12] use integer arithmetic operations to translate source data into constrained codewords and vice versa. However, the required silicon area of the look-up table of integer coefficients does not scale linearly with the block size [13], and it may become unacceptably large with mounting word length, precluding their use in practical transmission or storage systems [5]. A second important consideration in enumerative encoding is error propagation, as a single bit error in the received codeword may corrupt an entire decoded word [14]. This necessitates the use of strong error correction codes, which in turn require additional redundancy.
Concatenated error correction codes [15] are widely used in data transmission and storage systems. Formed by combining two or more codes, typically referred to as the inner and outer codes, these constructions provide enhanced error performance while maintaining low decoder complexity. Inspired by this principle, we propose a concatenated constrained coding approach, in which two or more low-complexity constrained codes are combined to construct long constrained codes that are infeasible using conventional methods.
In the encoding device, the source data blocks are divided into two segments: a first segment and a second segment. The first segment of the source data is further partitioned into a plurality of small data subwords that are translated into an allowed codeword using several look-up tables whose sets of constrained output words are mutually disjoint. The second segment of source data is encoded using a second constrained code, which determines which look-up tables are applied during the first encoding stage. The final codeword, found by cascading the output words of the look-up tables, is transmitted. A decoder can uniquely restore the source data encoded by the first and second codes by observing the received codeword. We demonstrate that the concatenated constrained code enables the design of longer codewords with less redundancy than conventional methods, while avoiding the need for impractically large look-up tables.
We demonstrate the versatility of the concatenated constrained coding scheme through two case studies: designing long constant-weight and low-weight codes.
Paper structure: We introduce the fundamentals of concatenated constrained codes in Section 2. Section 3 reviews prior work on the properties of constant-weight codes, which sets a baseline for the new constructions. Section 4 presents new constructions of constant-weight codes using concatenated constrained codes. The construction of very long constant-weight codes is explored in Section 5, where we analyze the application of one concatenated constrained code layered on top of another. Applications to low-weight codes are covered in Section 6. Finally, Section 7 concludes the paper.

2. Concatenated Constrained Code, Basics

We describe an encoder that translates binary source data into n-bit binary codewords, denoted by y, which satisfy a given constraint A . Let S A denote the set of n-bit codewords y that meet constraint A . Since n is typically too large to permit direct generation of codewords via a single look-up table, the codeword y is divided into k equal-sized m-bit constrained subwords y t ∈ { 0 , 1 } m and y = ( y 1 , y 2 , … , y k ) and n = k m . The parameter m is chosen to be small enough to allow the use of look-up tables for mapping source data to the subwords y t .

2.1. Major Components Overview

We construct K, K ≤ k , distinct sets of m-bit subwords, denoted by S i ⊂ { 0 , 1 } m , 0 ≤ i ≤ K − 1 , each satisfying a specific constraint A i , 0 ≤ i ≤ K − 1 . In practice, only K ≤ k distinct look-up tables are required as they can be re-used via multiplexing. Each set S i enables a bijective mapping f i : { 0 , 1 } ν i → S i of ν i ≤ m source bits into valid subwords, ensuring compatibility with A i .
To construct an n-bit codeword y, we concatenate k m-bit subwords y t , where each y t is selected from the corresponding subword set S c t . The selection is guided by a control code c = ( c 1 , … , c k ) , with c t ∈ { 0 , … , K − 1 } . The goal is to ensure that the full codeword y = ( y 1 , … , y k ) satisfies the overall constraint A .

2.2. Basic Properties

The concatenated constrained coding scheme adheres to the following conditions:
  • The sets S i , 0 ≤ i ≤ K − 1 , must be pairwise disjoint.
  • Each codeword y must encode a fixed number of source bits.
  • Every codeword y must satisfy the global constraint A .
We define two segments of source data:
  • a = ( a 1 , … , a ℓ ) , a t ∈ { 0 , 1 } .
  • a ^ = ( a ^ 1 , … , a ^ ℓ c ) , a ^ t ∈ { 0 , 1 } .
The total number of encoded source bits, ℓ + ℓ c , is referred to as the throughput of the code.
The encoder generates the control word c = ( c 1 , … , c k ) , c t ∈ { 0 , … , K − 1 } , by applying a bijective mapping g : { 0 , 1 } ℓ c → C , where C is a constrained code. The ℓ-bit source data, a, are partitioned into k segments a t of ν c t bits, 1 ≤ t ≤ k . Clearly, we demand ( a 1 , a 2 , … , a k ) = a and thus ∑ i = 1 k ν c i = ℓ . The set of allowed vectors c is
C = { c ∈ { 0 , … , K − 1 } k : ( f c 1 ( a 1 ) , f c 2 ( a 2 ) , … , f c k ( a k ) ) ∈ S A ∧ ∑ i = 1 k ν c i = ℓ } .
This allows up to ℓ c = ⌊ log 2 | C | ⌋ additional source bits to be encoded into the control vector c via the mapping g ( · ) . Consequently, the total number of source bits that can be represented in the n-bit codeword y is ℓ + ℓ c . Each of the k segments of the original source data, denoted a t , is mapped to an m-bit constrained subword y t using the mapping y t = f c t ( a t ) for 1 ≤ t ≤ k . These subwords are then concatenated to form the complete codeword y, which is subsequently transmitted or stored. Importantly, the control vector c is not transmitted to the receiver. However, since the subword sets S i are pairwise disjoint, the decoder can uniquely identify which mapping was used for each y t . This ensures that both parts of the source data, a and a ^ , can be fully and uniquely reconstructed from the received codeword y.
Figure 1 and Figure 2 depict a block diagram of the encoder and decoder, respectively.
Figure 1. Basic block diagram of a concatenated constrained code. The source data are partitioned into two parts, denoted by a ^ and a. The portion a ^ is mapped to a constrained codeword c by the mapping c = g ( a ^ ) . The remaining source data a are partitioned, under the control of c, into k segments a t of length ν c t , t = 1 , 2 , … , k , and are subsequently translated into the final codeword y = ( y 1 , … , y k ) using functions y t = f c t ( a t ) for t = 1 , 2 , … , k . The composite codeword y is sent to the receiver while the auxiliary word c is discarded. Although the block diagram shows k separate look-up tables for conceptual clarity, in practice only K < k distinct look-up tables are required, as they can be reused via multiplexing.
Figure 2. Block diagram of a decoder for a concatenated constrained code. The received vector y, of length n = k m , is first partitioned into k subwords y i , each of length m. Using the appropriate inverse look-up tables, the decoder recovers the control vector c and the data segments a t via the relation a t = f c t − 1 ( y t ) for t = 1 , … , k . Subsequently, the remaining source data a ^ are reconstructed by applying the inverse mapping a ^ = g − 1 ( c ) .

2.3. Complexity Issues

The encoder begins by mapping a segment of ℓ c source bits into a control codeword c using the bijective function c = g ( a ^ ) . It then proceeds to convert each of the k source subwords a t , each of length ν c t for t = 1 , 2 , … , k , into corresponding m-bit constrained subwords y t via the mapping y t = f c t ( a t ) .
Assuming the k conversions y t = f c t ( a t ) can be implemented in a multiplexed fashion, the primary hardware requirements for encoding and decoding a concatenated constrained code are limited to the following:
  • The K look-up tables for the sets S i , where 0 ≤ i ≤ K − 1 .
  • A look-up table for the mapping function g ( · ) that generates c.
Unlike traditional approaches that rely on a single large n-bit look-up table, the maximum codeword length n achievable with the proposed concatenated constrained coding scheme is governed by the product of the practical maximum sizes of the K look-up tables S i and the control codebook C. This significantly relaxes the constraints on memory size and look-up complexity.
A compelling example of this technique is the design of a binary constant-weight code, where each n = 128 -bit codeword contains exactly 32 ones. This design is efficiently realizable using just three modest-sized look-up tables, highlighting the practicality of the concatenated constrained coding approach.
Example 1.
We design an encoder that converts arbitrary source data into binary codewords, y, y i ∈ { 0 , 1 } , of length n = 128, where each codeword has 32 1’s and 96 0’s. The maximum number of source bits that can be accommodated is ⌊ log 2 128 32 ⌋ = 100 , where ⌊ · ⌋ denotes the truncation or floor function. Therefore, any code constructed for this setting must have a redundancy of at least 28 bits. Since n = 128 is too large to be handled by a single look-up table, we partition the codeword into k = 16 subwords, each of length m = 8 bits. While other values for k and m are possible, the chosen values simplify manual calculations. In the prior art block code design of multiply constant-weight codes [16] or constant subblock-composition code [17], each subword contains exactly two 1’s, and the k = 16 subwords can be freely cascaded with each other to form a codeword. Clearly, there are 8 2 = 28 possible 8-bit subwords. Twelve excess subwords are deleted, so that each subword can convey four source bits, and hence, the 128-bit codewords can carry 16 × 4 = 64 source bits, resulting in 64 bits of redundancy.
Using the concatenated constrained code construction, we define K = 2 types of subword sets, namely the set of 8-bit words with a single 1, that is
S 0 = x ∈ { 0 , 1 } 8 : ∑ i = 1 8 x i = 1
and the set of 8-bit words with three 1’s, namely
S 1 = x ∈ { 0 , 1 } 8 : ∑ i = 1 8 x i = 3 .
We easily find that | S 0 | = 8 1 = 8 and | S 1 | = 8 3 = 56 , where | X | denotes the cardinality of the set X. We delete 56 − 32 = 24 excess subwords from S 1 (keeping 32 subwords). Consequently, we have ν 0 = 3 and ν 1 = 5 . Define the bijective mappings f 0 : { 0 , 1 } 3 → S 0 and f 1 : { 0 , 1 } 5 → S 1 . Each 128-bit codeword contains 32 ones by selecting eight subwords from S 0 and eight from S 1 . The k = 16 subwords together convey ℓ = 8 × ( 3 + 5 ) = 64 source bits, matching the number of source bits in the prior art; so nothing is gained or lost so far. The k(=16)-bit word, c, whose elements determine whether to apply f 0 or f 1 , has equal numbers of 1’s and 0’s. The word, c, can therefore convey ℓ c = ⌊ log 2 16 8 ⌋ = 13 source bits. As a result, the total, combined, throughput is ℓ + ℓ c = 64 + 13 = 77 .
Alternatively, we may choose m = 16 and k = 8 , which requires larger look-up table for S 0 and S 1 . In this case, the traditional approach yields a throughput of 8 × 10 = 80 bits. In contrast, the concatenated constrained code construction achieves a throughput of 4 ( 9 + 12 ) + 6 = 90 bits, that is, 90% of the maximum possible.
The above example shows that the new scheme leverages both subword composition and control-word combinatorics to improve data throughput beyond traditional designs.
In the next sections, we exploit the concatenated constrained code for the construction of efficient constant-weight and low-weight codes. We start with a review of the state of the art.

3. Constant-Weight Codes, Preliminaries, Redundancy, Prior Art

3.1. Introduction

In a binary constant-weight code, each codeword has the same number of 1’s. These codes, also known as ‘m-out-of-n’ [7], codes, have found applications across a wide range of devices and systems including data storage [2], code-division multiple-access (CDMA) systems for optical fibers [18], test pattern generation for circuit testing [19], identification coding [20], and VLSI design [21,22]. Traditionally, constant-weight codes have been employed in data transmission and data storage systems that suffer from low-frequency noise or are subject to low-frequency bandwidth constraints [2,23,24]. More recently, they have been proposed for use in DNA-based storage systems. Knuth’s celebrated implementation [25,26] generates ‘balanced’ codewords i.e., codewords of weight w = n 2 , n even, with a computational complexity that scales with n, and a redundancy that is approximately twice the theoretical minimum for large n.
A simple and efficient algorithm for producing a codeword with a prescribed imbalance is not available, and the development of such an algorithm remains an open research problem [22,27]. Designing low-complexity encoder/decoder architectures for very high-rate constant-weight codes is of significant practical and economic value. There is a clear demand for efficient constant-weight codes that avoid the need of exorbitantly large look-up tables while maintaining high performance.

3.2. Redundancy

Let x = ( x 1 , … , x n ) , x i ∈ { 0 , 1 } , be a binary word of length n. The Hamming weight of x, denoted by w ( x ) , is defined by w ( x ) = ∑ i = 1 n x i . A constant-weight code, denoted by S ( w , n ) , defined by
S ( w , n ) = x ∈ { 0 , 1 } n : w ( x ) = w ,
comprises all binary words of length n and weight w, 0 ≤ w ≤ n . The size of S ( w , n ) , denoted by | S ( w , n ) | , equals
| S ( w , n ) | = n γ n ,
where γ = w n , 0 ≤ γ ≤ 1 2 , denotes the relative weight. In case we have a code with codewords with equal numbers of 1’s and 0’s, i.e., 2 w = n , n even, the code is said to be balanced. Note that without loss of generality we study the case γ ≤ 1 / 2 as the case γ > 1 / 2 is simply found by inverting (flipping) the binary symbols of a codeword.
The capacity and maxentropic redundancy of constant-weight codes, denoted by C ( w , n ) and ρ ( w , n ) , are defined by
C ( w , n ) = log 2 | S ( w , n ) | = log 2 n γ n
and
ρ ( w , n ) = n − C ( w , n ) .
Using [28], we find the useful approximation
ρ ( w , n ) ≈ 1 2 log 2 n + 1 − H ( γ ) n + 1 2 log 2 π 2 , n ≫ 1 ,
where Shannon’s entropy function, H ( x ) , is defined by
H ( x ) = − x log 2 ( x ) − ( 1 − x ) log 2 ( 1 − x ) .
The maxentropic redundancy, ρ ( w , n ) , is applied as a yardstick to evaluate the performance of implemented codes.

3.3. Traditional Code Design Approach

In the prior art, see [29] and the references therein, a codeword, y, of length n is divided into k constrained subwords, y i , 1 ≤ i ≤ k , of equal length m, where n = k m . The weight of each subword, y i , is prescribed and denoted by ω i = w ( y i ) , ω i ∈ { 0 , … , m } , where ∑ i = 1 k ω i = w . The weight distribution vector is denoted by ω = ( ω 1 , … , ω k ) . The redundancy, denoted by ρ 1 ( w , n ) , equals, see (5),
ρ 1 ( w , n ) = ∑ i = 1 k ρ ( ω i , m ) .
Note that ρ 1 ( w , n ) describes a lower bound to the redundancy of implemented codes as in practice the (sub)code sizes m ω i are truncated to the nearest power of two, see Example 1 for an illustration. We have opted not to truncate the code sizes in our computations, except in the worked design examples, in order to maintain analytical tractability. The efficiency of this construction, denoted by η 1 , is defined as [29]
η 1 = ρ ( w , n ) ρ 1 ( w , n ) .
It is shown in the Appendix A that a uniform, or flat, weight distribution minimizes the redundancy.
Numerical results for the efficiency of the prior art construction, η 1 , are presented in Table 1. Additional efficiency parameters, η 2 and η 3 , for the new constructions are introduced and discussed in Section 4.2 and Section 4.3, respectively.
Table 1. Code efficiency, η 1 , η 2 , and η 3 versus codeword length n, weight w, and number of subwords k, where m = n / k , v = w / k , and γ = w / n . The parameter η 1 refers to the efficiency of the prior art code, see (9), while the parameters η 2 and η 3 refer to the code efficiency of the new constructions, see (24) and (33).
In the next section, we apply the concatenated constrained code to the design of constant-weight codes.

4. Concatenated Constant-Weight Code

4.1. Concatenated Constrained Code

As in Section 3.3, the n-bit codeword y is partitioned into k subwords, y i , 1 ≤ i ≤ k , of equal length m. We have w ( y i ) = ω i , ω i ∈ { 0 , … , m } and ∑ i = 1 k ω i = w . In the prior art, the subword weights, ω i = w ( y i ) , are assumed to be fixed for the whole transmission. In this section, however, the weights of the subwords are controlled, ‘modulated’ in engineering terms, by a constrained codeword ω = ( ω 1 , … , ω k ) , which is taken from the predefined set Ω . Note that ω and Ω play the same role as c and C in Section 2.
The coding of y is carried out in two distinct steps. First, source data are mapped bijectively to the weight distribution vector ω ∈ Ω via a look-up table. In the second step, the encoder uses the look-up tables corresponding to the constant-weight codes S ( ω i , m ) , 1 ≤ i ≤ k , to convert the source data into the subwords y i . Since the mapping ω i to S ( ω i , m ) , 1 ≤ i ≤ k , is bijective, the decoder can uniquely determine the vector ω , and thereby recover the original source data from the received y.
Define the vector u = ( u 0 , u 1 , … , u m ) , u j ∈ { 0 , … , k } , where u j represents the number of occurrences of the symbol j in ω . The vector u is commonly referred to as the histogram of ω . An allowed vector u must satisfy
∑ i = 0 m u i = k   and ∑ i = 0 m i u i = w .
The set Ω is the set of k-vectors, ω , of fixed composition ( u 0 , u 1 , … , u m ) , that is, the number of 0’s, 1’s, … , m ’s in ω is given by u 0 , u 1 , … , u m , respectively. The size of the constant composition code Ω is
| Ω | = k ! u 0 ! u 1 ! … u m ! .
The number of source words that can be accommodated, denoted by M Ω , equals
M Ω = k ! u 0 ! u 1 ! … u m ! ∏ i = 0 m m i u i .
Below we illustrate and analyze a design of two simple cases, where u contains K = 2 or K = 3 non-zero elements, which are denoted here by the binary and ternary case. We start with a description of the binary case, K = 2 .

4.2. Binary Case, K = 2

Let ω i ∈ { v 0 , v 1 } , so that u v 0 ≠ 0 and u v 1 ≠ 0 , and otherwise u i = 0 . We obtain from (10) that
u v 0 + u v 1 = k   and v 0 u v 0 + v 1 u v 1 = w .
There are manifold solutions to the above system of (positive) integer equations. An enticing option for k even is v 0 = v − 1 and v 1 = v + 1 , so that u v − 1 = u v + 1 = k 2 , and
Ω 2 = { ω ∈ { v − 1 , v + 1 } k : ∑ i = 1 k ω i = w }
denotes the set of allowed vectors ω .
The relationship between ω and c is a straightforward renumbering of their elements by
c i = ( ω i − v + 1 ) / 2 , i = 1 , … , k ,
so that c i ∈ { 0 , 1 } , and renaming S 0 = S ( v − 1 , m ) and S 1 = S ( v + 1 , m ) . The coding circuitry comprises two look-up tables, S 0 and S 1 , of width m, plus a (binary) look-up table for the balanced code, C, of width k. Note that Knuth’s algorithm can be used for mounting k, when the look-up table for c is uneconomically expensive.
We obtain from (14) that
| Ω 2 | = k k 2 ,
so that, see (12),
M Ω 2 = | S ( v − 1 , m ) | k 2 | S ( v + 1 , m ) | k 2 k k 2 .
Hence the redundancy, denoted by ρ 2 ( w , n ) , is
ρ 2 ( w , n ) = n − k 2 log 2 m v − 1 m v + 1 − log 2 k k 2 .
Since
m v − 1 = v m − v + 1 m v
and
m v + 1 = m − v v + 1 m v ,
we obtain
m v − 1 m v + 1 = v ( m − v ) ( v + 1 ) ( m − v + 1 ) m v 2 ,
so that
ρ 2 ( w , n ) = k ρ ( v , m ) + β ( v , m ) − 1 k log 2 k k 2 = ρ 1 ( v , m ) + k β ( v , m ) − log 2 k k 2 ,
where
β ( v , m ) = − 1 2 log 2 v ( m − v ) ( v + 1 ) ( m − v + 1 ) .
Figure 3 shows the coefficient β ( v , m ) versus v, 1 ≤ v ≤ m / 2 , for m = 16 , 24 , and 32.
Figure 3. Coefficient β ( v , m ) versus v for m = 16 ,   24 , and 32.
The coefficient β ( v , m ) is an important parameter as it quantifies the additional redundancy per subword required for the concatenated coding system. Note in (21) that, with respect to the redundancy of the traditional code, ρ 1 ( w , n ) , we have two additional terms in ρ 2 ( w , n ) . On one hand we add redundancy, namely β ( v , m ) bit per subword, by deviating from the flat weight distribution, as discussed in Appendix A. On the other hand, we reduce redundancy, namely
1 k log 2 k k 2 ≈ 1 − 1 2 k log 2 ( k )
bits per subword by encoding data in the second (binary) code C. Figure 3 shows that the loss, β ( v , m ) , is around 0.1–0.2 bits per subword over a wide range of the parameters v and m.
The efficiency of codes based on the binary concatenated constrained code is defined by
η 2 = ρ ( w , n ) ρ 2 ( w , n ) .
Table 1 presents numerical results for the code’s efficiency, η 2 . We observe a notable improvement in efficiency compared to that of the traditional scheme, η 1 , especially for larger values of k.

4.3. Ternary Case, K = 3

For the ternary case, we define the values of u i by
u v − 1 = u v + 1 = k − a 2   and   u v = a , a = 2 , 4 , … , k − 2
and otherwise u i = 0 . Note that for a = 0 we have the binary case, K = 2 , as detailed in the previous subsection. Let Ω 3 denote the constant composition code based on u. Then
| Ω 3 | = k ! k − a 2 ! a ! k − a 2 ! ,
and the number of source words that can be accommodated, denoted by M Ω 3 , equals
M Ω 3 = | S ( v − 1 , m ) | k − a 2 | S ( v , m ) | a | S ( v + 1 , m ) | k − a 2 | Ω 3 | .
The overall redundancy, denoted by ρ 3 ( w , n ) , is
ρ 3 ( w , n ) = k ρ ( v , m ) + ( k − a ) β ( v , m ) ) − log 2 | Ω 3 | .
For the special case a = k 3 , k mod 3 = 0 , we have
| Ω 3 | = k ! ( k 3 ! ) 3
and
ρ 3 ( w , n ) = k ( ρ ( v , m ) + 2 3 β ( v , m ) ) − log 2 k ! ( k 3 ! ) 3 .
For k ≫ 1 , we obtain the Stirling approximation [30]
k ! ( k 3 ! ) 3 ≈ 3 k + 3 2 2 π k , k ≫ 1 ,
so that
ρ 3 ( w , n ) ≈ k ( ρ ( v , m ) + 2 3 β ( v , m ) − log 2 ( 3 ) ) .
Define the efficiency of this construction by
η 3 = ρ ( w , n ) ρ 3 ( w , n ) .
Table 1 shows numerical results for the code’s efficiency, η 3 . As in the binary case, we find c by renumbering the elements of ω according to c i = ω i − v + 1 , i = 1 , … , k , so that c i ∈ { 0 , 1 , 2 } . We then rename the sets as S 0 = S ( v − 1 , m ) , S 1 = S ( v , m ) and S 2 = S ( v + 1 , m ) . It is assumed that a look-up table is used to map the source data a ^ into c. For larger values of k, where using a look-up table becomes impractical, we may resort to enumeration algorithms for multiset permutations [31] or Knuth-like algorithms [30,32], which can be employed instead. The next example elaborates Example 1 for K = 3 .
Example 2.
We choose, as in Example 1, n = 128 , w = 32 , v = 2 , and m = 8 . For the ternary case, K = 3 , we obtain the following results from Example 1: ⌊ log 2 ( | S ( 1 , 8 ) | ) ⌋ = 3 , ⌊ log 2 ( | S ( 2 , 8 ) | ) ⌋ = 4 , and ⌊ log 2 ( | S ( 3 , 8 ) | ) ⌋ = 5 . From this, we can easily determine that the maximum throughput ℓ + ℓ c = 84 is attained for u = ( 0 , 6 , 4 , 6 , 0 , 0 , 0 , 0 , 0 ) or u = ( 0 , 5 , 6 , 5 , 0 , 0 , 0 , 0 , 0 ) .

4.4. Error Propagation Effects

Single bit errors in the received codeword can lead to an avalanche of errors during decoding. This phenomenon, called error propagation, is especially pronounced in long codes based on enumerative methods [14]. In this subsection, we examine the error propagation behavior of constant-weight codes constructed using concatenated constrained codes.
Let the received codeword be denoted by y ^ = ( y ^ 1 , … , y ^ k ) , which differs from the transmitted codeword, y = ( y 1 , … , y k ) , in a single (unknown) position. Since y belongs to a constant-weight code, such an error is detectable.
For a constant-weight code constructed with parameter K = 2 (binary case), as illustrated in Example 1, each subword y i belongs to the set S ( v − 1 , m ) ∪ S ( v + 1 , m ) , 1 ≤ i ≤ k , and v = w / k . Since the minimum Hamming distance between elements of this set is two, it is possible to identify the specific subword y i that was received in error. Assume that the subword y ^ j with index j is in error, i.e., y ^ j ≠ y j . By definition, we have ∑ i = 1 k c i = k / 2 , so the control vector c can be fully decoded by, see (15),
c i = ( w ( y ^ i ) − v + 1 ) 2 , 1 ≤ i ≤ k , i ≠ j k 2 − ∑ i = 1 , i ≠ j k c i , i = j .
Thus, in the binary case, K = 2 , all data can be recovered except for the unknown m-bit subword y ^ j , which must be marked as an erasure. In the ternary case ( K = 3 ), each y i belongs to the set S ( v − 1 , m ) ∪ S ( v , m ) ∪ S ( v + 1 , m ) , 1 ≤ i ≤ k . Since the minimum Hamming distance between its elements is one, it is not always possible to identify the erroneous subword. As a result, the entire n-bit codeword must be flagged as an erasure. Note that for the ternary case we may choose the sets S ( v − 2 , m ) , S ( v , m ) and S ( v + 2 , m ) , so that it is also possible to identify the specific subword y i that was received in error.

5. Very Long Codes

In the previous sections, we demonstrate that concatenated constrained coding can efficiently produce longer constant-weight codewords compared to conventional state-of-the-art methods. However, the scalability of such codes is limited: the codeword length n = k m is, in practice, constrained by the maximum feasible size of the look-up tables, either the subword tables S i of width m, or the control code table C of width k.
To overcome these practical limitations, several strategies can be adopted:
  • Use enumerative coding techniques to generate the subword sets S i and/or the control codebook C.
  • Apply a second layer of concatenated constrained coding to generate entries within S i and/or C, effectively building a hierarchy of constrained encodings.
The next example illustrates the effectiveness of this method through numerical results for a constant-weight code of length n = 2048 .
Example 3.
Consider the case where n = 2048 and w = 512 ( γ = 1 / 4 ). The theoretical minimum redundancy for this constant-weight code is ρ ( 512 , 2048 ) = 392.12 bits. Due to the large value of n, enumerative coding becomes impractical for this low-weight scenario, so we explore alternative coding strategies:
  • We can cascade sixteen codewords of length n ′ = 128 and w ′ = 32 , see Example 2, with a total throughput of 16 × 84 = 1344 bit.
  • We can, as illustrated in Example 1, select a concatenated constrained code with m = 8 and k = 256 . Since k = 256 is too large for directly using a look-up table to generate the control word c, we alternatively consider applying enumerative coding for generating the balanced codeword c. Then, the redundancy is five bit, so that the scheme’s throughput is 256 − 5 + k × 4 = 1275 bit. We may apply Knuth’s algorithm to generate codeword c of length k = 256 with an 8-bit redundancy, so that the throughput is 256 − 8 + k × 4 = 1272 bit.
  • We may construct a long code by using multiple smaller concatenated constrained codes as building blocks. For example, an ( n = 2048 , w = 512 ) code is constructed by first constructing two concatenated constrained codes with parameters n ′ = 128 of weights w ′ = 31 and w ″ = 33 , respectively, by using u ′ = ( 0 , 6 , 5 , 5 , 0 , 0 , 0 , 0 , 0 ) and u ″ = ( 0 , 5 , 5 , 6 , 0 , 0 , 0 , 0 , 0 ) instead of u = ( 0 , 6 , 4 , 6 , 0 , 0 , 0 , 0 , 0 ) of the n ′ = 128 , w ′ = 32 code detailed in Example 2. Both codes have a throughput of 84 bit. On top of these codes, we define a concatenated constrained code with k = 16 and n ′ = 128 , the combined throughput equals 16 × 84 + 20 = 1364 bit. The code’s implementation requires six small look-up tables.
While numerous other design options exist beyond those discussed above, the examples provided offer a representative insight into the key trade-offs involved.

6. Low-Weight Codes

Low-weight, or sometimes referred to as light-weight or bounded-weight, codes have found applications in efficiently synthesizing deoxyribonucleic acid (DNA) for massive data storage, where multiple DNA strands are synthesized in parallel [33]. Applications can also be found in memristor crossbar arrays for reducing the number of sneak-paths [34], and simultaneous energy and data transfer [17,35].
A low-weight code of length n and weight at most t, 0 ≤ t ≤ n , denoted by S ^ ( t , n ) , is defined by the union of the sets of words of weight w ≤ t ,
S ^ ( t , n ) = ⋃ w = 0 t S ( w , n ) .
The redundancy, denoted by ρ ^ ( t , n ) , equals
ρ ^ ( t , n ) = n − log 2 | S ^ ( t , n ) | = n − log 2 ∑ w = 0 t n w .
For asymptotically large n we obtain [28]
1 n ρ ^ ( t , n ) ≈ 1 − H t n , t n < 1 2 .
Figure 4 shows the normalized redundancy, ρ ^ ( t , n ) / n , versus relative maximum weight, t / n for n = 12 , 24 , and ∞.
Figure 4. Lower bound normalized redundancy, ρ ^ ( t , n ) / n , of low-weight codes versus t / n for n = 12 ,   24 , and ∞.

6.1. Code Design

The conventional construction of a low-weight block code follows a similar approach to that of constant-weight codes. The source data and codewords are partitioned into k manageable subwords, with look-up tables used to map the source data into these subwords. As assumed above let n = k m be the length of the low-weight codeword, where m is the length of each subword, and t = k v . The redundancy of a conventional code, denoted by ρ ^ 1 ( t , n ) , is
ρ ^ 1 ( t , n ) = k ρ ^ ( v , m ) .
In the next subsection, we describe a simple low-weight code based on the concatenated constrained code format.

Binary Case, K = 2

The source data are divided into two segments, namely a ^ and a. The first segment, a ^ , is translated into a binary constrained codeword, c = ( c 1 , … , c k ) = g ( a ^ ) , where c i ∈ { 0 , 1 } , of length k. The second segment, a, is translated into a series of k weight-constrained m-bit words, each taken from either the set S 0 ( v , m ) or S 1 ( v , m ) . For a concatenated constrained coding construction, the sets S 0 ( v , m ) and S 1 ( v , m ) must be disjoint. A convenient choice for these sets is
S 0 ( v , m ) = S ( v + 1 , m ) ∪ S ( v , m )
and
S 1 ( v , m ) = ⋃ w = 0 v − 1 S ( w , m ) .
Let c = ( c 1 , … , c k ) be a balanced word, k even, then the n-bit codeword found by cascading k m-bit subwords from S c i ( v , m ) , 1 ≤ i ≤ k , has a weight less than or equal to t. The redundancy of the code, denoted by ρ ^ 2 ( t , n ) , equals
ρ ^ 2 ( t , n ) = n − k 2 log 2 | S 0 ( v , m ) | | S 1 ( v , m ) | − log 2 k k 2 .
Define
β ^ ( v , m ) = − 1 2 log 2 | S 0 ( v , m ) | | S 1 ( v , m ) | | S ^ ( v , m ) | 2 ,
then
ρ ^ 2 ( t , n ) = k ( ρ ^ ( v , m ) + β ^ ( v , m ) ) − log 2 k k 2 .
Figure 5 shows the coefficient β ^ ( v , m ) versus v, 1 ≤ v ≤ m / 2 , for m = 16 , 24 , and 32.
Figure 5. Coefficient β ^ ( v , m ) versus v for m = 16 ,   24 , and 32.
Define the efficiency parameters as η ^ 1 = ρ ^ ( t , n ) / ρ ^ 1 ( t , n ) and η ^ 2 = ρ ^ ( t , n ) / ρ ^ 2 ( t , n ) . Numerical results are presented in Table 2. It can be observed that the concatenated codes reduce the redundancy compared to the baseline by 6.5 percentage points for k = 128 .
Table 2. Code efficiency, η ^ 1 and η ^ 2 versus number of subwords per codeword, k, for codeword length n = 1024 , and maximum weight t = 128 .

7. Conclusions

We have introduced a new class of constrained codes, referred to as concatenated constrained codes, which enable the construction of very long constrained codewords with significantly reduced complexity. Similar to traditional methods, the source data are divided into smaller blocks. In the first step, one segment of the source data is encoded using a set of small look-up tables, each corresponding to a disjoint set of valid output sequences. In the second step, another segment of the source data is encoded into a control codeword that determines which look-up table is used for each portion of the first segment.
This layered encoding structure enables the generation of longer codewords with lower redundancy compared to conventional approaches, while eliminating the need for massive look-up tables.
We demonstrated the effectiveness of this approach through two case studies focused on constructing binary constant-weight and light-weight codewords of length n, each containing exactly w ones, or not more than w ones, where w ≤ n / 2 . The concatenated constrained codes in these examples achieve lower redundancy than leading state-of-the-art solutions, while requiring only three or four compact look-up tables, highlighting both their efficiency and practicality.
We have shown that extremely long codewords can be constructed by applying a second layer of concatenated constrained coding on top of an initial concatenated constrained scheme, effectively generating elements within the sets S i and/or the codebook C.

Author Contributions

Conceptualization, Kees Schouhamer Immink, J.H.W., T.T.N. and K.C.; Writing–original draft, K.S.I., J.H.W., T.T.N. and K.C. All authors have read and agreed to the published version of the manuscript.

Funding

This work was supported by the Singapore Ministry of Education Academic Research Fund Tier 2 T2EP50221-0036 and SUTD Kickstarter Initiative (SKI) Grant 2021_04_05.

Data Availability Statement

No new data were created or analyzed in this study.

Conflicts of Interest

Author Kees Schouhamer Immink was employed by the company Turing Machines Inc. The remaining authors declare that the research was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest.

Appendix A

We investigate minimizing the redundancy of the basic design approach, see Section 3.3.
Theorem A1.
The number of words
M 1 = ∏ i = 1 k m ω i
is maximized by choosing a flat distribution for ω , where the subword weights, ω i , are as close to w / k as possible. Specifically, this means that the difference between any pair of weights is at most 1.
Proof. 
Let i 1 and i 2 , i 1 ≠ i 2 , be arbitrarily chosen indices such that 1 ≤ i 1 , i 2 ≤ n . Then the number of n-sequences is
M 1 = m ω i 1 m ω i 2 ∏ i = 1 , i ≠ i 1 , i 2 k m ω i .
Suppose ω i 1 > ω i 2 + 1 . To increase M 1 replace ω i 1 by ω i 1 − 1 and ω i 2 by ω i 2 + 1 (noting that the sum ∑ i = 1 k ω i = w remains constant). Then
M 1 = m ω i 1 − 1 m ω i 2 + 1 ∏ i = 1 , i ≠ i 1 , i 2 k m ω i , = ω i 1 m − ω i 1 + 1 m − ω i 2 ω i 2 + 1 ∏ i = 1 k m ω i .
Since ω i 1 > ω i 2 + 1 , it follows that
ω i 1 m − ω i 1 + 1 m − ω i 2 ω i 2 + 1 > 1 .
Because i 1 and i 2 were arbitrary, this argument applies to any pair of indices. Therefore, the number of words M 1 is maximized when the weights ω i are balanced as evenly as possible, i.e., when the difference between any two ω i is at most 1. □

References

  1. Shannon, C.E. A Mathematical Theory of Communication. Bell Syst. Tech. J. 1948, 27, 379–423. [Google Scholar] [CrossRef] [Scilit]
  2. Immink, K.A.S. Innovation in Constrained Codes. IEEE Commun. Mag. 2022, 60, 20–24. [Google Scholar] [CrossRef] [Scilit]
  3. Marcus, B.H.; Siegel, P.H.; Wolf, J.K. Finite-state Modulation Codes for Data Storage. IEEE J. Sel. Areas Commun. 1992, 10, 5–37. [Google Scholar] [CrossRef] [Scilit]
  4. Ryabko, B. A General Method for the Development of Constrained Codes. IEEE Trans. Inf. Theory 2025, 71, 3510–3515. [Google Scholar] [CrossRef] [Scilit]
  5. Modha, D.S.; Marcus, B.H. Art of Constructing Low-complexity Encoders/decoders for Constrained Block Codes. IEEE J. Sel. Areas Commun. 2001, 19, 589–601. [Google Scholar] [CrossRef]
  6. Stockmeyer, L.; Modha, D.S. Links Between Complexity Theory and Constrained Block Coding. IEEE Trans. Inf. Theory 2002, 48, 59–88. [Google Scholar] [CrossRef]
  7. Ramabadran, T.V. A Coding Scheme for m-out-of-n Codes. IEEE Trans. Commun. 1990, 38, 1156–1163. [Google Scholar] [CrossRef] [Scilit]
  8. Schulte, P.; Böcherer, G. Constant Composition Distribution Matching. IEEE Trans. Inf. Theory 2016, 62, 430–434. [Google Scholar] [CrossRef] [Scilit]
  9. Cover, T.M. Enumerative Source Coding. IEEE Trans. Inf. Theory 1973, 19, 73–77. [Google Scholar] [CrossRef] [Scilit]
  10. Schalkwijk, J.P.M. An Algorithm for Source Coding. IEEE Trans. Inf. Theory 1972, 18, 395–399. [Google Scholar] [CrossRef] [Scilit]
  11. Hareedy, A.; Calderbank, R. LOCO Codes: Lexicographically-Ordered Constrained Codes. IEEE Trans. Inf. Theory 2020, 66, 3572–3589. [Google Scholar] [CrossRef] [Scilit]
  12. Kurmaev, O. Constant-Weight and Constant-Charge Binary Run-Length Limited Codes. IEEE Trans. Inf. Theory 2011, 57, 4497–4515. [Google Scholar] [CrossRef] [Scilit]
  13. Butler, J.T.; Sasao, T. Fast constant weight codeword to index converter. In Proceedings of the 2011 IEEE 54th International Midwest Symposium on Circuits and Systems (MWSCAS), Seoul, Republic of Korea, 7–10 August 2011; pp. 1–4. [Google Scholar] [CrossRef] [Scilit]
  14. Immink, K.A.S.; Janssen, A.J.E.M. Error propagation assessment of enumerative coding schemes. IEEE Trans. Inf. Theory 1999, 45, 2591–2594. [Google Scholar] [CrossRef] [Scilit]
  15. Forney, G.D., Jr. Concatenated Codes; MIT Press: Cambridge, MA, USA, 1966. [Google Scholar]
  16. Chee, Y.M.; Kiah, H.M.; Zhang, H.; Zhang, X. Constructions of Optimal and Near-Optimal Multiply Constant-Weight Codes. IEEE Trans. Inf. Theory 2017, 63, 3621–3629. [Google Scholar] [CrossRef] [Scilit]
  17. Tandon, A.; Motani, M.; Varshney, L.R. Subblock-Constrained Codes for Real-Time Simultaneous Energy and Information Transfer. IEEE Trans. Inf. Theory 2016, 62, 4212–4227. [Google Scholar] [CrossRef] [Scilit]
  18. Chung, F.R.K.; Salehi, J.A.; Wei, V.K. Optical orthogonal codes: Design, analysis and applications. IEEE Trans. Inf. Theory 1989, 35, 595–604. [Google Scholar] [CrossRef] [Scilit]
  19. Tang, D.T.; Woo, L.S. Exhaustive Test Pattern Generation with Constant Weight Vectors. IEEE Trans. Comput. 1983, 32, 1145–1150. [Google Scholar] [CrossRef] [Scilit]
  20. Gunlu, O.; Kliewer, J.; Schaefer, R.F.; Sidorenko, V. Code Constructions and Bounds for Identification via Channels. IEEE Trans. Commun. 2022, 70, 1486–1496. [Google Scholar] [CrossRef] [Scilit]
  21. Tallini, L.G.; Bose, B. Design of balanced and constant weight codes for VLSI systems. IEEE Trans. Comput. 1998, 47, 556–572. [Google Scholar] [CrossRef] [Scilit]
  22. Skachek, V.; Immink, K.A.S. Constant Weight Codes: An Approach Based on Knuth’s Balancing Method. IEEE J. Sel. Areas Commun. 2014, 32, 908–918. [Google Scholar] [CrossRef] [Scilit]
  23. Cattermole, K.W. Principles of Pulse Code Modulation; Iliffe Books Ltd.: London, UK, 1969. [Google Scholar]
  24. Marcovich, S.; Etzion, T.; Yaakobi, E. On Hierarchies of Balanced Sequences. IEEE Trans. Inf. Theory 2023, 69, 2923–2939. [Google Scholar] [CrossRef] [Scilit]
  25. Knuth, D.E. Efficient Balanced Codes. IEEE Trans. Inf. Theory 1986, 32, 51–53. [Google Scholar] [CrossRef] [Scilit]
  26. Tallini, L.G.; Bose, B. Balanced codes with parallel encoding and decoding. IEEE Trans. Comput. 1999, 48, 794–814. [Google Scholar] [CrossRef] [Scilit]
  27. Dao, D.T.; Kiah, H.M.; Nguyen, T.T. Efficient Encoding of Binary Constant-Weight Codes: Variable-Length Balancing Schemes a la Knuth. IEEE Trans. Inf. Theory 2024, 70, 4731–4746. [Google Scholar] [CrossRef] [Scilit]
  28. Stanica, P. Good Lower and Upper Bounds on Binomial Coefficients. J. Inequalities Pure Appl. Math. 2001, 2, 30. [Google Scholar]
  29. Tian, C.; Vaishampayan, V.A.; Sloane, N. A Coding Algorithm for Constant Weight Vectors: A Geometric Approach Based on Dissections. IEEE Trans. Inf. Theory 2009, 55, 1051–1060. [Google Scholar] [CrossRef] [Scilit]
  30. Weber, J.H.; Immink, K.A.S.; Siegel, P.H.; Swart, T.G. Perspectives on Balanced Sequences. arXiv 2013, arXiv:1301.6484. [Google Scholar] [CrossRef] [Scilit]
  31. Milenkovic, O.; Vasic, B. Permutation (d, k) codes: Efficient enumerative coding and phrase length distribution shaping. IEEE Trans. Inf. Theory 2000, 46, 2671–2675. [Google Scholar] [CrossRef]
  32. Mascella, R.; Tallini, L.G. Efficient m-ary Balanced Codes which Are Invariant under Symbol Permutation. IEEE Trans. Comput. 2006, 55, 929–946. [Google Scholar] [CrossRef] [Scilit]
  33. Immink, K.A.S.; Cai, K.; Nguyen, T.T.; Weber, J.H. Constructions and Properties of Efficient DNA Synthesis Codes. IEEE Trans. Mol. Biol. Multi-Scale Commun. 2024, 10, 289–296. [Google Scholar] [CrossRef] [Scilit]
  34. Cassuto, Y.; Kvatinsky, S.; Yaakobi, E. Information-Theoretic Sneak-Path Mitigation in Memristor Crossbar Arrays. IEEE Trans. Inf. Theory 2016, 62, 4801–4813. [Google Scholar] [CrossRef] [Scilit]
  35. Tandon, A.; Kiah, H.M.; Motani, M. Bounds on the Size and Asymptotic Rate of Subblock-Constrained Codes. IEEE Trans. Inf. Theory 2018, 64, 6604–6619. [Google Scholar] [CrossRef] [Scilit]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Article Metrics

Citations

Article Access Statistics

Multiple requests from the same IP address are counted as one view.