Next Article in Journal
Process Corresponding Implications Associated with a Conclusive Model-Fit Current-Voltage Characteristic Curves
Next Article in Special Issue
Performance Analysis of Hardware Implementations of Reverse Conversion from the Residue Number System
Previous Article in Journal
Research on Tracking the Behavior of the Ciobanus Forest Road over a Season Time through Specific Tests and Analysis
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Multiple Error Correction in Redundant Residue Number Systems: A Modified Modular Projection Method with Maximum Likelihood Decoding

1
North Caucasus Center for Mathematical Research, North-Caucasus Federal University, 355017 Stavropol, Russia
2
Institute for System Programming of the Russian Academy of Sciences, 109004 Moscow, Russia
3
Computing Platform Lab, Samsung Advanced Institute of Technology, Suwon 16678, Korea
4
Computer Science Department, CICESE Research Center, Ensenada 22860, Mexico
5
School of Electrical Engineering and Computer Science, South Ural State University, 454080 Chelyabinsk, Russia
6
Department of Information Security, Le Quy Don Technical University, Hanoi 11917, Vietnam
7
Computer Science Department, National Research University “MPEI”, 111250 Moscow, Russia
*
Author to whom correspondence should be addressed.
Appl. Sci. 2022, 12(1), 463; https://doi.org/10.3390/app12010463
Submission received: 12 November 2021 / Revised: 27 December 2021 / Accepted: 29 December 2021 / Published: 4 January 2022
(This article belongs to the Special Issue Emerging Residue Number System Technologies and Applications)

Abstract

:
Error detection and correction codes based on redundant residue number systems are powerful tools to control and correct arithmetic processing and data transmission errors. Decoding the magnitude and location of a multiple error is a complex computational problem: it requires verifying a huge number of different possible combinations of erroneous residual digit positions in the error localization stage. This paper proposes a modified correcting method based on calculating the approximate weighted characteristics of modular projections. The new procedure for correcting errors and restoring numbers in a weighted number system involves the Chinese Remainder Theorem with fractions. This approach calculates the rank of each modular projection efficiently. The ranks are used to calculate the Hamming distances. The new method speeds up the procedure for correcting multiple errors and restoring numbers in weighted form by an average of 18% compared to state-of-the-art analogs.

1. Introduction

Despite significant efforts, both in industry and science, high fault tolerance remains a serious problem in the management of large-scale IT systems.
The consequences of failures, regardless of their causes, can be eliminated using various methods by introducing data redundancy. Erasure codes, replication, and Resilient Distributed Dataset (RDD) [1] are the most important methods for ensuring fault tolerance in modern data storage and processing systems.
Replication is the simplest-to-implement (therefore, most widespread) method of introducing redundancy [2]. However, replication leads to significant overhead costs expressed in additional resources for duplicating data and functionality. In turn, erasure codes [3,4] are devoid of this drawback. Such codes counteract the partial loss of data and are based on a principle of antinoise coding (parity check). Erasure codes save significant costs and energy [3]. However, data recovery after failures is associated with high reconstruction costs and network traffic. The transition from replication to erasure codes and RDD is complicated by the need to update the hardware–software base and recode the entire volume of stored data. Nevertheless, there are examples of successful adoption of these technologies by Facebook [5] and Microsoft Azure [3].
This paper proposes a new approach to error correction codes based on a redundant residue number system (RRNS) [6,7]. Along with the Reed–Solomon codes [8], the Rabin dispersal algorithm [9], etc., RRNSs provide the functionality implemented by erasure codes and the functionality implemented by RDD algorithms. In addition, an important property of RNSs is the ability to perform arithmetic operations over encoded data. This property can be used in modern distributed data processing systems [10,11,12] and encrypted data processing schemes [13]. Therefore, RRNSs are a unique and versatile tool for a wide range of applications.
There are two main strategies for correcting errors in RRNSs. The first one involves syndrome decoding [14,15,16]: erroneous parts of the data are determined by comparing a special numerical syndrome calculated on the obtained data with the reference values. The second strategy is to restore error-free data based on the obtained code [17,18,19] by calculating the error magnitude and correcting the code during the decoding process. The authors [19] suggested a maximum likelihood decoding (MLD) approach to simplify the corrective decoding method by reducing the enumeration of values during decoding.
This paper proposes a modified method for corrective data decoding in RRNSs using MLD. Unlike the decoding method [19], this approach involves an alternative version of the Chinese Remainder Theorem (CRT) [20,21,22] for more efficient data restoration due to parallel execution of decoding and error correction. The CRT with fractions allows dividing the decoding process into two independent parts: determining the weighted characteristic of a number (a relative estimate of its magnitude) and decoding itself. The weighted characteristic can be directly used for error correction, and data decoding can be performed in parallel. The proposed modified modular projection method with MLD speeds up the procedure of error correction and number restoration in the weighted number system compared to the original method [19]. At the same time, it consumes many more hardware resources.
This paper is organized as follows: In Section 2, the existing research in the field of error correction in RRNSs is surveyed. A detailed introduction to RNSs, including the notations and preliminaries used below, is given in Section 3. Additionally, this section briefly describes MLD [19]. Section 4 presents the proposed method and analyzes its complexity. Section 5 is devoted to the hardware implementation of the proposed method, comparing it with the existing methods. The outcomes of this paper are summarized in Section 6.

2. Related Works

Error detection and correction codes based on a redundant residue number system (RRNS) are modern and powerful tools to control and correct arithmetic processing and data transmission errors. Algorithms that correct only single errors were considered and improved by several authors [6,23,24,25]. Decoding the magnitude and location of a single error is significantly less complex than detecting and correcting errors in multiple bits of RRNSs. It requires verifying a huge number of different possible combinations of erroneous residual digit positions in the error localization stage. The localization stage consumes the most time in the procedure for correcting multiple errors in RRNSs. All known methods for detecting and correcting multiple errors in RRNSs can be divided into three large groups: continuous fractions [26,27], syndrome decoding [14,15,16], and modular projections [17,18,19]. These groups of methods have advantages and drawbacks.
The methods with continuous fractions are based on the Euclidean recursive algorithm. After localization, erroneous remainders are corrected by expanding the moduli system using error-free remainders. For multiple errors in residual digits of large bit depth, the recursive Euclidean algorithm needs many iterations and becomes inefficient in hardware implementation.
The paper [16] presented an approach to correcting multiple errors in RRNSs using syndromes. Later, it was improved in [14,15]. According to [15], the residual digits in syndrome decoding are divided into three groups; seven categories of error positions are determined among them. The error magnitudes are distributed in three syndromes, which are used to categorize the errors accurately and localize the erroneous residual digits simultaneously from the six lookup tables. Syndromes can be calculated in parallel, and operations are performed in small moduli. This feature is an undoubted advantage of the approach, providing high-speed execution of the error correction procedure for RRNSs. Among the drawbacks of this method, note a rather strong constraint on the choice of redundant moduli:
2 m 1 m 2 m k < m k + 1 m k + 2 m n ,
where k denotes the number of information moduli in an RRNS, and n is the total number of RRNS moduli. A critical shortcoming of methods with syndrome decoding is that the volume of lookup tables sharply grows with an increase in the error multiplicity and the bit width of the residual digits. Searching through large lookup tables is time consuming and negates the benefit of efficiently calculated syndromes. Thus, methods with syndrome decoding are efficient only for small moduli sets.
The method with modular projections was pioneered in [17] and improved and extended to the case of multiple errors in the subsequent works [18,28]. With this approach, erroneous residual digits are localized by reducing the RRNS, deleting the number of remainders equal to the error multiplicity. The value represented in the RRNS falls into the legitimate range after excluding the erroneous residual digits. This process is similar to syndrome decoding. It requires estimating each possible combination of residual digit error locations. Methods with modular projections need no large lookup tables: this is an absolute advantage over methods with syndrome decoding. Other advantages include a weaker constraint on the choice of redundant moduli than in the case of syndrome decoding:
m i < m k + 1 ,   m k + 2 ,   ,   m n ,   i k ,
where k denotes the number of information moduli in an RRNS, and n is the total number of RRNS moduli. A critical shortcoming of such methods is the number of modular projections equal to C n t , where t denotes the maximum error multiplicity. Obviously, the number of modular projections grows fast with an increase in the error multiplicity, raising the number of computations accordingly.
The paper [19] proposed an essentially different method with modular projections: the number of projections was reduced by changing their construction procedure. The idea is to delete r = n       k remainders instead of t ones (the conventional approach). The algorithm for constructing modular projections and their number was refined in [29]. Since r > t , the number of modular projections is significantly reduced, but it becomes necessary to check the Hamming distances according to maximum likelihood decoding (MLD). This approach eliminates the critical shortcoming of the rapidly growing number of projections and seems an optimal choice for correcting multiple errors in modular codes. The ideas and approaches [19] underlie the modified modular projection method with MLD; see Section 4. Using the Chinese Remainder Theorem with fractions [20,21,22] opens up new opportunities for parallelizing the algorithm and speeding up the procedure for correcting RRNS errors. Section 5 presents the hardware implementations of the original method [19] and the modified modular projection method with MLD on Field-Programmable Gate Array (FPGA). The hardware implementations partially involve the authors’ computing modules described in the earlier publications [30,31].

3. Residue Number System and Multiple Error Correction

3.1. Residue Number System

A residue number system (RNS) [7,32,33] is a non-weighted number system. In an RNS, an integer X is represented by a k -dimensional vector ( x 1 ,     x 2 ,         ,   x k ) of the remainders in dividing it by positive coprimes ( m 1 ,   m 2 ,     ,   m k ) called the RNS moduli. The magnitude of X belongs to the range [ 0 ,   M K 1 ] , where
M K = i = 1 k m i ,
and each remainder x i is the least nonnegative modulo m i residue of X :
x i = X mod m i   ( equivalently ,   | X | m i ) .
Note that when obtaining the RNS representation of X , the modulus remainders are calculated independently and in parallel. The paper [30] considered the most effective methods for calculating the remainder of the division and presented schematic diagrams for their hardware implementation.
The inverse conversion, i.e., restoring the weighted representation of a number from its RNS representation, is a much more difficult task than the direct conversion. The weighted representation of a number (its weighted characteristic) can be found using the Chinese Remainder Theorem (CRT) [7], the CRT with fractions (CRTf) [20,21,22], or conversion to a mixed radix number system (MRNS) [34,35].
The modified multiple error correction method proposed below partially involves the CRT and CRTf.

3.2. Chinese Remainder Theorem

According to the Chinese Remainder Theorem (CRT), an integer X is calculated from its RNS representation ( x 1 ,   x 2 ,     ,   x k ) as follows [7]:
X = | i = 1 k M K m i | m i M K | m i x i | M K
or equivalently,
X = i = 1 k M K m i | m i M K | m i x i r X M K
where | m i M K | m i denotes the multiplicative inversion of | M K m i | m i , and r X is the number rank (a value showing how many times the sum in (3) exceeds the RNS range).

3.3. Chinese Remainder Theorem with Fractions

A number X is converted to a weighted number system (WNS) using the Chinese Remainder Theorem with fractions (CRTf) [4,24,31]:
X = F ( X ) M K ,
where
F ( X ) = | i = 1 k k i * x i | 1 ,   k i * = | m i / M K | m i m i ,
and | | 1 denotes taking the fractional part of a number.
The value F ( X ) is called the approximate weighted characteristic of X in the RNS representation.
We propose using a binary shift of fractions to implement this algorithm on a hardware base not supporting fractions (e.g., FPGA). The accuracy of the constants k i * in (5), sufficient for correctly reconstructing the weighted representation of X , was thoroughly estimated in [20]. A number X X is converted to a WNS using the CRTf with the binary shift as follows:
X = F ( X ) M K 2 N ,
where
F ( X ) = | i = 1 k k i * x i | 2 N ,   k i * = | m i / M K | m i m i 2 N
and N = log 2 ( M K i = 1 k ( m i 1 ) ) [4].
The CRTf allows converting RNS representations of numbers to the WNS ones efficiently on any computing platform: all calculations are reduced to operations well implemented in hardware. These operations include addition, multiplication, binary shifts, and discarding the most significant digits of a number [31].

3.4. Redundant Residue Number System

The residual representation of an error-free integer is unique for the range [ 0 ,   M K 1 ] . This range is used for detecting and correcting errors in the RNS. Expanding the code space of the residual representation r with additional residual bits, we form an ( n ,   k ) -redundant residue number system (RRNS) with correcting properties.
An RRNS with n =   k +   r is based on coprime moduli ( m 1 , m 2 , , m k , m k + 1 , , m n ) and the full range M N = i = 1 n m i . The additional moduli, m k + 1 , m k + 2 , , m k + r , are called the redundant moduli of the RRNS. The range [ 0 ,   M K 1 ] corresponding to the first k information moduli from the n-dimensional vector is called the legitimate range. The range [ M K ,   M N 1 ] corresponding to the additional r redundant (control) moduli is called the illegitimate range. The legitimate range is the required computational range of the number system, while the illegitimate range is necessary for error detection, localization, and correction.
When an error occurs, an integer X = ( x 1 , x 2 , , x k , x k + 1 , , x n ) within the legitimate range is converted to X = X + E , where E E is the error. The value X falls into the illegitimate range if
1)
m k + 1 , m k + 2 , , m k + r > m i , i k ,
2)
the number of erroneous remainders does not exceed r .
Thus, to detect an error, we should restore the number X X from its RRNS representation ( x 1 , x 2 , , x k , x k + 1 , , x n ) . If the resulting value is smaller than the dynamic range of the RRNS ( X < M K M), the number X contains no errors of multiplicity r and below; otherwise, the RRNS representation ( x 1 , x 2 , , x k , x k + 1 , , x n ) of X X contains 1 or 2 or 3,..., or r erroneous residual digits.
The number of erroneous residual digits detected and corrected is determined by the number of redundant moduli added. In the general case without special restrictions, the ( n ,   k ) -RRNS with r =   n     k redundant moduli detects r and corrects t = r / 2 erroneous residual digits [7].

3.5. Modular Projection Method

The modular projection method is used to correct erroneous residual digits of numbers in the RRNS representation. Let an error be detected in a number X written in the RRNS. The ( n ,   k ) -RRNS allows correcting t = ( n k ) / 2 erroneous residual digits [7]. According to the classical modular projection method, t or fewer errors are corrected in the following steps:
1)
Constructing C n t modular projections. A modular projection is obtained by deleting t remainders in the original RRNS representation of the number. Deleting different sets of t remainders, we construct different modular projections.
2)
Obtaining the weighted representation (weighted characteristic) of each modular projection. The weighted representation of a number is its magnitude in the WNS. The weighted characteristic of a number depends on the inverse RNS-to-WNS conversion method.
3)
Comparing the weighted representation (weighted characteristic) of each modular projection with the value (weighted characteristic) of the dynamic range. A modular projection whose weighted representation (weighted characteristic) does not exceed that of the dynamic range contains the correct remainders. Note that there can be C n i t i correct modular projections, where i is the number of erroneous digits, i = 1 , , t . In this case, the remainders deleted when constructing each correct projection will be erroneous.
4)
Calculating the remainders on dividing the correct modular projection’s weighted representation by the moduli corresponding to the erroneous remainders. Note that correcting erroneous remainders is not required to decode correct data from the RRNS: the weighted representation of a correct modular projection is the corrected number written in the WNS. When using the weighted characteristic of a modular projection in step 3), it is necessary to perform an additional step for decoding: obtain the weighted representation of the number from its weighted characteristic.
For each projection, calculations are performed in parallel, which significantly reduces the total time to correct errors in RRNS codes. A critical drawback of this method is the fast-growing number of modular projections with an increase in the error multiplicity. An increase in the number of modular projections does not affect the total execution time of the error-correction procedure in RRNS codes due to the parallel computations for each projection. However, it sharply raises hardware costs [18]. This critical drawback can be overcome using the concept of maximum likelihood decoding (MLD) [19].

3.6. Modular Projection Method with MLD

The paper [19] improved the classical modular projection method to reduce the number of projections by changing their construction. When constructing a modular projection, the idea is to delete not r residual bits of the ( n ,   k ) -RRNS instead of t ones, where t = ( n k ) / 2 is the maximum multiplicity of an error corrected by the ( n ,   k ) -RRNS, and r = n     k is the number of redundant moduli. The algorithm for constructing modular projections was described in detail in [29].
Such an approach to constructing modular projections allows for reducing their number to C n / 2 t [29]. However, some incorrect projections fall into the legitimate RRNS range. To separate correct projections, we propose using maximum likelihood decoding (MLD) [19]. According to the MLD concept, an additional step is to calculate the Hamming distances between the erroneous number in the RRNS representation and each modular projection. In the RNS, the Hamming distance is defined as the number of distinct corresponding remainders. Let X = ( x 1 ,   x 2 ,   ,   x n ) and Y = ( y 1 ,   y 2 ,   ,   y n ) be numbers written in the RNS with bases m 1 ,   m 2 ,   ,   m n . Then the Hamming distance is given by
h ( X , Y ) = i = 1 n f ( x i , y i ) ,   where   f ( a , b ) = { 1   if   a b , 0   if   a = b .
Therefore, we should find the remainders of the moduli deleted when constructing each projection.
Two conditions determine a correct projection:
-
The modular projection X i in the WNS (its weighted characteristic F ( X i ) ) is smaller than the RRNS dynamic range M K (its weighted characteristic F ( M K ) ).
-
The Hamming distance between the distorted number X X′ and the modular projection X i in the RRNS does not exceed the value of the maximum multiplicity t of errors corrected by this RRNS.
The following formula combines these conditions:
X = X i : { F ( X i ) < F ( M K ) ( or   X i < M K ) , h ( X , X i ) t ,   where   t = ( n k ) / 2 .
The remainders of the moduli deleted when constructing each projection can be calculated by extending the RNS moduli system [32] or restoring the number in the WNS and calculating the remainders of these moduli. These operations are resource-consuming and significantly increase the total time for correcting errors and restoring the number in the WNS.

4. Modified Modular Projection Method with MLD

Now consider a new method combining the advantages of the CRT, CRTf, and maximum likelihood projections [19]. The proposed modification concerns error localization and restoration of a correct number in the WNS; error detection is identical for the original method [19] and the modified method proposed below. In this regard, the description of error detection is omitted.
According to [19], each projection is restored in the WNS using the CRT. The resulting projections are employed to calculate the values of the missing remainders. Next, the Hamming distances are calculated for each projection, and the correct projection is selected (Figure 1a).
Reconstructing the weighted representation of projections using the CRT has high time delays. First of all, the delay is due to executing operations on a large modulus comparable to the dynamic range of the RRNS.
In the original method [19], the reconstructed weighted representations of modular projections are used, on the one hand, to calculate the missing remainders subsequently and, on the other hand, to obtain the correct number in the WNS. (One of the projections will be the correct number represented in the WNS.) In the modified method, we propose using (a) the ranks of the modular projections to obtain the missing remainders and (b) the approximate weighted characteristics of the CRTf to restore the modular projections in the WNS. This approach allows for calculating the missing remainders and reconstructing projections in the WNS in parallel (Figure 1b), not sequentially, as was proposed in [19].
The efficiency of the proposed modification largely depends on the efficiency of calculating the rank of a number represented in the RRNS. The choice of the CRTf for reconstructing modular projections in the WNS is not accidental: the approximate weighted characteristic F ( X ) closely relates to the rank r X of the number X written in the RRNS.
According to (3), the rank r X is given by
r X = i = 1 k M K m i | m i M K | m i x i X M K = i = 1 k M K m i | m i M K | m i x i M K X M K = i = 1 k | m i / M K | m i x i m i X M K .
Due to (4) and (5),
r X = i = 1 k | m i / M K | m i x i m i | i = 1 k | m i / M K | m i x i m i | 1 .
Recall that | | 1 denotes taking the fractional part of a number. Hence, the rank of X is given by
r X = i = 1 k | m i / M K | m i x i m i = i = 1 k k i * x i , k i * = | m i / M K | m i m i .
Note that F ( X ) and r X are the integer and fractional parts of the same value. We introduce the notation
F ( X ) = i = 1 k k i * x i , k i * = | m i / M K | m i m i .
Calculating F ( X ) , we simultaneously find the weighted characteristic F ( X ) (Equation (5)) and the rank r X of X (Equation (10)).
Similar to the case of the CRTf (Equations (6) and (7)), we propose using a binary shift to implement the calculation of F ( X ) on a hardware base not supporting fractions. The accuracy of the constants k i * in (11) is estimated by analogy with [20]. Then
F ( X ) = i = 1 k k i * x i , k i * = | m i / M K | m i m i 2 N ,
where N = log 2 ( M K i = 1 k ( m i 1 ) ) [20].
The value F ( X ) is especially convenient for the hardware implementation of the error correction procedure for modular codes. Really, the N least significant bits of the binary representation of F ( X ) calculated by Equation (12) will be the shifted weighted characteristic F ( X ) (Equation (7)):
F ( X ) = F ( X ) [ N 1 .. 0 ] ,
where N = log 2 ( M K i = 1 k ( m i 1 ) ) [20].
The other (most significant) bits will be equal to the rank r X of X :
r X = F ( X ) [ L e n g t h ( F ( X ) ) 1 . . N ] ,
where N = log 2 ( M K i = 1 k ( m i 1 ) ) [20].
After obtaining the shifted approximate weighted characteristic F ( X ) by Equation (13), the standard CRTf Equation (6) is used for restoration. We discuss in detail the calculation of the missing remainders using the rank r X .
This operation extends the system of RNS moduli [7] and can be performed efficiently by efficiently calculating the rank of a number.
According to (3),
X = i = 1 k M K m i | m i M K | m i x i r X M K .
Introducing the compact notation B i = M K m i | m i M K | m i , we write
X = i = 1 k B i x i r X M K ,   B i = M K m i | m i M K | m i ,   i = 1 , k .  
Due to (15), for each modular projection, the missing remainders on dividing the number X by the moduli m j deleted when constructing the projection are given by
| X | m j = | i = 1 k B i x i r X M K | m j .
Performing trivial transformations, we obtain
| X | m j = | | i = 1 k B i x i | m j + | r X ( M K ) | m j | m j
and, finally,
| X | m j = | | i = 1 k | B i | m j x i | m j + | r X | M K | m j | m j | m j .
Note that for each modular projection, the values | B i | m j and | M K | m j differ. However, these values are completely determined by the set of RRNS moduli. Therefore, they are calculated in advance and stored in the memory of the computing device.
Thus, the missing remainders are calculated using multiplication by a constant and addition on a small modulus comparable to the RRNS moduli. Both operations are well implemented in hardware. The key feature of the proposed approach is the ability to calculate the first term | i = 1 k | B i | m j x i | m j in the sum (16) independently and in parallel with the second one | r X | M K | m j | m j . We denote them by X m j ( 1 ) and X m j ( 2 ) , respectively:
X m j ( 1 ) = | i = 1 k | B i | m j x i | m j .
X m j ( 2 ) = | r X | M K | m j | m j .
Then Equation (16) becomes
| X | m j = | X m j ( 1 ) + X m j ( 2 ) | m j .
Since the values X m j ( 1 ) are calculated in parallel to F ( X ) and X m j ( 2 ) , the total execution time of the procedure for correcting errors in modular codes and restoring the correct number in the WNS is reduced.
An example demonstrating an approach to extending the system of RNS moduli using the number rank is presented in Appendix A (See, Example A1).
Another example demonstrating the proposed approach to error correction and restoration of the correct number in the WNS is presented in Appendix B (See, Example A2).
The proposed modified modular projection method with MLD for correcting multiple errors in modular codes allows for achieving a high level of parallelism and significantly reducing the total execution time of the multiple error correction procedure.
The proposed method requires calculation of the rank r X (Equation (14)) for base extension. CRT-I and CRT-II are not directly applicable to do this, while function F ( X ) , used in the article, gives the advantage to calculate the relative size of both the value X and r X simultaneously.

5. Hardware Implementation of Modified Modular Projection Method with MLD

The original [19] and modified modular projection methods for correcting multiple errors in modular codes (Section 4) have the identical error detection stage. For both methods equally, the implementation variability of this stage lies in choosing an appropriate algorithm for calculating the weighted characteristic of the corrected number. The hardware implementation and comparative analysis of such algorithms were presented in [31]. Let us compare the efficiency of error localization and correct data restoration in a WNS.
Using various computing devices for implementing methods and algorithms is often dictated by the need to adapt them to the architectural features of a given hardware base. Support of calculations in the ring of integers is a characteristic feature of FPGA computing devices that increases speed but severely restricts the class of executed tasks.
The original method [19] can be implemented on FPGA without any restrictions. The modified method contains operations with fractions and, therefore, requires adaptation when implemented on FPGA. Equations (12)–(14) are used for passing to integer calculations. This transition is illustrated by an example in Appendix C (See, Example A3).
The result of this example coincides with that of an example in Appendix B. Therefore, the transition to integer calculations by Equations (12)–(14) is correct.
The efficiency of the original [19] and modified methods for correcting multiple errors in modular codes was compared by their implementation in the Very High SpeedIntegrated Circuits Hardware Description Language (VHDL) using Xilinx Vivado 2019.1, a software tool for the design and analysis of HDL structures. For testing, we used a Kintex-7 FPGA (core Xilinx xc7k70tfbg676-2) of a sufficient area without DSP blocks.
This software–hardware base has hardware parallelization at the level of blocks implementing individual procedures and functions and, moreover, at the level of operations within these blocks. Figure 2 shows the schemes for parallelizing the compared methods at the block level: vertical lines separate parallel executed blocks, whereas horizontal lines indicate the synchronization of upper blocks. The schemes in Figure 2 specify the corresponding schemes in Figure 1, considering their hardware implementation.
The original method [19] contains no parallel blocks (Figure 2a); however, calculations for each modular projection are performed in parallel within each block, except for the first and the last ones. In the modified method, calculations for each modular projection are also performed in parallel within each block, except for the first and last ones; in addition, there is parallelism at the block level (Figure 2b).
Let us consider the hardware implementation of each block in Figure 2.
Original modular projection method with MLD [19] is presented in Appendix D.

Modified Modular Projection Method with MLD

Block X . When an error is detected, this block receives at the input n remainders representing the distorted number X in the ( n ,   k ) -RRNS.
Block X i . This block constructs modular projections. It is implemented in C n / 2 t parallel computational threads, where t = ( n k ) / 2 . Each thread corresponds to a modular projection and receives at the input k remainders of the distorted number X (the outputs of the block X ) obtained by the modular projection algorithm [29].
Block F ( X i ) . This block calculates the extended weighted characteristics of modular projections X i in the WNS. According to (12), it is implemented by k parallel multiplications of the remainders (the outputs of the block X i ) by constants modulo M and a k -operand adder [31].
Block r X i . This block calculates the ranks for each modular projection X i . It is implemented by extracting the most significant bits with numbers not less than N (14) from the extended weighted characteristic (the output of the block F ( X i ) ).
Block F ( X i ) . This block calculates weighted characteristics for each modular projection X i . It is implemented by extracting the least significant bits with numbers less than N (13) from the extended weighted characteristic (the output of the block F ( X i ) ).
Block X i m j ( 1 ) . This block calculates the missing remainders (the first term) for each modular projection X i . It is implemented by k parallel multiplications of the remainders (the outputs of the block X i ) by constants modulo M and a k -operand modulo adder [31]; see Equation (17).
Block X i m j ( 2 ) . This block calculates the missing remainders (the second term) for each modular projection X i . It is implemented by multiplying the rank (the output of the block r X i ) by a constant modulo M [31]; see Equation (18).
Block | X i | m j . This block calculates the missing remainders for each modular projection X i . It is implemented by modulo adding the first term (the output of the block X i m j ( 1 ) ) to the second term (the output of the block X i m j ( 2 ) ) [31]; see Equation (19).
Block X i (6). This block calculates the modular projections X i in the WNS. It is implemented by multiplying the weighted characteristic of the modular projection (the output of the block F ( X i ) ) by the dynamic range M K . Subsequently, the least significant bits with numbers less than N are discarded; see Equation (6).
Block h ( X ,   X i ) . This block calculates Hamming distances between the distorted number X and each modular projection X i . It is implemented by ( n     k ) parallel comparisons of the corresponding remainders of the distorted number X (the outputs of the block X ) and the modular projection X i (the outputs of the block | X i | m j ). Subsequently, the mismatches are counted by an n -operand adder.
Block X X (9). This block chooses a correct modular projection. It is implemented by the conjunction of two comparisons: the modular projection X i in the WNS (the output of the block CRT: X i ) is smaller than the dynamic range M K , and the Hamming distance (the output of the block h ( X ,   X i ) ) is not greater than the maximum multiplicity t of errors corrected by the ( n ,   k ) -RRNS. The results for each thread (conjunctions for different modular projections) are glued together into a C n / 2 t -bit number, and the number of the first nonzero bit corresponds to the correct modular projection.
Block X X. This block outputs the correct number X in the WNS. It is implemented by a C n / 2 t -input multiplexer with one control input. The common inputs are the modular projections X i in the WNS (the outputs of the block CRT: X i ). The control input is the number of the correct modular projection (the output of the block X (9)).
In the course of comparative analysis, we obtained data on the time and hardware costs for correcting single and double errors in modular codes. We used the ( 2 , 4 ) -RRNS (single error) and ( 2 , 6 ) -RRNS (double error) for numbers of different bit widths (4 bits, 8 bits, 16 bits, 24 bits, 32 bits, 48 bits, and 64 bits). The moduli sets, the time and hardware costs for correcting single and double errors and restoring the number in the WNS using the original modular projection method with MLD [19], and the modified one proposed in this paper are presented in Appendix E (See, Table A7 and Table A8).
Figure 3 shows the operating times of the methods depending on the bit width of the numbers under correction for a single error (see, Figure 3a) and double errors (see, Figure 3b).
According to Figure 3, the modified modular projection method with MLD proposed in this dynamic is faster than the original method [19]. Based on the simulation results on FPGA (see Appendix D), we conclude that the proposed method speeds up the procedure of error correction and number restoration in the WNS by an average of 1.23 times (18%) compared to the original approach [19]. On average, the modified modular projection method with MLD requires 1.55 times (35%) more resources for single errors and 1.76 times (43%) more resources for double errors.

6. Conclusions

Recovery weighted values of modular projections has high time complexity due to computations on a large modulus. The paper proposes a method based on the use of approximate positional characteristics and ranks of modular projections. The use of the Chinese Remainder Theorem with fractions in the procedure for correcting errors and recovery numbers in the weighted number system makes it possible to efficiently calculate the rank of each of the modular projections. The ranks of modular projections are employed to calculate the Hamming distances. This approach allows for parallelizing computations at the levels of operations and computing blocks.
The simulation results on FPGA have demonstrated that the proposed modified modular projection method with MLD speeds up the procedure of error correction and number restoration in the weighted number system by an average of 18% compared to the original method [19]. At the same time, it consumes many more hardware resources.
However, in further study, we are going to research the moduli set selection and the possibility of applying the proposed method for error correction codes with the RNS special moduli sets.

Author Contributions

Conceptualization, M.B., A.N., M.D., N.K., A.T., N.V.H., A.A. and V.T.; methodology, M.B., A.N., M.D., N.K., A.T., N.V.H., A.A. and V.T.; validation, M.B., A.N., M.D., N.K., A.T., N.V.H., A.A. and V.T.; formal analysis, M.B., A.N., M.D., N.K., A.T., N.V.H., A.A. and V.T.; investigation, M.B., A.N., M.D., N.K., A.T., N.V.H., A.A. and V.T.; writing—original draft preparation, M.B., A.N., M.D., N.K., A.T., N.V.H., A.A. and V.T.; writing—review and editing, M.B., A.N., M.D., N.K., A.T., N.V.H., A.A. and V.T.; supervision, M.B., A.N., M.D., N.K., A.T., N.V.H., A.A. and V.T. The main part of this work was made when Maxim Deryabin was a Senior Researcher at North-Caucasus Federal University. All authors have read and agreed to the published version of the manuscript.

Funding

This work was carried out at the North Caucasus Center for Mathematical Research within agreement no. 075-02-2021-1749 with the Ministry of Science and Higher Education of the Russian Federation. The reported study was funded by RFBR, project number 20-37-70023; Russian Federation President Grant MK-24.2020.9; and SP-1685.2019.5.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

Not applicable.

Conflicts of Interest

The authors declare no conflict of interest.

Appendix A

Example A1.
An RNS is given by a set of moduli  m 1 = 3 , m 2 = 5 , and m 3 = 11 . It is required to find the remainder on dividing the number  X = ( 1 , 4 , 6 )  in this RNS by the modulus  m 4 = 7 . For ease of further consideration, note that  X = 94  in the WNS.

Appendix A.1. Base Extension. Pre-Computation Stage

We obtain the constants for the moduli set  { 3 ,   5 ,   7 } .
M K = m 1 m 2 m 3 = 3 5 11 = 165 .
We calculate the constants B i by Equation (15):
B 1 = M K m 1 | m 1 M K | m 1 = 165 3 | 3 165 | 3 = 55 1 = 55 ,
B 2 = M K m 2 | m 2 M K | m 2 = 165 5 | 5 165 | 5 = 33 2 = 66 ,
B 3 = M K m 3 | m 3 M K | m 3 = 165 11 | 11 165 | 11 = 15 3 = 45 .
Next, we calculate the constants for Equation (16):
| B 1 | m 4 = | 55 | 7 = 6 ,   | B 2 | m 4 = | 66 | 7 = 3 ,   | B 3 | m 4 = | 45 | 7 = 3 ,   | M K | m 4 = | 165 | 7 = 3 .
Finally, we calculate the constants necessary for finding the rank  r X of X . According to (10),
k 1 * = | m 1 / M K | m 1 m 1 = | 3 / 165 | 3 3 = 1 3 ,
k 2 * = | m 2 / M K | m 2 m 2 = | 5 / 165 | 5 5 = 2 5 ,
k 3 * = | m 3 / M K | m 3 m 3 = | 11 / 165 | 11 11 = 3 11 .

Appendix A.2. Base Extension. Computation Stage

Step 1. We obtain  X m 4 ( 1 )  by Equation (17):
X m 4 ( 1 ) = | i = 1 3 | B i | m 4 x i | m 4 = | 6 1 + 3 4 + 3 6 | 7 = 1 .
Calculating the first term in Equation (16), we calculate the rank  r X  in parallel. According to (10),
r X = i = 1 3 k i * x i = 1 3 1 + 2 5 4 + 3 11 6 = 3 94 165 = 3 .
Using Equation (18), we find the second term  X m 4 ( 2 )  in Equation (16):
X m 4 ( 2 ) = | r X | M K | m 4 | m 4 = | 3 3 | 7 = 2 .
Step 2. We calculate the desired remainder by Equation (19):
| X | m 4 = | X m 4 ( 1 ) + X m 4 ( 2 ) | m 4 = | 1 + 2 | 7 = 3 .
This value matches the remainder on dividing  X = 94  by the modulus  m 4 = 7 .
End of example.

Appendix B

Example A2.
An  ( n ,   k ) -RRNS, where  n = 6  and  k = 2 , is given by a set of moduli  { 5 ,   7 ,   8 ,   9 ,   11 ,   13 } . It is required to find erroneous digits in the number  X = ( 0 ,   3 ,   7 ,   6 ,   1 ,   2 )  and correct them (if any). For ease of further consideration, note that the correct number is  X = 15 = ( 0 ,   1 ,   7 ,   6 ,   4 ,   2 ) , (The number  X  contains a double error in the 2nd and 5th remainders).
The ( 6 ,   2 ) -RRNS can correct  t = ( n k ) / 2 = r / 2 = 2  errors.

Appendix B.1. Error Detection. Pre-Computation Stage

To detect an error, we have to restore the number  X  in the WNS and compare it with the dynamic range  M K  or calculate the weighted characteristic  F ( X )  and compare it with the corresponding weighted characteristic  F ( M K )  of the dynamic range. To reduce calculations, we detect errors using weighted characteristics yielded by the CRTf. We calculate all necessary constants that can be pre-computed, saving them in memory (See, Table A1).
We calculate the dynamic and full ranges of this RRNS:
M K = 5 · 7 = 35 ,   M N = 5 · 7 · 8 · 9 · 11 · 13 = 360360 .
The constants for error detection (Equation (5)) are
k 1 * = | m 1 / M N | m 1 m 1 = | 5 / 360360 | 5 5 = 3 5 ,
k 2 * = | m 2 / M N | m 2 m 2 = | 7 / 360360 | 7 7 = 4 7 ,
k 3 * = | m 3 / M N | m 3 m 3 = | 8 / 360360 | 8 8 = 5 8 ,
k 4 * = | m 4 / M N | m 4 m 4 = | 9 / 360360 | 9 9 = 8 9 ,
k 5 * = | m 5 / M N | m 5 m 5 = | 11 / 360360 | 11 11 = 6 11 ,
k 6 * = | m 6 / M N | m 6 m 6 = | 13 / 360360 | 13 13 = 10 13 .
According to Equation (4),
F ( M K ) = M K M N = 35 360360 = 1 10296 .
Table A1. Pre-computed constants for error detection using CRTf.
Table A1. Pre-computed constants for error detection using CRTf.
{ m i } { k i * } F ( M K )
{ 5 ,   7 ,   8 ,   9 ,   11 ,   13 } { 3 / 5 ,   4 / 7 ,   5 / 8 ,   8 / 9 ,   6 / 11 ,   10 / 13 }   1 / 10296

Appendix B.2. Error Detection. Computation Stage

According to Equation (5),
F ( X ) = | i = 1 6 k i * x i | 1 = | 3 5 0 + 4 7 3 + 5 8 7 + 8 9 6 + 6 11 1 + 10 13 2 | 1 = = | 324481 24024 | 1 = 12169 24024 1 10296 = F ( M K ) .
Since  F ( X )     F ( M K ) , the number X contains an error.

Appendix B.3. Error Localization and Correction. Pre-Computation Stage

To correct errors, we use the modified modular projection method with MLD. The projections are constructed according to the algorithm [29]:
X 1 , 2 = ( x 1 ,   x 2 ,   x 3 ,   x 4 ,   x 5 ,   x 6 ) ,
X 3 , 4 = ( x 1 ,   x 2 ,   x 3 ,   x 4 ,   x 5 ,   x 6 ) ,
X 5 , 6 = ( x 1 ,   x 2 ,   x 3 ,   x 4 ,   x 5 ,   x 6 ) .
We calculate constants for each modular projection, saving them in memory (See, Table A2).
Table A2. Pre-computed constants for each modular projection.
Table A2. Pre-computed constants for each modular projection.
Modular Projection
X 1 , 2 = { 0 ,   3 } X 3 , 4 = { 7 ,   6 } X 5 , 6 = { 1 ,   2 }
1Number i = 1 ,   2
j = 3 , , 6
i = 3 ,   4
j = 1 ,   2 ,   5 ,   6
i = 5 ,   6
j = 1 , ,   4
2 { m i } { 5 ,   7 } { 8 ,   9 } { 11 ,   13 }
3 M K 35 72 143
4 F ( M K ) ,   ( M K = 35 ) 1 35 / 72 35 / 143
5 { k i * } { 3 / 5 ,   3 / 7 } { 1 / 8 ,   8 / 9 } { 6 / 11 ,   6 / 13 }
6 [ { | B i | m j }] [ { 5 ,   7 } ,   { 3 ,   6 } ,   { 10 ,   4 } , { 8 ,   2 } ] [ { 4 ,   4 } ,   { 2 ,   1 } ,   { 9 ,   9 } , { 9 ,   12 } ]   [ { 3 ,   1 } ,   { 1 ,   3 } ,   { 6 ,   2 } ,   { 6 ,   3 } ]  
7 { | M K | m j } { 5 ,   1 ,   9 ,   4 } { 3 ,   5 ,   5 ,   6 } { 2 ,   4 ,   1 ,   1 }
The modular projection  X 1 , 2 :   { m i } = { m 1 ,   m 2 } = { 5 ,   7 } , M K = 5 · 7 = 35 .
The weighted characteristic of the dynamic range M K for the projection is obtained by Equation (4):
F ( 35 ) = 35 / M K = 35 / 35 = 1 .
The constants for Equation (18) are
| M K | m 3 = | 35 | 8 = 5 ,   | M K | m 4 = | 35 | 9 = 1 ,
| M K | m 5 = | 35 | 11 = 9 ,   | M K | m 6 = | 35 | 13 = 4 .
According to Equation (15),
B 1 = M K m 1 | m 1 M K | m 1 = 35 5 | 5 35 | 5 = 7 3 = 21 ,
B 2 = M K m 2 | m 2 M K | m 2 = 35 7 | 7 35 | 7 = 5 3 = 15 .
The constants for Equation (17) are
| B 1 | m 3 = | 21 | 8 = 5 ,   | B 1 | m 4 = | 21 | 9 = 3 ,   | B 1 | m 5 = | 21 | 11 = 10 ,   | B 1 | m 6 = | 21 | 13 = 8 ,
| B 2 | m 3 = | 15 | 8 = 7 ,   | B 2 | m 4 = | 15 | 9 = 6 ,   | B 2 | m 5 = | 15 | 11 = 4 ,   | B 2 | m 6 = | 15 | 13 = 2 .
According to (11),
k 1 * = | m 1 / M K | m 1 m 1 = | 5 / 35 | 5 5 = 3 5 ,
k 2 * = | m 2 / M K | m 2 m 2 = | 7 / 35 | 7 7 = 3 7 .
The modular projection X 3 , 4 :   { m i } = { m 3 ,   m 4 } = { 8 ,   9 } , M K = 8 · 9 = 72 .
The weighted characteristic of the dynamic range M K for the projection is obtained by Equation (4):
F ( 35 ) = 35 / M K = 35 / 72 .
The constants for Equation (18) are
| M K | m 1 = | 72 | 5 = 3 ,   | M K | m 2 = | 72 | 7 = 5 ,
| M K | m 5 = | 72 | 11 = 5 ,   | M K | m 6 = | 72 | 13 = 6 .
According to Equation (15),
B 3 = M K m 3 | m 3 M K | m 3 = 72 8 | 8 72 | 8 = 9 1 = 9 ,
B 4 = M K m 4 | m 4 M K | m 4 = 72 9 | 9 72 | 9 = 8 8 = 64 .
The constants for Equation (17) are
| B 3 | m 1 = | 9 | 5 = 4 ,   | B 3 | m 2 = | 9 | 7 = 2 ,   | B 3 | m 5 = | 9 | 11 = 9 ,   | B 3 | m 6 = | 9 | 13 = 9 ,
| B 4 | m 1 = | 64 | 5 = 4 ,   | B 4 | m 2 = | 64 | 7 = 1 ,   | B 4 | m 5 = | 64 | 11 = 9 ,   | B 4 | m 6 = | 64 | 13 = 12 .
According to (11),
k 3 * = | m 3 / M K | m 3 m 3 = | 8 / 72 | 8 8 = 1 8 ,
k 4 * = | m 4 / M K | m 4 m 4 = | 9 / 72 | 9 9 = 8 9 .
The modular projection X 5 , 6 :   { m i } = { m 5 ,   m 6 } = { 11 ,   13 } , M K = 11 · 13 = 143 .
The weighted characteristic of the dynamic range M K for the projection is obtained by Equation (4):
F ( 35 ) = 35 / M K = 35 / 143 .
The constants for Equation (18) are
| M K | m 1 = | 143 | 5 = 2 ,   | M K | m 2 = | 143 | 7 = 4 ,
| M K | m 3 = | 143 | 8 = 1 ,   | M K | m 4 = | 143 | 9 = 1 .
According to Equation (15),
B 5 = M K m 5 | m 5 M K | m 5 = 143 11 | 11 143 | 11 = 13 6 = 78 ,
B 6 = M K m 6 | m 6 M K | m 6 = 143 13 | 13 143 | 13 = 11 6 = 66 .
The constants for Equation (17) are
| B 5 | m 1 = | 78 | 5 = 3 ,   | B 5 | m 2 = | 78 | 7 = 1 ,   | B 5 | m 3 = | 78 | 8 = 6 ,   | B 5 | m 4 = | 78 | 9 = 6 ,
| B 6 | m 1 = | 66 | 5 = 1 ,   | B 6 | m 2 = | 66 | 7 = 3 ,   | B 6 | m 3 = | 66 | 8 = 2 ,   | B 6 | m 4 = | 66 | 9 = 3 .
According to (11),
k 5 * = | m 5 / M K | m 5 m 5 = | 11 / 143 | 11 11 = 6 11 ,
k 6 * = | m 6 / M K | m 6 m 6 = | 13 / 143 | 13 13 = 6 13 .

Appendix B.4. Error Localization and Correction. Computation Stage

Step 1. We calculate the extended weighted characteristic for each modular projection (Equation (11)) using the pre-computed constants from Table A2. The weighted characteristic and rank of each modular projection are the fractional and integer parts, respectively, of the extended weighted characteristic.
The modular projection X 1 , 2 :
F ( X 1 , 2 ) = 3 5 0 + 3 7 3 = 1 2 7 ,
F ( X 1 , 2 ) = | F ( X 1 , 2 ) | 1 = | 1 2 7 | 1 = 2 7 ,   r X 1 , 2 = F ( X 1 , 2 ) = 1 2 7 = 1 .
The modular projection X 3 , 4 :
F ( X 3 , 4 ) = 1 8 7 + 8 9 6 = 6 5 24 ,
F ( X 3 , 4 ) = | F ( X 3 , 4 ) | 1 = | 6 5 24 | 1 = 5 24 ,   r X 3 , 4 = F ( X 3 , 4 ) = 6 5 24 = 6 .
The modular projection X 5 , 6 :
F ( X 5 , 6 ) = 6 11 1 + 6 13 2 = 1 67 143 ,
F ( X 5 , 6 ) = | F ( X 5 , 6 ) | 1 = | 1 67 143 | 1 = 67 143 ,   r X 5 , 6 = F ( X 5 , 6 ) = 1 67 143 = 1 .
Step 2. We calculate the second terms for finding the missing remainders for each modular projection (Equation (18)) using the constants from Table A2.
The modular projection X 1 , 2 :
X 1 , 2 m 3 ( 2 ) = | 1 5 | 8 = 5 ,   X 1 , 2 m 4 ( 2 ) = | 1 1 | 9 = 1 ,
X 1 , 2 m 5 ( 2 ) = | 1 9 | 11 = 9 ,   X 1 , 2 m 6 ( 2 ) = | 1 4 | 13 = 4 .
The modular projection X 3 , 4 :
X 3 , 4 m 1 ( 2 ) = | 6 3 | 5 = 3 ,   X 3 , 4 m 2 ( 2 ) = | 6 5 | 7 = 2 ,
X 3 , 4 m 5 ( 2 ) = | 6 5 | 11 = 8 ,   X 3 , 4 m 6 ( 2 ) = | 6 6 | 13 = 10 .
The modular projection X 5 , 6 :
X 5 , 6 m 1 ( 2 ) = | 1 2 | 5 = 2 ,   X 5 , 6 m 2 ( 2 ) = | 1 4 | 7 = 4 ,
X 5 , 6 m 3 ( 2 ) = | 1 1 | 8 = 1 ,   X 5 , 6 m 4 ( 2 ) = | 1 1 | 9 = 1 .
We obtain the weighted representations of modular projections (Equation (4)) in parallel with calculating the second terms.
The modular projection X 1 , 2 :
X 1 , 2 = F ( X 1 , 2 ) M K = 2 7 35 = 10 .
The modular projection X 3 , 4 :
X 3 , 4 = F ( X 3 , 4 ) M K = 5 24 72 = 15 .
The modular projection X 5 , 6 :
X 5 , 6 = F ( X 5 , 6 ) M K = 67 143 143 = 67 .
Step (1–2). We calculate the first terms for finding the missing remainders for each modular projection (Equation (17)) using the constants from Table A2. This is done in parallel with Steps 1–2.
The modular projection X 1 , 2 :
X 1 , 2 m 3 ( 1 ) = | 5 0 + 7 3 | 8 = 5 ,   X 1 , 2 m 4 ( 1 ) = | 3 0 + 6 3 | 9 = 0 ,
X 1 , 2 m 5 ( 1 ) = | 10 0 + 4 3 | 11 = 1 ,   X 1 , 2 m 6 ( 1 ) = | 8 0 + 2 3 | 13 = 6 .
The modular projection X 3 , 4 :
X 3 , 4 m 1 ( 1 ) = | 4 7 + 4 6 | 5 = 2 ,   X 3 , 4 m 2 ( 1 ) = | 2 7 + 1 6 | 7 = 6 ,
X 3 , 4 m 5 ( 1 ) = | 9 7 + 9 6 | 11 = 7 ,   X 3 , 4 m 6 ( 1 ) = | 9 7 + 12 6 | 13 = 5 .
The modular projection X 5 , 6 :
X 5 , 6 m 1 ( 1 ) = | 3 1 + 1 2 | 5 = 0 ,   X 5 , 6 m 2 ( 1 ) = | 1 1 + 3 2 | 7 = 0 ,
X 5 , 6 m 3 ( 1 ) = | 6 1 + 2 2 | 8 = 2 ,   X 5 , 6 m 4 ( 1 ) = | 6 1 + 3 2 | 9 = 3 .
Step 3. We calculate the missing remainders for each modular projection (Equation (19)).
The modular projection X 1 , 2 :
| X 1 , 2 | m 3 = | 5 + 5 | 8 = 2 ,   | X 1 , 2 | m 4 = | 0 + 1 | 9 = 1 ,
| X 1 , 2 | m 5 = | 1 + 9 | 11 = 10 ,   | X 1 , 2 | m 6 = | 6 + 4 | 13 = 10 .
The modular projection X 3 , 4 :
| X 3 , 4 | m 1 = | 2 + 3 | 5 = 0 ,   | X 3 , 4 | m 2 = | 6 + 2 | 7 = 1 ,
| X 3 , 4 | m 5 = | 7 + 8 | 11 = 4 ,   | X 3 , 4 | m 6 = | 5 + 10 | 13 = 2 .
The modular projection X 5 , 6 :
| X 5 , 6 | m 1 = | 0 + 2 | 5 = 2 ,   | X 5 , 6 | m 2 = | 0 + 4 | 7 = 4 ,
| X 5 , 6 | m 3 = | 2 + 1 | 8 = 3 ,   | X 5 , 6 | m 4 = | 3 + 1 | 9 = 4 .
Step 4. We calculate the Hamming distances between each modular projection in the RRNS and the distorted number (Equation (8)):
h ( X , X 1 , 2 ) = h ( ( 0 , 3 , 7 , 6 , 1 , 2 ) ( 0 , 3 , 2 , 1 , 10 , 10 ) ) = 4 ,
h ( X , X 3 , 4 ) = h ( ( 0 , 3 , 7 , 6 , 1 , 2 ) ( 0 , 1 , 7 , 6 , 4 , 2 ) ) = 2 ,
h ( X , X 5 , 6 ) = h ( ( 0 , 3 , 7 , 6 , 1 , 2 ) ( 2 , 4 , 3 , 4 , 1 , 2 ) ) = 4 .
Step 5. We choose a correct projection (See, Table A3).
Table A3. Computed modular projections and their characteristics.
Table A3. Computed modular projections and their characteristics.
Modular Projection
X 1 , 2 = 10 X 3 , 4 = 15 X 5 , 6 = 67
1 F ( X i ) 2/75/2467/143
2 F ( M K ) ,   ( M K = 35 )135/7235/143
3 ( x i ) (0,3,2,1,10,10)(0,1,7,6,4,2)(2,4,3,4,1,2)
4 ( x ) (0,3,7,6,1,2)(0,3,7,6,1,2)(0,3,7,6,1,2)
5 h ( X ,   X i ) 424
6 F ( X i ) < F ( M K ) ,   ( M K = 35 ) YesYesNo
7 h ( X ,   X i )     t ,   ( t = 2 ) NoYesNo
Both correctness conditions (9) are satisfied for the modular projection X 3 , 4 only. Therefore, the corrected number is X = X 3 , 4 = 15 = ( 0 ,   1 ,   7 ,   6 ,   4 ,   2 ) , and the proposed error correction method works properly.
End of example.

Appendix C

Example A3.
An ( n ,   k ) -RRNS, where n = 6 and k = 2 , is given by a set of moduli { 5 ,   7 ,   8 ,   9 ,   11 ,   13 } . It is required to find erroneous digits in the number X = ( 0 ,   3 ,   7 ,   6 ,   1 ,   2 ) and correct them (if any). For ease of further considerations, note that the correct number is X = 15 = ( 0 ,   1 ,   7 ,   6 ,   4 ,   2 ) . (The number X contains a double error in the 2nd and 5th remainders.)
The ( 6 ,   2 ) -RRNS can correct t = ( n k ) / 2 = r / 2 = 2 errors.

Appendix C.1. Error Detection. Pre-Computation Stage

To detect an error, we have to restore the number X in the WNS and compare it with the dynamic range M K , or calculate the weighted characteristic F ( X ) and compare it with the corresponding weighted characteristic F ( M K ) of the dynamic range. To reduce calculations, we detect errors using weighted characteristics yielded by the CRTf. We calculate all necessary constants that can be precomputed, saving them in memory (See, Table A4). In the memory of the computing device, the constants are stored in the binary representation. In this example, we use the decimal representation for clarity.
We calculate the dynamic and full ranges of this RRNS:
M K = 5 · 7 = 35 ( 10 ) = 100011 ( 2 ) ,
M N = 5 · 7 · 8 · 9 · 11 · 13 = 360360 ( 10 ) = 1010111111110101000 ( 2 ) .
The constants for error detection (Equation (5)) are
N = log 2 ( M K i = 1 6 ( m i 1 ) ) = log 2 ( 35 ( 4 + 6 + 7 + 8 + 10 + 12 ) ) = 25 ,
k 1 * = | m 1 / M N | m 1 m 1 2 N = | 5 / 360360 | 5 5 2 25 = 3 5 2 25 = 20132660 ( 10 ) = = 1001100110011001100110100 ( 2 ) ,
k 2 * = | m 2 / M N | m 2 m 2 2 N = | 7 / 360360 | 7 7 2 25 = 4 7 2 25 = 19173962 ( 10 ) = = 1001001001001001001001010 ( 2 ) ,
k 3 * = | m 3 / M N | m 3 m 3 2 N = | 8 / 360360 | 8 8 2 25 = 5 8 2 25 = 20971520 ( 10 ) = = 1010000000000000000000000 ( 2 ) ,
k 4 * = | m 4 / M N | m 4 m 4 2 N = | 9 / 360360 | 9 9 2 25 = 8 9 2 25 = 29826162 ( 10 ) = = 1110001110001110001110010 ( 2 ) ,
k 5 * = | m 5 / M N | m 5 m 5 2 N = | 11 / 360360 | 11 11 2 25 = 6 11 2 25 = 18302418 ( 10 ) = = 1000101110100010111010010 ( 2 ) ,
k 6 * = | m 6 / M N | m 6 m 6 2 N = | 13 / 360360 | 13 13 2 25 = 10 13 2 25 = 25811102 ( 10 ) = = 1100010011101100010011110 ( 2 ) .
The weighted characteristic of the dynamic range M K is obtained by Equation (6):
F ( M K ) = M K M N 2 N = 35 360360 2 25 = 3259 ( 10 ) = 110010111011 ( 2 ) .
Table A4. Pre-computed constants for error detection using CRTf.
Table A4. Pre-computed constants for error detection using CRTf.
{ m i } { k i * } F ( M K )
{5, 7, 8, 9, 11, 13}{20132660, 19173962, 20971520, 29826162, 18302418, 25811102}3259

Appendix C.2. Error Detection. Computation Stage

According to Equation (7),
F ( X ) = | i = 1 6 k i * x i | 2 25 = | 20132660 0 + 19173962 3 + 20971520 7 + 29826162 6 + + 18302418 1 + 25811102 2 | 33554432 = 16996504 ( 10 ) = = 1000000110101100010011000 ( 2 ) .
F ( X ) = 16996504 3259 = F ( M K ) .
Since F ( X )     F ( M K ) , the number X contains an error.

Appendix C.3. Error Localization and Correction. Pre-Computation Stage

To correct errors, we use the modified modular projection method with MLD. The projections are constructed according to the algorithm [29]:
X 1 , 2 = ( x 1 ,   x 2 ,   x 3 ,   x 4 ,   x 5 ,   x 6 ) ,
X 3 , 4 = ( x 1 ,   x 2 ,   x 3 ,   x 4 ,   x 5 ,   x 6 ) ,
X 5 , 6 = ( x 1 ,   x 2 ,   x 3 ,   x 4 ,   x 5 ,   x 6 ) .
We calculate constants for each modular projection, saving them in memory (Table A5). In the memory of the computing device, the constants are stored in the binary representation. In this example, we use the decimal representation for clarity.
The modular projection X 1 , 2 :   { m i } = { m 1 ,   m 2 } = { 5 ,   7 } ,
M K = 5 · 7 = 35 ( 10 ) = 100011 ( 2 ) ,
N = log 2 ( M K i = 1 2 ( m i 1 ) ) = log 2 ( 35 ( 4 + 6 ) ) = 9 .
The weighted characteristic of the dynamic range M K for the projection is obtained by Equation (6):
F ( 35 ) = 35 M K 2 N = 35 35 2 9 = 512 ( 10 ) = 1000000000 ( 2 ) .
The constants for Equation (18) are
| M K | m 3 = | 35 | 8 = 5 ( 10 ) = 101 ( 2 ) ,   | M K | m 4 = | 35 | 9 = 1 ( 10 ) = 1 ( 2 ) ,
| M K | m 5 = | 35 | 11 = 9 ( 10 ) = 1001 ( 2 ) ,   | M K | m 6 = | 35 | 13 = 4 ( 10 ) = 100 ( 2 ) .
According to Equation (15),
B 1 = M K m 1 | m 1 M K | m 1 = 35 5 | 5 35 | 5 = 7 3 = 21 ,
B 2 = M K m 2 | m 2 M K | m 2 = 35 7 | 7 35 | 7 = 5 3 = 15 .
The constants for Equation (17) are
| B 1 | m 3 = | 21 | 8 = 5 ( 10 ) = 101 ( 2 ) ,   | B 2 | m 3 = | 15 | 8 = 7 ( 10 ) = 111 ( 2 ) ,
| B 1 | m 4 = | 21 | 9 = 3 ( 10 ) = 11 ( 2 ) ,   | B 2 | m 4 = | 15 | 9 = 6 ( 10 ) = 110 ( 2 ) ,
| B 1 | m 5 = | 21 | 11 = 10 ( 10 ) = 1010 ( 2 ) ,   | B 2 | m 5 = | 15 | 11 = 4 ( 10 ) = 100 ( 2 ) ,
| B 1 | m 6 = | 21 | 13 = 8 ( 10 ) = 1000 ( 2 ) ,   | B 2 | m 6 = | 15 | 13 = 2 ( 10 ) = 10 ( 2 ) .
According to (12),
k 1 * = | m 1 / M K | m 1 m 1 2 N = | 5 / 35 | 5 5 2 9 = 3 5 2 9 = 308 ( 10 ) = 100110100 ( 2 ) ,
k 2 * = | m 2 / M K | m 2 m 2 2 N = | 7 / 35 | 7 7 2 9 = 3 7 2 9 = 220 ( 10 ) = 11011100 ( 2 ) .
The modular projection X 3 , 4 :   { m i } = { m 3 ,   m 4 } = { 8 ,   9 } ,
M K = 8 · 9 = 72 ,
N = log 2 ( M K i = 1 2 ( m i 1 ) ) = log 2 ( 35 ( 7 + 8 ) ) = 11 .
The weighted characteristic of the dynamic range M K for the projection is obtained by Equation (6):
F ( 35 ) = 35 M K 2 N = 35 72 2 11 = 996 ( 10 ) = 1111100100 ( 2 ) .
The constants for Equation (18) are
| M K | m 1 = | 72 | 5 = 3 ( 10 ) = 11 ( 2 ) ,   | M K | m 2 = | 72 | 7 = 5 ( 10 ) = 101 ( 2 ) ,
| M K | m 5 = | 72 | 11 = 5 ( 10 ) = 101 ( 2 ) ,   | M K | m 6 = | 72 | 13 = 6 ( 10 ) = 110 ( 2 ) .
According to Equation (15),
B 3 = M K m 3 | m 3 M K | m 3 = 72 8 | 8 72 | 8 = 9 1 = 9 ,
B 4 = M K m 4 | m 4 M K | m 4 = 72 9 | 9 72 | 9 = 8 8 = 64 .
The constants for Equation (17) are
| B 3 | m 1 = | 9 | 5 = 4 ( 10 ) = 100 ( 2 ) ,   | B 4 | m 1 = | 64 | 5 = 4 ( 10 ) = 100 ( 2 ) ,
| B 3 | m 2 = | 9 | 7 = 2 ( 10 ) = 10 ( 2 ) ,   | B 4 | m 2 = | 64 | 7 = 1 ( 10 ) = 1 ( 2 ) ,
| B 3 | m 5 = | 9 | 11 = 9 ( 10 ) = 1001 ( 2 ) ,   | B 4 | m 5 = | 64 | 11 = 9 ( 10 ) = 1001 ( 2 ) ,
| B 3 | m 6 = | 9 | 13 = 9 ( 10 ) = 1001 ( 2 ) ,   | B 4 | m 6 = | 64 | 13 = 12 ( 10 ) = 1100 ( 2 ) .
According to (12),
k 3 * = | m 3 / M K | m 3 m 3 2 N = | 8 / 72 | 8 8 2 11 = 1 8 2 11 = 256 ( 10 ) = 100000000 ( 2 ) ,
k 4 * = | m 4 / M K | m 4 m 4 2 N = | 9 / 72 | 9 9 2 11 = 8 9 2 11 = 1821 ( 10 ) = 11100011101 ( 2 ) .
The modular projection X 5 , 6 :   { m i } = { m 5 ,   m 6 } = { 11 ,   13 } ,
M K = 11 · 13 = 143 ,
N = log 2 ( M K i = 1 2 ( m i 1 ) ) = log 2 ( 35 ( 10 + 12 ) ) = 12 .
The weighted characteristic of the dynamic range M K for the projection is obtained by Equation (6):
F ( 35 ) = 35 M K 2 N = 35 143 2 12 = 1003 ( 10 ) = 1111101011 ( 2 ) .
The constants for Equation (18) are
| M K | m 1 = | 143 | 5 = 2 ( 10 ) = 10 ( 2 ) ,   | M K | m 2 = | 143 | 7 = 4 ( 10 ) = 100 ( 2 ) ,
| M K | m 3 = | 143 | 8 = 1 ( 10 ) = 1 ( 2 ) ,   | M K | m 4 = | 143 | 9 = 1 ( 10 ) = 1 ( 2 ) .
According to Equation (15),
B 5 = M K m 5 | m 5 M K | m 5 = 143 11 | 11 143 | 11 = 13 6 = 78 ,
B 6 = M K m 6 | m 6 M K | m 6 = 143 13 | 13 143 | 13 = 11 6 = 66 .
The constants for Equation (17) are
| B 5 | m 1 = | 78 | 5 = 3 ( 10 ) = 11 ( 2 ) ,   | B 6 | m 1 = | 66 | 5 = 1 ( 10 ) = 1 ( 2 ) ,
| B 5 | m 2 = | 78 | 7 = 1 ( 10 ) = 1 ( 2 ) ,   | B 6 | m 2 = | 66 | 7 = 3 ( 10 ) = 11 ( 2 ) ,
| B 5 | m 3 = | 78 | 8 = 6 ( 10 ) = 110 ( 2 ) ,   | B 6 | m 3 = | 66 | 8 = 2 ( 10 ) = 10 ( 2 ) ,
| B 5 | m 4 = | 78 | 9 = 6 ( 10 ) = 110 ( 2 ) ,   | B 6 | m 4 = | 66 | 9 = 3 ( 10 ) = 11 ( 2 ) .
According to (12),
k 5 * = | m 5 / M K | m 5 m 5 2 N = | 11 / 143 | 11 11 2 12 = 6 11 2 12 = 2235 ( 10 ) = 100010111011 ( 2 ) ,
k 6 * = | m 6 / M K | m 6 m 6 2 N = | 13 / 143 | 13 13 2 12 = 6 13 2 11 = 1891 ( 10 ) = 11101100011 ( 2 )

Appendix C.4. Error Localization and Correction. Computation Stage

Step 1. We calculate the extended weighted characteristic for each modular projection (Equation (12)) using the pre-computed constants from Table A5. The positional characteristic and rank of each modular projection are given by Equations (13) and (14), respectively.
Table A5. Pre-computed constants for each modular projection.
Table A5. Pre-computed constants for each modular projection.
Modular Projection
X 1 , 2 = { 0 ,   3 } X 3 , 4 = { 7 ,   6 } X 5 , 6 = { 1 ,   2 }
1Number i = 1 , ,   2
j = 3 , ,   6
i = 3 ,   4
j = 1 ,   2 ,   5 ,   6
i = 5 ,   6 ,
j = 1 , ,   4
2 { m i } { 5 ,   7 } { 8 ,   9 } { 11 ,   13 }
3 N 9 11 12
4 M K 35 72 143
5 F ( M K ) ,   ( M K = 35 ) 512 996 1003
6 { k i * } { 308 ,   220 } { 256 ,   1821 } { 2235 ,   1891 }
7 [ { | B i | m j }] [ { 5 ,   7 } ,   { 3 ,   6 } ,   { 10 ,   4 } ,   { 8 ,   2 } ] [ { 4 ,   4 } ,   { 2 ,   1 } ,   { 9 ,   9 } ,   { 9 ,   12 } ] [ { 3 ,   1 } ,   { 1 ,   3 } ,   { 6 ,   2 } , { 6 ,   3 } ]
8 { | M K | m j } { 5 ,   1 ,   9 ,   4 } { 3 ,   5 ,   5 ,   6 } { 2 ,   4 ,   1 ,   1 }
The modular projection X 1 , 2 :
F ( X 1 , 2 ) = 308 0 + 220 3 = 660 ( 10 ) = 1010010100 ( 2 ) ,
F ( X 1 , 2 ) = F ( X 1 , 2 ) [ N 1..0 ] = 1010010100 [ 8..0 ] = 010010100 ( 2 ) = 148 ( 10 ) ,
r X 1 , 2 = F ( X 1 , 2 ) [ L e n g t h ( F ( X 1 , 2 ) ) 1 . . N ] = 1010010100 [ 9 . . 9 ] = 1 ( 2 ) = 1 ( 10 ) .
The modular projection X 3 , 4 :
F ( X 3 , 4 ) = 256 7 + 1821 6 = 12718 ( 10 ) = 11000110101110 ( 2 ) ,
F ( X 3 , 4 ) = F ( X 3 , 4 ) [ N 1..0 ] = 11000110101110 [ 10..0 ] = 00110101110 ( 2 ) = 430 ( 10 ) ,
r X 3 , 4 = F ( X 3 , 4 ) [ L e n g t h ( F ( X 3 , 4 ) ) 1 . . N ] = 11000110101110 [ 13..11 ] = 110 ( 2 ) = 6 ( 10 )
The modular projection X 5 , 6 :
F ( X 5 , 6 ) = 2235 1 + 1891 2 = 6017 ( 10 ) = 1011110000001 ( 2 ) ,
F ( X 5 , 6 ) = F ( X 5 , 6 ) [ N 1..0 ] = 1011110000001 [ 11..0 ] = 011110000001 ( 2 ) = 1921 ( 10 ) ,
r X 5 , 6 = F ( X 5 , 6 ) [ L e n g t h ( F ( X 5 , 6 ) ) 1 . . N ] = 1011110000001 [ 12..12 ] = 1 ( 2 ) = 1 ( 10 ) .
Step 2. We calculate the second terms for finding the missing remainders for each modular projection (Equation (18)) using the constants from Table A5.
The modular projection X 1 , 2 :
X 1 , 2 m 3 ( 2 ) = | 1 5 | 8 = 5 ( 10 ) = 101 ( 2 ) ,   X 1 , 2 m 4 ( 2 ) = | 1 1 | 9 = 1 ( 10 ) = 1 ( 2 ) ,
X 1 , 2 m 5 ( 2 ) = | 1 9 | 11 = 9 ( 10 ) = 1001 ( 2 ) ,   X 1 , 2 m 6 ( 2 ) = | 1 4 | 13 = 4 ( 10 ) = 100 ( 2 ) .
The modular projection X 3 , 4 :
X 3 , 4 m 1 ( 2 ) = | 6 3 | 5 = 3 ( 10 ) = 11 ( 2 ) ,   X 3 , 4 m 2 ( 2 ) = | 6 5 | 7 = 2 ( 10 ) = 10 ( 2 ) ,
X 3 , 4 m 5 ( 2 ) = | 6 5 | 11 = 8 ( 10 ) = 1000 ( 2 ) ,   X 3 , 4 m 6 ( 2 ) = | 6 6 | 13 = 10 ( 10 ) = 1010 ( 2 ) .
The modular projection X 5 , 6 :
X 5 , 6 m 1 ( 2 ) = | 1 2 | 5 = 2 ( 10 ) = 10 ( 2 ) ,   X 5 , 6 m 2 ( 2 ) = | 1 4 | 7 = 4 ( 10 ) = 100 ( 2 ) ,
X 5 , 6 m 3 ( 2 ) = | 1 1 | 8 = 1 ( 10 ) = 1 ( 2 ) ,   X 5 , 6 m 4 ( 2 ) = | 1 1 | 9 = 1 ( 10 ) = 1 ( 2 ) .
We obtain the weighted representations of modular projections (Equation (6)) in parallel with calculating the second terms. Note that in Equation (6), division by 2 N , followed by rounding down, is implemented by simply discarding the last N digits in the binary representation.
The modular projection X 1 , 2 :
X 1 , 2 = F ( X 1 , 2 ) M K 2 N = 148 35 2 9 = 10 .
The modular projection X 3 , 4 :
X 3 , 4 = F ( X 3 , 4 ) M K 2 N = 430 72 2 11 = 15 .
The modular projection X 5 , 6 :
X 5 , 6 = F ( X 5 , 6 ) M K 2 N = 1921 143 2 12 = 67 .
Steps (1–2). We calculate the first terms for finding the missing remainders for each modular projection (Equation (17)) using the constants from Table A5. This is done in parallel with Steps 1–2.
The modular projection X 1 , 2 :
X 1 , 2 m 3 ( 1 ) = | 5 0 + 7 3 | 8 = 5 ( 10 ) = 101 ( 2 ) ,   X 1 , 2 m 4 ( 1 ) = | 3 0 + 6 3 | 9 = 0 ( 10 ) = 0 ( 2 ) ,
X 1 , 2 m 5 ( 1 ) = | 10 0 + 4 3 | 11 = 1 ( 10 ) = 1 ( 2 ) ,   X 1 , 2 m 6 ( 1 ) = | 8 0 + 2 3 | 13 = 6 ( 10 ) = 110 ( 2 ) .
The modular projection X 3 , 4 :
X 3 , 4 m 1 ( 1 ) = | 4 7 + 4 6 | 5 = 2 ( 10 ) = 10 ( 2 ) ,   X 3 , 4 m 2 ( 1 ) = | 2 7 + 1 6 | 7 = 6 ( 10 ) = 110 ( 2 ) ,
X 3 , 4 m 5 ( 1 ) = | 9 7 + 9 6 | 11 = 7 ( 10 ) = 111 ( 2 ) ,   X 3 , 4 m 6 ( 1 ) = | 9 7 + 12 6 | 13 = 5 ( 10 ) = 101 ( 2 ) .
The modular projection X 5 , 6 :
X 5 , 6 m 1 ( 1 ) = | 3 1 + 1 2 | 5 = 0 ( 10 ) = 0 ( 2 ) ,   X 5 , 6 m 2 ( 1 ) = | 1 1 + 3 2 | 7 = 0 ( 10 ) = 0 ( 2 ) ,
X 5 , 6 m 3 ( 1 ) = | 6 1 + 2 2 | 8 = 2 ( 10 ) = 10 ( 2 ) ,   X 5 , 6 m 4 ( 1 ) = | 6 1 + 3 2 | 9 = 3 ( 10 ) = 11 ( 2 ) .
Step 3. We calculate the missing remainders for each modular projection (Equation (19)).
The modular projection X 1 , 2 :
| X 1 , 2 | m 3 = | 5 + 5 | 8 = 2 ( 10 ) = 10 ( 2 ) ,   | X 1 , 2 | m 4 = | 0 + 1 | 9 = 1 ( 10 ) = 1 ( 2 ) ,
| X 1 , 2 | m 5 = | 1 + 9 | 11 = 10 ( 10 ) = 1010 ( 2 ) ,   | X 1 , 2 | m 6 = | 6 + 4 | 13 = 10 ( 10 ) = 1010 ( 2 ) .
The modular projection X 3 , 4 :
| X 3 , 4 | m 1 = | 2 + 3 | 5 = 0 ( 10 ) = 0 ( 2 ) ,   | X 3 , 4 | m 2 = | 6 + 2 | 7 = 1 ( 10 ) = 1 ( 2 ) ,
| X 3 , 4 | m 5 = | 7 + 8 | 11 = 4 ( 10 ) = 100 ( 2 ) ,   | X 3 , 4 | m 6 = | 5 + 10 | 13 = 2 ( 10 ) = 10 ( 2 ) .
The modular projection X 5 , 6 :
| X 5 , 6 | m 1 = | 0 + 2 | 5 = 2 ( 10 ) = 10 ( 2 ) ,   | X 5 , 6 | m 2 = | 0 + 4 | 7 = 4 ( 10 ) = 100 ( 2 ) ,
| X 5 , 6 | m 3 = | 2 + 1 | 8 = 3 ( 10 ) = 11 ( 2 ) ,   | X 5 , 6 | m 4 = | 3 + 1 | 9 = 4 ( 10 ) = 100 ( 2 ) .
Step 4. We calculate the Hamming distances between each modular projection in the RRNS and the distorted number (Equation (8)):
h ( X , X 1 , 2 ) = h ( ( 0 , 3 , 7 , 6 , 1 , 2 ) ( 0 , 3 , 2 , 1 , 10 , 10 ) ) = 4 ,
h ( X , X 3 , 4 ) = h ( ( 0 , 3 , 7 , 6 , 1 , 2 ) ( 0 , 1 , 7 , 6 , 4 , 2 ) ) = 2 ,
h ( X , X 5 , 6 ) = h ( ( 0 , 3 , 7 , 6 , 1 , 2 ) ( 2 , 4 , 3 , 4 , 1 , 2 ) ) = 4 .
Step 5. We choose a correct projection (See, Table A6).
Table A6. Computed modular projections and their characteristics.
Table A6. Computed modular projections and their characteristics.
Modular Projection
X 1 , 2 = 10 X 3 , 4 = 15 X 5 , 6 = 67
1 F ( X i ) 1484301921
2 F ( M K ) ,   ( M K = 35 )5129961003
3 ( x i ) (0,3,2,1,10,10)(0,1,7,6,4,2)(2,4,3,4,1,2)
4 ( x ) (0,3,7,6,1,2)(0,3,7,6,1,2)(0,3,7,6,1,2)
5 h ( X ,   X i ) 424
6 F ( X i ) < F ( M K ) , ( M K = 35 ) YesYesNo
7 h ( X ,   X i )     t ,   ( t = 2 ) NoYesNo
Both correctness conditions (9) are satisfied for the modular projection X 3 , 4 only. Therefore, the corrected number is X = X 3 , 4 = 15 = ( 0 ,   1 ,   7 ,   6 ,   4 ,   2 ) , and the proposed error correction method works properly.
End of example.

Appendix D

Original Modular Projection Method with MLD

Block X X′. When an error is detected, this block receives at the input n remainders representing the distorted number X in the ( n ,   k ) -RRNS.
Block X i X′. This block constructs modular projections. It is implemented in C n / 2 t parallel computational threads, where t = ( n k ) / 2 . Each thread corresponds to a modular projection and receives at the input k remainders of the distorted number X (the outputs of the block X ) obtained by the modular projection algorithm [29].
Block CRT: X i . This block calculates the modular projections X i in the WNS. According to the CRT, it is implemented by k parallel multiplications of the remainders (the outputs of the block X i ) by constants modulo M and a k -operand modulo adder [31].
Block | X i | m j . This block calculates the missing remainders for each modular projection X i . It is implemented by ( n     k ) parallel computations of the remainders of the division of the number X i (the output of the block CTR: X i ) by the missing moduli [30].
Block h ( X ,   X i )   . This block calculates Hamming distances between the distorted number X and each modular projection X i . It is implemented by ( n     k ) parallel comparisons of the corresponding remainders of the distorted number X (the outputs of the block X ) and the modular projection X i (the outputs of the block | X i | m j ). Subsequently, the mismatches are counted by an n -operand adder.
Block X (9). This block chooses a correct modular projection. It is implemented by the conjunction of two comparisons: the modular projection X i in the WNS (the output of the block CRT: X i ) is smaller than the dynamic range M K , and the Hamming distance (the output of the block h ( X ,   X i ) ) is not greater than the maximum multiplicity t of errors corrected by the ( n ,   k ) -RRNS. The results for each thread (conjunctions for different modular projections) are glued together into a C n / 2 t -bit number, and the number of the first nonzero bit corresponds to the correct modular projection.
Block X . This block outputs the correct number X in the WNS. It is implemented by a C n / 2 t -input multiplexer with one control input. The common inputs are the modular projections X i in the WNS (the outputs of the block CRT: X i ). The control input is the number of the correct modular projection (the output of the block X (9)).

Appendix E

Table A7. Hardware and time costs for correcting single errors and restoring numbers in WNS.
Table A7. Hardware and time costs for correcting single errors and restoring numbers in WNS.
Bit
Width
(2,4)-RRNSOriginal Modular Projection Method with MLD [19]Modified Modular Projection Method with MLD
LUTDelay, nsLUTDelay, ns
14{5, 7, 8, 9}459.012849.079
28{16, 17, 19, 21}10813.45916110.853
316{256, 257, 259, 261}32323.42848018.709
424{4096, 4097, 4099, 4101}60126.17399621.803
532{65536, 65537, 65539, 65541}99834.677152625.305
648{16777216, 16777217, 16777219, 16777221}193241.042269832.047
764{4294967296, 4294967297, 4294967299, 4294967301}330453.05460640.942
Table A8. Hardware and time costs for correcting double errors and restoring numbers in WNS.
Table A8. Hardware and time costs for correcting double errors and restoring numbers in WNS.
Bit Width(2,6)-RRNSOriginal Modular Projection Method with MLD [19]Modified Modular Projection Method with MLD
LUTDelay, nsLUTDelay, ns
14{5, 7, 8, 9, 11, 13}14510.96125110.751
28{16, 17, 19, 21, 23, 25}27714.96346412.467
316{256, 257, 259, 261, 263, 265}81125.261141421.744
424{4096, 4097, 4099,4101, 4103, 4105}161230.616315425.092
532{65536, 65537, 65539,65541, 65543, 65545}263339.965496030.23
648{16777216,16777217,16777219,16777221,
16777223, 16777225}
530948.673904837.962
764{4294967296, 4294967297, 4294967299, 4294967301, 4294967303, 4294967305}910258.2941470943.015

References

  1. Zaharia, M.; Chowdhury, M.; Franklin, M.J.; Shenker, S.; Stoica, I. Spark: Cluster computing with working sets. HotCloud 2010, 10, 95. [Google Scholar]
  2. Li, W.; Yang, Y.; Yuan, D. A Novel Cost-Effective Dynamic Data Replication Strategy for Reliability in Cloud Data Centres. In Proceedings of the 2011 IEEE Ninth International Conference on Dependable, Autonomic and Secure Computing, Sydney, NSW, Australia, 12–14 December 2011; pp. 496–502. [Google Scholar]
  3. Huang, C.; Simitci, H.; Xu, Y.; Ogus, A.; Calder, B.; Gopalan, P.; Li, J.; Yekhanin, S. Erasure coding in windows azure storage. In Proceedings of the 2012 USENIX Annual Technical Conference (USENIXATC 12), Boston, MA, USA, 13–15 June 2012; pp. 15–26. [Google Scholar]
  4. Sathiamoorthy, M.; Asteris, M.; Papailiopoulos, D.; Dimakis, A.G.; Vadali, R.; Chen, S.; Borthakur, D. XORing Elephants: Novel Erasure Codes for Big Data. arXiv 2013, arXiv:1301.3791. [Google Scholar] [CrossRef]
  5. Muralidhar, S.; Lloyd, W.; Roy, S.; Hill, C.; Lin, E.; Liu, W.; Pan, S.; Shankar, S.; Sivakumar, V.; Tang, L.; et al. f4: Facebook’s Warm BLOB Storage System. In Proceedings of the 11th USENIX Symposium on Operating Systems Design and Implementation (OSDI 14), Broomfield, CO, USA, 6–8 October 2014; pp. 383–398. [Google Scholar]
  6. Goh, V.T.; Tinauli, M.; Siddiqi, M.U. A novel error correction scheme based on the Chinese remainder theorem. In Proceedings of the Ninth International Conference on Communications Systems, ICCS 2004, Singapore, 7 September 2004; pp. 461–465. [Google Scholar]
  7. Ding, C.; Pei, D.; Salomaa, A. Chinese Remainder Theorem: Applications in Computing, Coding, Cryptography; World Scientific: Singapore, 1996; 213p. [Google Scholar]
  8. Wicker, S.B.; Bhargava, V.K. Reed-Solomon Codes and Their Applications; John Wiley & Sons: New York, NY, USA, 1999; 336p. [Google Scholar]
  9. Rabin, M.O. Efficient dispersal of information for security, load balancing, and fault tolerance. J. ACM 1989, 36, 335–348. [Google Scholar] [CrossRef]
  10. Kshemkalyani, A.D.; Singhal, M. Distributed Computing: Principles, Algorithms, and Systems; Cambridge University Press: Cambridge, UK, 2011; 756p. [Google Scholar]
  11. Tel, G. Introduction to Distributed Algorithms; Cambridge University Press: Cambridge, UK, 2000; 596p. [Google Scholar]
  12. Van Steen, M.; Tanenbaum, A. Distributed systems principles and paradigms. Network 2002, 2, 28. [Google Scholar]
  13. Gentry, C.; Halevi, S.; Smart, N.P. Fully Homomorphic Encryption with Polylog Overhead. In Proceedings of the Annual International Conference on the Theory and Applications of Cryptographic Techniques, Cambridge, UK, 15–19 April 2012; pp. 465–482. [Google Scholar]
  14. Sun, J.-D.; Krishna, H. A coding theory approach to error control in redundant residue number systems. II. Multiple error detection and correction. IEEE Trans. Circuits Syst. II Analog Digit. Signal Process. 1992, 39, 18–34. [Google Scholar] [CrossRef]
  15. Tay, T.F.; Chang, C.-H. A new algorithm for single residue digit error correction in Redundant Residue Number System. In Proceedings of the 2014 IEEE International Symposium on Circuits and Systems (ISCAS), Melbourne, Australia, 1–5 June 2014; pp. 1748–1751. [Google Scholar]
  16. Yau, S.S.-S.; Li, Y.-C. Error Correction in Redundant Residue Number Systems. IEEE Trans. Comput. 1973, 100, 5–11. [Google Scholar] [CrossRef]
  17. Barsi, F.; Maestrini, P. Error Correcting Properties of Redundant Residue Number Systems. IEEE Trans. Comput. 1973, 100, 307–315. [Google Scholar] [CrossRef]
  18. Chervyakov, N.I.; Lyakhov, P.A.; Babenko, M.G.; Lavrinenko, I.N.; Lavrinenko, A.V.; Nazarov, A.S. The architecture of a fault-tolerant modular neurocomputer based on modular number projections. Neurocomputing 2018, 272, 96–107. [Google Scholar] [CrossRef]
  19. Goh, V.T.; Siddiqi, M.U. Multiple error detection and correction based on redundant residue number systems. IEEE Trans. Commun. 2008, 56, 325–330. [Google Scholar] [CrossRef]
  20. Chervyakov, N.I.; Molahosseini, A.S.; Lyakhov, P.A.; Babenko, M.G.; Deryabin, M.A. Residue-to-binary conversion for general moduli sets based on approximate Chinese remainder theorem. Int. J. Comput. Math. 2017, 94, 1833–1849. [Google Scholar] [CrossRef]
  21. Soderstrand, M.; Vernia, C.; Chang, J.-H. An improved residue number system digital-to-analog converter. IEEE Trans. Circuits Syst. 1983, 30, 903–907. [Google Scholar] [CrossRef]
  22. Van Vu, T. Efficient Implementations of the Chinese Remainder Theorem for Sign Detection and Residue Decoding. IEEE Trans. Comput. 1985, 100, 646–651. [Google Scholar] [CrossRef]
  23. Tang, Y.; Boutillon, E.; Jego, C.; Jezequel, M. A new single-error correction scheme based on self-diagnosis residue number arithmetic. In Proceedings of the 2010 Conference on Design and Architectures for Signal and Image Processing (DASIP), Edinburgh, UK, 26–28 October 2010; pp. 27–33. [Google Scholar]
  24. Tchernykh, A.; Babenko, M.; Chervyakov, N.; Miranda-Lopez, V.; Avetisyan, A.; Drozdov, A.Y.; Rivera-Rodriguez, R.; Radchenko, G.; Du, Z. Scalable Data Storage Design for Nonstationary IoT Environment with Adaptive Security and Reliability. IEEE Internet Things J. 2020, 7, 10171–10188. [Google Scholar] [CrossRef]
  25. Yin, P.; Li, L. A new algorithm for single error correction in RRNS. In Proceedings of the 2013 International Conference on Communications, Circuits and Systems (ICCCAS), Chengdu, China, 15–17 November 2013; pp. 178–181. [Google Scholar]
  26. Goldreich, O.; Ron, D.; Sudan, M. Chinese remaindering with errors. In Proceedings of the Thirty-First Annual ACM Symposium on Theory of Computing, Atlanta, Georgia, 1–4 May 1999; pp. 225–234. [Google Scholar]
  27. Mandelbaum, D. On a class of arithmetic codes and a decoding algorithm (Corresp.). IEEE Trans. Inf. Theory 1976, 22, 85–88. [Google Scholar] [CrossRef]
  28. Jenkins, W.K.; Altman, E.J. Self-checking properties of residue number error checkers based on mixed radix conversion. IEEE Trans. Circuits Syst. 1988, 35, 159–167. [Google Scholar] [CrossRef]
  29. Nazarov, A.; Babenko, M.; Tchernykh, A.; Pulido-Gaytand, B.; Cortés-Mendozad, J.M.; Vashchenko, I. Algorithm for constructing modular projections for correcting multiple errors based on a redundant residue number system using maximum likelihood decoding. Program. Comput. Softw. 2021, 47, 839–848. [Google Scholar] [CrossRef]
  30. Nazarov, A.; Babenko, M.; Golimblevskaia, E. Efficient Hardware Implementation of forward Conversion WNS-RNS on FPGA. In Proceedings of the 2020 International Conference Engineering and Telecommunication (En & T), Dolgoprudny, Russia, 25–26 November 2020; pp. 1–4. [Google Scholar] [CrossRef]
  31. Nazarov, A.; Babenko, M.; Golimblevskaia, E. Hardware Implementation of the Reverse Conversion RNS-WNS on FPGA. In Proceedings of the 2020 International Conference Engineering and Telecommunication (En & T), Dolgoprudny, Russia, 25–26 November 2020; pp. 1–5. [Google Scholar] [CrossRef]
  32. Ananda Mohan, P.V. Residue Number Systems: Theory and Applications; Birghauser Math: Basel, Switzerland, 2016. [Google Scholar] [CrossRef]
  33. Omondi, A.R.; Premkumar, A.B. Residue Number Systems: Theory and Implementation; World Scientific: Singapore, 2007. [Google Scholar]
  34. Menezes, A.J.; Van Oorschot, P.C.; Vanstone, S.A. Handbook of Applied Cryptography; CRC Press: Boca Raton, FL, USA, 2018. [Google Scholar]
  35. Nazarov, A.; Chervyakov, N.; Tchernykh, A.; Babenko, M. Reliability improvement of information systems by residue number system code. Int. J. Comb. Optim. Probl. Inform. 2018, 9, 81. [Google Scholar]
Figure 1. Modular projection methods with MLD: (a) original, (b) modified.
Figure 1. Modular projection methods with MLD: (a) original, (b) modified.
Applsci 12 00463 g001aApplsci 12 00463 g001b
Figure 2. Scheme of parallelizing modular projection methods with MLD: (a) original, (b) modified.
Figure 2. Scheme of parallelizing modular projection methods with MLD: (a) original, (b) modified.
Applsci 12 00463 g002
Figure 3. Time to correct errors and restore numbers in WNS: (a) single error, (b) double error.
Figure 3. Time to correct errors and restore numbers in WNS: (a) single error, (b) double error.
Applsci 12 00463 g003
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Share and Cite

MDPI and ACS Style

Babenko, M.; Nazarov, A.; Deryabin, M.; Kucherov, N.; Tchernykh, A.; Hung, N.V.; Avetisyan, A.; Toporkov, V. Multiple Error Correction in Redundant Residue Number Systems: A Modified Modular Projection Method with Maximum Likelihood Decoding. Appl. Sci. 2022, 12, 463. https://doi.org/10.3390/app12010463

AMA Style

Babenko M, Nazarov A, Deryabin M, Kucherov N, Tchernykh A, Hung NV, Avetisyan A, Toporkov V. Multiple Error Correction in Redundant Residue Number Systems: A Modified Modular Projection Method with Maximum Likelihood Decoding. Applied Sciences. 2022; 12(1):463. https://doi.org/10.3390/app12010463

Chicago/Turabian Style

Babenko, Mikhail, Anton Nazarov, Maxim Deryabin, Nikolay Kucherov, Andrei Tchernykh, Nguyen Viet Hung, Arutyun Avetisyan, and Victor Toporkov. 2022. "Multiple Error Correction in Redundant Residue Number Systems: A Modified Modular Projection Method with Maximum Likelihood Decoding" Applied Sciences 12, no. 1: 463. https://doi.org/10.3390/app12010463

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop