1 Introduction

Error control codes (ECCs) and Run Length Limited (RLL) codes are used for two different goals in communications systems. ECCs are used to eliminate or significantly suppress the negative influence of errors on transmitted or stored information [1, 2]. This goal is achieved by adding some redundancy to the coded sequence of transmitted information expressed usually by bits. The coded sequence is denoted as a codeword in the case of convolutional codes or a chain of codewords in the case of block codes. The RLL codes are used in order to exclude long runs of equal symbols from the coded sequence [3]. These long runs can cause the signals which are transmitting the information to not have the required level of synchronization supportive properties. The RLL codes also have to add some redundancy to the coded sequence which is transmitted in order to implement the required RLL properties in it.

In many wireless communications systems both ECCs and RLL codes are used together. As was already noted, both contribute to the increase of redundancy which is introduced into the coded sequence. This leads to a natural question if it is necessary to add the redundancy twice and if it would be not possible to achieve error control properties and RLL properties by only a single addition of redundancy. Another problem arises when both mentioned types of codes are used in the same transmission or storage system, namely how to position the codes in cascade. In other words, which code should be the outer code and which the inner code. The reason is that in general the RLL codes are constructed with the assumption that their encoder and decoder communicate via an error free channel. The approximately error free channel is obtained from the real channel with errors and other imparities using the ECCs. Taking into account these facts one can conclude that the ECC has to be an inner code and the RLL the outer code. However the ECC is not constructed with the goal to have RLL properties. This would suggest that the opposite concatenation should be used, namely the RLL code should be applied as the inner code and the ECC as the outer one.

Fortunately there exists a class of codes which can help to overcome the dilemma with ordering the ECCs and RLL codes. The combined RLL-ECCs codes allow it. One approach to obtain such codes consists of transforming an original ECC into an RLL-ECC using modifiers. It is illustrated in Fig. 1. It was used in [4] in order to construct RLL-ECCs from the standard 5 G LDPC codes. Recently it was also shown in [5] and [6] respectively, that standard CCSDS and convolutional codes could be transformed into RLL-ECCs.

Fig. 1
figure 1

On the transmitting side (Tx side) the c, \({\textbf{c}}_R\), and \({\textbf{c}}'_R\) denote a codeword from the original binary code, the codeword with reordered coordinates, modifier and the codeword after summing the previous one with the modifier respectively. On the Receiving side (Rx side) the \({\textbf{v}}'_R\), \({\varvec{\mu }}\), \({\textbf{v}}_R\) and v denote the reordered received vector, modifier, reordered received vector after summing it with the modifier and the received respectively. The summing of vectors is defined over binary finite field GF(2)

2 Basic Related Backgrounds on RS Codes

Reed Solomon (RS) codes, which have been known for more than eight decades, are actually used in many wireless communications systems. For example they are standardized in DVB standards and in CCSDS specifications. Huge knowledge regarding them has been accumulated since their discovery. Never-the-less, they are still a focus for researchers and practitioners [7,8,9,10,11,12,13,14].

There are numerous approaches regarding how to define the Reed Solomon codes. RS codes belong to linear block codes and can be described as cyclic codes, which belong to a subset of non-binary BCH codes. They could be defined over finite fields GF(q) and also over infinite fields with real or complex numbers as elements. However, the most useful RS codes are defined over finite fields with characteristic two. In other words, these most popular RS codes are defined over GF(q), where \(q=2^m;\;m\in {\mathcal {N}}^+,m>1\). The reason is that at the present time communications and memory systems are digital and a binary expression of symbols is the most natural, convenient and practical in such systems.

Further, we will suppose that the infinite family of original RS codes is defined as a family of linear cyclic codes with the following generator polynomial:

$$\begin{aligned} g(x) = (x + \alpha ^j)(x + \alpha ^{j+1}) \ldots (x + \alpha ^{j+2t-1}) \end{aligned}$$
(1)

where \(\alpha\) is a primitive element of the finite field \(GF(2^m); m \in \{2,3,4,\ldots \}\) and \(j \in \{0,1,0\ldots ,q-2\}\). In practice, often \(j \in \{0,1\}\) is chosen.

Another useful description of such RS codes is via their parity check matrix:

$$\begin{aligned} \mathbf{{\displaystyle H}}_1=\left[ \begin{array}{llllll} 1 &{} \alpha ^j &{} \alpha ^{2j} &{} \alpha ^{3j} &{} \ldots &{} \alpha ^{(q-2)j} \\ 1 &{} \alpha ^{j+1} &{} \alpha ^{2(j+1)} &{} \alpha ^{3(j+1)} &{} \ldots &{} \alpha ^{(q-2)(j+1)} \\ 1 &{} \alpha ^{j+2} &{} \alpha ^{2(j+2)} &{} \alpha ^{3(j+2)} &{} \ldots &{} \alpha ^{(q-2)(j+2)} \\ \vdots &{} \vdots &{} \vdots &{} \vdots &{} \ldots &{} \vdots \\ 1 &{} \alpha ^{j+2t-1} &{} \alpha ^{2(j+2t-1)} &{} \alpha ^{3(j+2t-1)} &{} \ldots &{} \alpha ^{(q-2)(j+2t-1)} \\ \end{array} \right] \end{aligned}$$
(2)

For example, after choosing \(j = 0\) we get:

$$\begin{aligned} \mathbf{{\displaystyle H}}_2 =\left[ \begin{array}{llllll} 1 &{} \alpha ^0 &{} \alpha ^0 &{} \alpha ^0 &{} \ldots &{} \alpha ^0 \\ 1 &{} \alpha ^1 &{} \alpha ^2 &{} \alpha ^3 &{} \ldots &{} \alpha ^{(q-2)} \\ 1 &{} \alpha ^2 &{} \alpha ^4 &{} \alpha ^6 &{} \ldots &{} \alpha ^{2(q-2)} \\ \vdots &{} \vdots &{} \vdots &{} \vdots &{} \ldots &{} \vdots \\ 1 &{} \alpha ^{2t-1} &{} \alpha ^{2(2t-1)} &{} \alpha ^{3(2t-1)} &{} \ldots &{} \alpha ^{(q-2)(2t-1)} \\ \end{array} \right] \end{aligned}$$
(3)

From the parity check matrices given in (2) or (3), the basic parameters of the RS codes could be derived, namely the codeword length n, (which is equal to the number of columns in them), number of information symbols k in each codeword (because the number of rows in them is equal to \(n-k\)) and also the code distance \(d_m\), which is for the original RS codes equal to the number of rows plus one in (2) or (3). Usually these parameters for linear block codes are given as a triple \([n,k,d_m]\) in literature. Different tables containing bounds on these parameters of the best known codes exist [15, 16]. The original Reed Solomon codes belong to the maximum distance separable codes (MDS) and therefore have maximal possible code distance \(d_m = n - k +1\) for the given n and k.

In [17] it was shown that the RS codes defined over \(GF(2^\chi )\), where \(\chi \ge 3\) is an odd integer, with the following parity check matrix:

$$\begin{aligned} \mathbf{{\displaystyle H}}_3=\left[ \begin{array}{lllclccccc} 1 &{} 1 &{} 1 &{} \cdots &{} 1 &{} 1 &{} 0 &{} 0 &{} 0 &{} 0\\ 1 &{} \alpha ^1 &{} \alpha ^2 &{} \cdots &{} \alpha ^{(2\chi -2)} &{} 0 &{} 1 &{} 0 &{} 0 &{} 0\\ 1 &{} \alpha ^2 &{} \alpha ^4 &{} \cdots &{} \alpha ^{2(2\chi -2)} &{} 0 &{} 0 &{} 1 &{} 0 &{} 0\\ 1 &{} \alpha ^3 &{} \alpha ^6 &{} \cdots &{} \alpha ^{3(2\chi -2)} &{} 0 &{} 0 &{} 0 &{} 1 &{} 0\\ 1 &{} \alpha ^4 &{} \alpha ^8 &{} \cdots &{} \alpha ^{4(2\chi -2)} &{} 0 &{} 0 &{} 0 &{} 0 &{} 1\\ \end{array} \right] \end{aligned}$$
(4)

are five times extended original RS codes. The obtained RS codes are \([q+4,q-1,5]\) - codes. These codes are not MDS codes, but they are so-called almost MDS codes. They are also reaching the upper bound on \(d_m\) for the given n and k [15, 16]. However the once extended RS codes are MDS codes [18]. In case that \(j=1\), they are defined by the following parity check matrix:

$$\begin{aligned} \mathbf{{\displaystyle H}}_4=\left[ \begin{array}{lllclc} 1 &{} 1 &{} 1 &{} \cdots &{} 1 &{} 1\\ 1 &{} \alpha ^1 &{} \alpha ^2 &{} \cdots &{} \alpha ^{(q-2)} &{} 0 \\ 1 &{} \alpha ^2 &{} \alpha ^4 &{} \cdots &{} \alpha ^{2(q-2)} &{} 0 \\ \vdots &{} \vdots &{} \vdots &{} \vdots &{} \vdots &{} \vdots \\ 1 &{} \alpha ^{(2t-1)} &{} \alpha ^{2(2t-1)} &{} \cdots &{} \alpha ^{(2t-1)(q-2)} &{} 0 \\ \end{array} \right] \end{aligned}$$
(5)

The parity check matrices of RS codes defined over \(GF(2^m)\) could be expressed over GF(2) using the so-called binary image. Each element from \(GF(2^m)\) can be expressed not only as a power of a primitive element, but also as a binary vector or power of the companion matrix A. This matrix A can be obtained from the primitive polynomial p(x) which is used for obtaining the extended field \(GF(2^m)\) from GF(2):

$$\begin{aligned} p(x) = x^m + p_{m-1} x^{m-1} + \ldots + p_1 x + p_0 \end{aligned}$$
(6)

where \(p_i \in GF(2)\). Then the companion matrix A can be expressed as:

$$\begin{aligned} \mathbf{{\displaystyle A}}=\left[ \begin{array}{lllll} 0 &{} 0 &{} \cdots &{} 0 &{} p_0\\ 1 &{} 0 &{} \cdots &{} 0 &{} p_1\\ 0 &{} 1 &{} \cdots &{} 0 &{} p_2\\ \vdots &{} \vdots &{} \cdots &{} \vdots &{} \vdots \\ 0 &{} 0 &{} \cdots &{} 1 &{} p_{m-1}\\ \end{array} \right] \end{aligned}$$
(7)

For each RS code defined over \(GF(2^m)\) the binary image of its parity check matrix can be obtained by substituting each element from \(GF(2^m)\) in it by its companion matrix.

EXAMPLE

The one-time extended RS code [8, 6, 3] defined in GF(8) generated by the primitive polynomial \(p(x) = x^3 + x + 1\) has the following parity check matrix:

$$\begin{aligned} \mathbf{{\displaystyle H}}_{[8,6,3]}=\left[ \begin{array}{llllllll} \alpha ^0 &{} \alpha ^0 &{} \alpha ^0 &{} \alpha ^0 &{} \alpha ^0 &{} \alpha ^0 &{} \alpha ^0 &{} \alpha ^0\\ \alpha ^0 &{} \alpha ^1 &{} \alpha ^2 &{} \alpha ^3 &{} \alpha ^4 &{} \alpha ^5 &{} \alpha ^6 &{} \alpha ^0\\ \end{array} \right] \end{aligned}$$
(8)

The element of GF(8) expressed as binary vectors, powers of primitive element \(\alpha\) and as powers of the accompanying matrix respectively are:

$$\begin{aligned}{} & {} \begin{array}{ccccc} 000 &{} \leftrightarrow &{} \alpha ^{-\infty } &{} \leftrightarrow &{} \left[ \begin{array}{lll} 0 &{} 0 &{} 0\\ 0 &{} 0 &{} 0\\ 0 &{} 0 &{} 0\\ \end{array} \right] \\ \end{array} \end{aligned}$$
(9)
$$\begin{aligned}{} & {} \begin{array}{ccccc} 001 &{} \leftrightarrow &{} \alpha ^0 &{} \leftrightarrow &{} \left[ \begin{array}{lll} 1 &{} 0 &{} 0\\ 0 &{} 1 &{} 0\\ 0 &{} 0 &{} 1\\ \end{array} \right] \\ \end{array} \end{aligned}$$
(10)
$$\begin{aligned}{} & {} \begin{array}{ccccc} 010 &{} \leftrightarrow &{} \alpha ^1 &{} \leftrightarrow &{} \left[ \begin{array}{lll} 0 &{} 0 &{} 1\\ 1 &{} 0 &{} 1\\ 0 &{} 1 &{} 0\\ \end{array} \right] \\ \end{array} \end{aligned}$$
(11)
$$\begin{aligned}{} & {} \begin{array}{ccccc} 100 &{} \leftrightarrow &{} \alpha ^2 &{} \leftrightarrow &{} \left[ \begin{array}{lll} 0 &{} 1 &{} 0\\ 0 &{} 1 &{} 1\\ 1 &{} 0 &{} 1\\ \end{array} \right] \\ \end{array} \end{aligned}$$
(12)
$$\begin{aligned}{} & {} \begin{array}{ccccc} 011&{} \leftrightarrow &{} \alpha ^3 &{} \leftrightarrow &{} \left[ \begin{array}{lll} 1 &{} 0 &{} 1\\ 1 &{} 1 &{} 1\\ 0 &{} 1 &{} 1\\ \end{array} \right] \\ \end{array} \end{aligned}$$
(13)
$$\begin{aligned}{} & {} \begin{array}{ccccc} 110 &{} \leftrightarrow &{} \alpha ^4 &{} \leftrightarrow &{} \left[ \begin{array}{lll} 0 &{} 1 &{} 1\\ 1 &{} 1 &{} 0\\ 1 &{} 1 &{} 1\\ \end{array} \right] \\ \end{array} \end{aligned}$$
(14)
$$\begin{aligned} \begin{array}{ccccc} 111 &{} \leftrightarrow &{} \alpha ^5 &{} \leftrightarrow &{} \left[ \begin{array}{lll} 1 &{} 1 &{} 1\\ 1 &{} 0 &{} 0\\ 1 &{} 1 &{} 0\\ \end{array} \right] \\ \end{array} \end{aligned}$$
(15)
$$\begin{aligned} \begin{array}{ccccc} 101 &{} \leftrightarrow &{} \alpha ^6 &{} \leftrightarrow &{} \left[ \begin{array}{lll} 1 &{} 1 &{} 0\\ 0 &{} 0 &{} 1\\ 1 &{} 0 &{} 0\\ \end{array} \right] \\ \end{array} \end{aligned}$$
(16)

Substituting the accompanying matrices (9)-(16) into (8) the following binary image of (8) could be obtained:

$$\begin{aligned} \mathbf{{\displaystyle H}}_{[8,6,3]}=\left[ \begin{array}{llllllllllllllllllllllll} 1 &{} 0 &{} 0 &{} 1 &{} 0 &{} 0 &{} 1 &{} 0 &{} 0 &{} 1 &{} 0 &{} 0 &{} 1 &{} 0 &{} 0 &{} 1 &{} 0 &{} 0 &{} 1 &{} 0 &{} 0 &{} 1 &{} 0 &{} 0\\ 0 &{} 1 &{} 0 &{} 0 &{} 1 &{} 0 &{} 0 &{} 1 &{} 0 &{} 0 &{} 1 &{} 0 &{} 0 &{} 1 &{} 0 &{} 0 &{} 1 &{} 0 &{} 0 &{} 1 &{} 0 &{} 0 &{} 1 &{} 0\\ 0 &{} 0 &{} 1 &{} 0 &{} 0 &{} 1 &{} 0 &{} 0 &{} 1 &{} 0 &{} 0 &{} 1 &{} 0 &{} 0 &{} 1 &{} 0 &{} 0 &{} 1 &{} 0 &{} 0 &{} 1 &{} 0 &{} 0 &{} 1\\ 1 &{} 0 &{} 0 &{} 0 &{} 0 &{} 1 &{} 0 &{} 1 &{} 0 &{} 1 &{} 0 &{} 1 &{} 0 &{} 1 &{} 1 &{} 1 &{} 1 &{} 1 &{} 1 &{} 1 &{} 0 &{} 0 &{} 0 &{} 0\\ 0 &{} 1 &{} 0 &{} 1 &{} 0 &{} 1 &{} 0 &{} 1 &{} 1 &{} 1 &{} 1 &{} 1 &{} 1 &{} 1 &{} 0 &{} 1 &{} 0 &{} 0 &{} 0 &{} 0 &{} 1 &{} 0 &{} 0 &{} 0 \\ 0 &{} 0 &{} 1 &{} 0 &{} 1 &{} 0 &{} 1 &{} 0 &{} 1 &{} 0 &{} 1 &{} 1 &{} 1 &{} 1 &{} 1 &{} 1 &{} 1 &{} 0 &{} 1 &{} 0 &{} 0 &{} 0 &{} 0 &{} 0 \\ \end{array} \right] \end{aligned}$$
(17)

The binary image of the codeword is then defined as:

$$\begin{aligned} {\textbf{c}}.{\textbf{H}}^T = {\textbf{0}} \end{aligned}$$
(18)

3 RLL-ECCs Obtained from Selected Reed Solomon Codes

In this section a technique will be proposed for obtaining RLL-ECCs from selected RS codes. It exploits their binary images and the specific property of rows in parity check matrices used for their construction. This property was proven in [19] as a Lemma 1. For the convenience of the reader here a simple rewording of it follows. Parity check matrix property necessary for RLL-ECC construction (Prop.):

Let the linear binary block code be defined by parity check matrix H. If in any row from H there is a set S of ones with even cardinality then adding to each codeword \({\textbf{c}} \in C\) a binary vector \({\varvec{\mu }}\) which has an odd number of ones in positions corresponding to the set S will transform the code C into a coset code \(C'\). For each codeword \({{\textbf{c}}}' \in C'\) it is valid that it does not have all symbols in the positions corresponding to set S identical. In other words not equal to all ones or all zeros.

This property, if found in more rows, can be used for each such row in case that the sets of ones in these rows are disjoint.

Reordering of coordinates in codewords from \({\textbf{c}} \in C\) can help to get even better RLL properties than using only the addition of the modifier to the original codewords. Further, we will denote \({\textbf{c}}_R\) and \({\varvec{\mu }}\) the reordered codewords \({\textbf{c}} \in C\) and modifier respectively.

In practice, the above-described property could be used as follows. After finding as many sets with even numbers of ones in disjoint positions in different rows as possible, and after appropriate reordering, modifier \({\varvec{\mu }}\) could be fixed, which causes the run lengths of equal symbols in codewords to be minimal. Then k information bits which have to be protected can be encoded into codeword \({\textbf{c}} \in C\), which then has to be reordered into codeword \({\textbf{c}}_R\). Before this codeword is stored or transmitted via constrained channel, the modifier \({\varvec{\mu }}\) has to be added to it:

$$\begin{aligned} {{\textbf{c}}}'_R = {\textbf{c}}_R + {{\varvec{\mu }}} \end{aligned}$$
(19)

The method of obtaining an RLL-ECC using the reordering and addition of modifier is illustrated from a high-level perspective in Fig. 1. On the receiving side the influence of the modifier \({\varvec{\mu }}\) is canceled by the addition of the same modifier in a synchronized manner to the received vector \({{\textbf{v}}}'_R\).

The main problem which has to be overcome when designing RLL-ECC codes from RS codes is that the RS codes are non-binary. Therefore the Prop., which is explicitly valid only for binary linear block codes, cannot be used directly. Therefore the first step which has to be done before the method based on using a modifier could be applied is to get binary representation of the parity check matrices and of RS code codewords. This could be achieved for RS codes defined over finite fields with characteristic two. The analysis will be done in the following sub-sections for selected RS codes.

  1. (a)

    One-time extended Reed Solomon codes

The parity check matrix of one-time extended RS codes (5) has the following binary image:

$$\begin{aligned} \mathbf{{\displaystyle H}}_b=\left[ \begin{array}{lllcll} {\textbf{A}}^0 &{} {\textbf{A}}^0 &{} {\textbf{A}}^0 &{} \cdots &{} {\textbf{A}}^0 &{} {\textbf{A}}^0\\ {\textbf{A}}^0 &{} {\textbf{A}}^1 &{} {\textbf{A}}^2 &{} \cdots &{} {\textbf{A}}^{(q-2)(j+1)} &{} {\textbf{0}}\\ \vdots &{} \vdots &{} \vdots &{} \vdots &{} \vdots &{} \vdots \\ {\textbf{A}}^0 &{} {\textbf{A}}^{(j+2t-1)} &{} {\textbf{A}}^{2(j+2t-1)} &{} \cdots &{} {\textbf{A}}^{(q-2)(j+2t-1)} &{} {\textbf{0}}\\ \end{array} \right] \end{aligned}$$
(20)

The binary image in (20) contains \(m \times 2t\) binary rows and \(m \times q\) binary columns. The matrix (20) is composed of 2t rows and \(q=2^m\) columns of submatrices with dimensions \(m \times m\). These rows and columns of submatrices will be denoted as macro-rows and macro-columns respectively. It is obvious that the one-time extended RS code in which \(j=0\) has a binary image expressed by a matrix having in the top macro row \({\textbf{h}}_I\) only submatrices \({\textbf{A}}^0\) with dimensions \(m \times m\).

$$\begin{aligned} \mathbf{{\displaystyle h}}_I=\left[ \begin{array}{llcl} {\textbf{A}}^0 &{} {\textbf{A}}^0 &{} \cdots &{} {\textbf{A}}^0 \\ \end{array} \right] \end{aligned}$$
(21)

The binary image of \({\textbf{h}}_I\) in more detail is expressed in (22).

$$\begin{aligned} \mathbf{{\displaystyle h}}_I=\left[ \begin{array}{cccccccccccccccc} 1 &{} 0 &{} \ldots &{} 0 &{} 0 &{} 1 &{} 0 &{} \ldots &{} 0 &{} 0 &{} &{} 1 &{} 0 &{} \ldots &{} 0 &{} 0\\ 0 &{} 1 &{} \ldots &{} 0 &{} 0 &{} 0 &{} 1 &{} \ldots &{} 0 &{} 0 &{} &{} 0 &{} 1 &{} \ldots &{} 0 &{} 0\\ \vdots &{} \vdots &{} \ddots &{} \vdots &{} \vdots &{} \vdots &{} \vdots &{} \ddots &{} \vdots &{} \vdots &{} \cdots &{} \vdots &{} \vdots &{} \ddots &{} \vdots &{} \vdots \\ 0 &{} 0 &{} \ldots &{} 1 &{} 0 &{} 0 &{} 0 &{} \ldots &{} 1 &{} 0 &{} &{} 0 &{} 0 &{} \ldots &{} 1 &{} 0\\ 0 &{} 0 &{} \ldots &{} 0 &{} 1 &{} 0 &{} 0 &{} \ldots &{} 0 &{} 1 &{} &{} 0 &{} 0 &{} \ldots &{} 0 &{} 1\\ \end{array} \right] \end{aligned}$$
(22)

Observing (22) it is obvious that in the case of a one-time extended RS code the number of ones in each row of \({\textbf{h}}_I\) will be even:

$$\begin{aligned} w_I(S) = 2^m \end{aligned}$$
(23)

By reordering (permutation) the columns in (22):

$$\begin{aligned} \mathbf{{\displaystyle h}}_{IR}=\left[ \begin{array}{ccccccccccccc} 1 &{} 1 &{} \ldots &{} 1 &{} 0 &{} 0 &{} \ldots &{} 0 &{} \ldots &{} 0 &{} 0 &{} \ldots &{} 0\\ 0 &{} 0 &{} \ldots &{} 0 &{} 1 &{} 1 &{} \ldots &{} 1 &{} \ldots &{} 0 &{} 0 &{} \ldots &{} 0\\ \vdots &{} \vdots &{} \vdots &{} \vdots &{} \vdots &{} \vdots &{} \vdots &{} \vdots &{} \ddots &{} \vdots &{} \vdots &{} \vdots &{} \vdots \\ 0 &{} 0 &{} \ldots &{} 0 &{} 0 &{} 0 &{} \ldots &{} 0 &{} \ldots &{} 1 &{} 1 &{} \ldots &{} 1\\ \end{array} \right] \end{aligned}$$
(24)

Let’s denote E, the number of type S intervals fulfilling Prop. in (24):

$$\begin{aligned} E = m \end{aligned}$$
(25)

For each of these intervals the cardinality is equal to the number of submatrices \({\textbf{A}}^0\) in \({\textbf{h}}_I\), which is identical to \(w_I(S)\) given by (23) or simply:

$$\begin{aligned} |S| = 2^m \end{aligned}$$
(26)

Within these intervals there is the possibility to flip an odd number of binary symbols by adding the modifier in order to ensure that not all symbols in that interval will be the same. The union of all these intervals contains all column indexes of macro-rows given by (22) or (24) and also of the corresponding parity check matrices. As a consequence, the maximal run lengths in RLL-ECCs obtained by the presented method from one-time extended RS codes over \(GF(2^m)\) will be given by:

$$\begin{aligned} RLL_{max} = 2^{m+1} - 2 \end{aligned}$$
(27)

The reason is obvious by observing the illustration in Fig. 2.

Fig. 2
figure 2

Illustration of \(RLL_{MAX}\) set by (27)

  1. (b)

    Three and five-times extended Reed Solomon codes

For a \(\nu\)-times extended RS code \(\nu > 1\) and \(\nu \in \{3,5\}\), the first macro-row \({\textbf{h}}_{II}\) in parity check matrix (4) will contain \(\nu - 1\) submatrices \({\textbf{Z}}\) of all zeros with dimensions \(m \times m\).

$$\begin{aligned} \mathbf{{\displaystyle h}}_{II}=\left[ \begin{array}{llclccc} {\textbf{A}}^0 &{} {\textbf{A}}^0 &{} \cdots &{} {\textbf{A}}^0 &{} {\textbf{Z}} &{} \ldots &{} {\textbf{Z}}\\ \end{array} \right] \end{aligned}$$
(28)

The Hamming weight of each row in (28) will be even (29).

$$\begin{aligned} w_{II}(S) = 2^\chi \end{aligned}$$
(29)

where \(\chi\) is an odd integer.

The number of type S intervals fulfilling Prop. in (28):

$$\begin{aligned} E = \chi \end{aligned}$$
(30)

For each of these intervals the cardinality is equal to the number of submatrices \({\textbf{A}}^0\) in \({\textbf{h}}_{II}\), which is identical to \(w_{II}(S)\) given by (29) or simply:

$$\begin{aligned} |S| = 2^\chi \end{aligned}$$
(31)

where \(\chi \ge 3\) is an odd integer. In these intervals one may flip an odd number of binary symbols by adding the modifier in order to ensure that not all symbols in that interval will be the same. The union of all these intervals contains altogether \(m. 2^\chi\) column indexes of macro-row given by (28) and also of the corresponding parity check matrix. For the more times-extended RS codes it is necessary to use such reordering so that the zeros from submatrices denoted as \({\textbf{Z}}\) in (28) will be divided and placed evenly between the interval denoted as S in order to get the minimal value of \(RLL_{MAX}\). After doing it, the maximal run lengths in RLL ECCs obtained by the presented method from \(\nu\)-times extended RS codes \(\nu \in \{3,5\}\) over \(GF(2^{\chi })\) will be given by:

$$\begin{aligned} RLL_{MAX} = 2^{\chi } + \nu -3 \end{aligned}$$
(32)

It is illustrated in Fig. 3.

Fig. 3
figure 3

Illustration of \(RLL_{MAX}\) set by (32)

  1. (c)

    Shortened Reed Solomon codes defined by generator matrix with primitive element as a root

If the original RS code given by (3) has \(\alpha ^0\) as a first root, the number of ones in each row of the first macro-row from top \({\textbf{h}}_I\) in the parity check matrix will be odd. However, by shortening it by \(\sigma\) symbols, where \(\sigma\) is an odd integer, it is possible to achieve that the first macro-row \({\textbf{h}}_{III}\) in the shortened RS code will have an even number of ones in each row as well. In this case the number of ones in each set S will be:

$$\begin{aligned} w_{III}(S) = 2^{(m-2)} + 1 - \sigma \end{aligned}$$
(33)

and

$$\begin{aligned} RLL_{MAX} = 2(2^m - \sigma - 2) \end{aligned}$$
(34)

in the obtained RLL-ECCs. The reason is illustrated in Fig. 4.

Fig. 4
figure 4

Illustration of \(RLL_{MAX}\) set by (34), \(n' = 2^{(m-2)} +1 - \sigma\)

4 On Some Properties of the Obtained RLL-ECCs

In this section some notes on the properties of the obtained RLL-ECCs will be made.

The first note is that the presented method will not change the basic parameters \([n,k,d_m]\) of the original RS codes from which the RLL-ECC construction starts. In other words, the addition of the modifier and the reordering of the symbols in the codeword will not change \([n,k,d_m]\). It is well known that this is valid for any linear block code. The immediate consequence is that the redundancy of the original RS codes will not be increased by applying the method which transforms the original RS codes to RLL-ECCs. From the first note one can also assume that the error correcting capability of the obtained RLL ECCs will be the same as the original codes have. However the error correcting capabilities of ECCs depend also on the method which is used for their decoding. Consequently this assumption is correct only if some round conditions are valid and only for some decoding methods.

Therefore the second note is that if some round conditions are valid the error correcting capabilities of the obtained RLL-ECCs are identical to the original RS codes and shortened original RS codes for selected decoding methods without the need to change them. This second note needs some more explanation than the fact connected with the first note.

The basic practical restriction is that the method for derivation of binary RLL-ECCs from non-binary Reed Solomon codes implies that it can be useful only in cases where the binary system is used for transmission. Such a system is in [21] modeled using a Binary Symmetric Channel (BSC) or system which uses coherent binary phase shift keying (BPSK) modulation over Additive White Gaussian Noise (AWGN) channel. In [21] it was shown that hard and soft decoding of binary Low Density Parity Check Codes (LDPC) do not have to be modified when the proposed method is used in order to construct RLL-LDPC codes and also that error correcting capabilities of the RLL-LDPC codes will stay the same as for the original LDPC codes. The soft decoding method for which it is valid and which was analyzed in [21] is the well-known and most often used belief propagation (BP) decoding operating with log-likelihood ratios (LLRs).

The natural question arises if the results from [21] could be applied also for RLL-ECCs obtained from selected RS codes. In other words if the original hard or soft decoders of RS codes can stay intact after the proposed method for construction of RLL-ECCs from RS codes is used and if the method will not have an influence on the error correcting capabilities of the constructed RLL-ECCs. As will be obvious in the same round conditions as in [21] the answer is positive for selected decoding methods.

In case the transmission is modeled using BSC the reasons why the decoding methods do not have to be modified and also that the double addition of a modifier will not have any influence on the error correcting capabilities of the RLL-ECCs are trivial. Namely the addition of the modifier at the input to the BSC and at the output of the BSC cancel out therefore it is obvious that they do not have any influence on the decoding. This is valid for any hard decoding method.

The part concerning the addition of modifiers is illustrated in Fig. 5. In Fig. 5a the reordered codeword \({\textbf{c}}_R\) is modified by the modifier \({{\varvec{\mu }}}\):

$$\begin{aligned} {\textbf{c}}'_R = {\textbf{c}}_R + {{\varvec{\mu }}} \end{aligned}$$
(35)

\({\textbf{c}}'_R\) is the codeword from the RLL-ECC which is transmitted through the BSC. The errors which can occur in the BSC are modeled by the error vector e. The received vector \({\textbf{v}}'_R\)

$$\begin{aligned} {\textbf{v}}'_R = {\textbf{c}}_R + {\textbf{e}} \end{aligned}$$
(36)

After the second addition of the modifier

$$\begin{aligned} {\textbf{v}}'_R + {{\varvec{\mu }}} = {\textbf{c}}'_R + {\textbf{e}} + {{\varvec{\mu }}} = {\textbf{c}}_R + {\textbf{e}} + {{\varvec{\mu }}} + {{\varvec{\mu }}} = {\textbf{v}}_R \end{aligned}$$
(37)

From (35)–(37) it is obvious that the models depicted in Figs. 5a and b are equivalent from the point of their inputs and outputs.

Fig. 5
figure 5

Illustration of why the modifier has no influence on hard decision decoding and why the hard decision decoding algorithm does not have to be modified in cases where the described method for obtaining RLL ECCs from RS codes is used

In cases of soft decision decoding methods the situation deserves more explanatory text. It has to be mentioned that soft decoding of RS codes presented a challenge for a long time. However because the RS codes have so many applications, there was lot of research work on this challenge and today multiple soft decision decoding methods are known. Therefore, it is appropriate to start with basic categorization of the methods which are known at the present time for soft decoding of RS codes defined over \(GF(2^m)\). These soft decoding methods could be categorized into two classes. The first class is the so called symbol-level decoding and the second class the so called bit-level decoding. In the first class the most frequently used methods were proposed in [22] and [23]. In [24] it is argued that the results presented in most previous publications are suggesting that the second class, namely bit-level decoding is superior to the symbol level concerning error correcting capabilities.

The bit level soft decision decoding methods for RS codes defined over \(GF(2^m)\) are based on the usage of Tanner graphs obtained from binary images of the parity check matrices of these RS codes. They can also use LLR values for operation. Therefore they are compatible with RLL-ECCs obtained by using the method presented in this paper which is also based on such binary images of parity check matrices of RS codes. Moreover the arguments used in [21] are valid for these methods as well. Probably the most popular example of bit level soft decision decoding of RS codes was proposed in [25] . However any soft decision bit level decoding algorithm can be used without change for RLL-ECCs which can operate with LLR values. Examples are the decoding methods proposed in [25,26,27,28].

For the convenience of the reader Figs. 6 and 7 are included which illustrate the elimination of the influence of the modifier on LLR values in cases where the coherent BPSK and AWGN channel is used for modelling the transmission of RLL ECCs.

In Fig. 6 it is illustrated that the influence on one binary symbol \(b \in \{0,1\}\) by adding modulo 2 or in other words XOR-ing it with one from a modifier and following mapping the result on symbol \(x \in \{+1,-1\}\) Fig. 6a can be equivalently modeled as first mapping \(b \in \{0,1\}\) on \(x \in \{+1,-1\}\) and then multiplying the result with \(-1\) Fig. 6b.

Fig. 6
figure 6

Illustration of two equivalent models representing the influence of a single 1 from the modifier on one symbol on the transmitting side

In Fig. 7 the overall situation is depicted which illustrates that the influence of the 1 from the modifier on the LLR connected with the corresponding symbol is eliminated by multiplying the LLR by \(-1\).

Fig. 7
figure 7

Illustration of how the influence of the modifier on the LLR can be eliminated in the receiver via multiplication by \(-1\). (The optimal receiver is composed of a matched filter and sampler)

The following argumentation is an extract from [21]. Let’s choose the following mapping between the data bits and the coherent BPSK modulation:

$$\begin{aligned}{} & {} 0 \rightarrow s_1(t) = \sqrt{E} \cos(2 \pi f t) \end{aligned}$$
(38)
$$\begin{aligned}{} & {} 1 \rightarrow s_2(t) = -\sqrt{E} \cos(2 \pi f t) \end{aligned}$$
(39)

Using this mapping in the original system (without using a modifier) the LLR is:

$$\begin{aligned} L(z/s) = \ln \frac{p(z/0)}{p(z/1)} = \ln \frac{\frac{1}{\sigma _0 \sqrt{2 \pi }} \exp \left[ - \frac{1}{2} \left( \frac{z + \sqrt{E}}{\sigma _0} \right) ^2\right] }{\frac{1}{\sigma _0 \sqrt{2 \pi }} \exp \left[ - \frac{1}{2} \left( \frac{z - \sqrt{E}}{\sigma _0} \right) ^2\right] } = - \frac{2 \sqrt{E}}{\sigma ^2_0} z \end{aligned}$$
(40)

z, p(z/b) and \(\sigma _0\) are the sample at the output of the optimal receiver, the likelihood of the sample (conditional pdf that the sample has value z if bit b was transmitted) and the dispersion of the AWGN on the output of the optimal receiver respectively.

If the modifier inverts the transmitted bit (which will cause exchanged the mapping given by (38) and (39)) the transmitted bit the LLR becomes

$$\begin{aligned} L(z/s) = ln \frac{p(z/0)}{p(z/1)} = ln \frac{\frac{1}{\sigma _0 \sqrt{2 \pi }} exp \left[ - \frac{1}{2} \left( \frac{z - \sqrt{E}}{\sigma _0} \right) ^2\right] }{\frac{1}{\sigma _0 \sqrt{2 \pi }} exp \left[ - \frac{1}{2} \left( \frac{z + \sqrt{E}}{\sigma _0} \right) ^2\right] } = + \frac{2 \sqrt{E}}{\sigma ^2_0} z \end{aligned}$$
(41)

This confirms that the multiplication by \((-1)\) in the receiver will eliminate the influence of the modifier in the receiver.

In this section it was shown that in case of a BSC the influence of reordering and addition of a modifier are eliminated in the receiver fully by a second addition of the modifier and de-reordering. In cases of soft decision decoding there are selected decoding methods for the RLL ECCs obtained by the method presented in this paper for which there will not be any influence on the performance of the decoding when compared with the original RS codes if the communication system is modeled using an AWGN channel and coherent BPSK modulation. It is just required-to invert the LLR values in the receiver corresponding to binary symbols inverted in the transmitter by the ones in the modifier and then de-reorder the symbols before the RLL values are input into the soft decision decoder [21]. For example the soft decision decoding methods proposed in [27, 28] can be used in this case.

5 Conclusion

In this paper it was shown that some RS codes could be transformed into RLL-RS codes using the presented method and that the maximal run length in the obtained codes could be given analytically. It introduces no additional redundancy and it is not necessary to develop new encoding and decoding procedures for the obtained RLL-ECCs codes if some round conditions and appropriate decoding methods are used. It is not excluded that other RS codes could also be transformed into RLL-ECCs. This is an open question and further research will be needed in order to answer it.