On Theory and Fast Algorithms for Error Correction in Residue Number System Product Codes

14
840 IEEE TRANSACTIONS ON COMPUTERS, VOL. 42, NO. 7, JULY 1993 On Theory and Fast Algorithms for Error Correction in Residue Number System Product Codes Hari Krishna, Member, IEEE and Jenn-Dong Sun Abstract-In this paper, we develop a coding theory approach to error control in residue number system product codes. Based on this coding theory framework, new computationally efficient algorithmsare derived for correcting single errors, double errors, multiple errors, and simultaneouslydetecting multiple errors and additive overllow. These algorithms reduce the computational complexity of previously known algorithms by at least an order of magnitude. In addition, it is worthwhile to mention here that all the literature published thus far deals almost exclusively with single error correction. Index Terms-Algorithms, coding theory, mixed radix conver- sion, multiple errors detection and correction, product codes, redundant residue number systems, residue number systems. I. INTRODUCTION HERE HAS BEEN much investigation in the technical T literature concerning the use of redundant residue number systems (RRNS) for error correction in residue number sys- tems (RNS) [1]-[lo]. An (n,k) RRNS code is a systematic code [3], [ 141 in which a code vector is divided into two parts, the information part and the parity part. The information part consists of k residue digits and the parity part consists of n - k redundant checking digits, which are the residue digits derived from the information residue digits [1]-[lo]. In 1972, Mandelbaum [lo] introduced the residue number system product code (RNS-PC) which is a nonsystematic code. Using the concept of modulus projections, Barsi and Maestrini [ 111 proposed a systematic approach to error detection and correction in RNS-PC, and derived the necessary and sufficient conditions for single residue digit error correction. Later, based on the convergents of continued fractions, Barsi and Maestrini [6] derived a procedure for multiple-error correction in RNS-PC. Jenkins [12] used an RNS-PC in the design of self-checking digit filters. Recently, Krishna et al. [14] developed a coding theory approach to error control in RRNS. The concepts of Hamming weight, minimum distance, weight distribution, maximum- distance-separable RRNS (MDS-RRNS), and error detection and correction capabilities in RRNS were introduced and a computationally efficient procedure was described for correct- Manuscript received September 15, 1991; revised March 27, 1992. The work of J. -D. Sun was supported by a fellowship from the Institute of Science and Technology, Taiwan, Republic of China. H. Krishna is with the Department of Electrical and Computer Engineering, Syracuse University, Syracuse, NY 13244. J. D. Sun was with the Department of Electrical and Computer Engineering, Syracuse University, Syracuse, NY 13244. He is now with the Chung-Shan Institute of Science and Technology, Taoyuan, Taiwan, Republic of China. IEEE Log Number 9208760. ing single residue errors. Later, the extension of the procedures for correcting and detecting multiple residue errors was given in [15]. In this paper, we develop a coding theory approach to error control in RNS-PC, and derive new computationally efficient algorithms for simultaneously correcting multiple errors and detecting multiple errors and additive overflow. The computational complexity of the new procedure for single residue error correction is O( n2) while the computational complexity of previously known algorithms [ll], [12] is O(n3), n being the number of moduli in the RNS-PC. It is further found that the computational complexity of the new procedure for correcting double residue errors is still O(n2) while the computational complexity of the procedure derived by extending the previously known algorithm [ll], [12] is This paper consists of seven sections. In Section 11, we cover the definitions and a coding theory framework for the RNS- PC. In Section 111, we derive a procedure for simultaneous multiple errors detection and additive overflow detection. Three computationally efficient procedures, 1) for correcting single residue errors and detecting additive overflow, 2) for simultaneously correcting single error and detecting multi- ple errors and additive overflow, and 3) for simultaneously correcting double errors and detecting multiple errors and additive overflow are described in Sections IV, V, and VI, respectively. In Section VI, we also describe an extension of the previous algorithms [ll], [12] for correcting double errors and detecting multiple errors and additive overflow. Finally, we discuss and compare the various results in Section VII. It is worthwhile to mention here that so far almost all the technical literature deals with the problem of single error correction in 0(~4). RNS-PC. 11. DEFINITIONS AND A CODING THEORY FWEWORK FOR RESIDUE NUMBER SYSTEM PRODUCT CODE An RNS I1 is defined by a set of n relatively prime positive integers ml, m2, . . . , m,. Let the product II:==, mi be denoted by M. A positive integer X in the range [0, M) can be uniquely represented by the n-tuple, X t-) z,z = [z~,Ic~,. . ,zn], of its residues modulo ma (xi X( mod mi)). According to the Chinese remainder theorem (CRT), for any given n-tuple [z1,x2, ... ,$,I, where 0 5 xi < mi, there exists one and only one integer X such that 0 5 X < M and zi X(modmi). The numerical value of 0018-9340/93$03.00 0 1993 IEEE

Transcript of On Theory and Fast Algorithms for Error Correction in Residue Number System Product Codes

840 IEEE TRANSACTIONS ON COMPUTERS, VOL. 42, NO. 7, JULY 1993

On Theory and Fast Algorithms for Error Correction in Residue Number System Product Codes

Hari Krishna, Member, IEEE and Jenn-Dong Sun

Abstract-In this paper, we develop a coding theory approach to error control in residue number system product codes. Based on this coding theory framework, new computationally efficient algorithms are derived for correcting single errors, double errors, multiple errors, and simultaneously detecting multiple errors and additive overllow. These algorithms reduce the computational complexity of previously known algorithms by at least an order of magnitude. In addition, it is worthwhile to mention here that all the literature published thus far deals almost exclusively with single error correction.

Index Terms-Algorithms, coding theory, mixed radix conver- sion, multiple errors detection and correction, product codes, redundant residue number systems, residue number systems.

I. INTRODUCTION HERE HAS BEEN much investigation in the technical T literature concerning the use of redundant residue number

systems (RRNS) for error correction in residue number sys- tems (RNS) [1]-[lo]. An ( n , k ) RRNS code is a systematic code [3], [ 141 in which a code vector is divided into two parts, the information part and the parity part. The information part consists of k residue digits and the parity part consists of n - k redundant checking digits, which are the residue digits derived from the information residue digits [1]-[lo].

In 1972, Mandelbaum [lo] introduced the residue number system product code (RNS-PC) which is a nonsystematic code. Using the concept of modulus projections, Barsi and Maestrini [ 111 proposed a systematic approach to error detection and correction in RNS-PC, and derived the necessary and sufficient conditions for single residue digit error correction. Later, based on the convergents of continued fractions, Barsi and Maestrini [6] derived a procedure for multiple-error correction in RNS-PC. Jenkins [12] used an RNS-PC in the design of self-checking digit filters.

Recently, Krishna et al. [14] developed a coding theory approach to error control in RRNS. The concepts of Hamming weight, minimum distance, weight distribution, maximum- distance-separable RRNS (MDS-RRNS), and error detection and correction capabilities in RRNS were introduced and a computationally efficient procedure was described for correct-

Manuscript received September 15, 1991; revised March 27, 1992. The work of J. -D. Sun was supported by a fellowship from the Institute of Science and Technology, Taiwan, Republic of China.

H. Krishna is with the Department of Electrical and Computer Engineering, Syracuse University, Syracuse, NY 13244.

J. D. Sun was with the Department of Electrical and Computer Engineering, Syracuse University, Syracuse, NY 13244. He is now with the Chung-Shan Institute of Science and Technology, Taoyuan, Taiwan, Republic of China.

IEEE Log Number 9208760.

ing single residue errors. Later, the extension of the procedures for correcting and detecting multiple residue errors was given in [15].

In this paper, we develop a coding theory approach to error control in RNS-PC, and derive new computationally efficient algorithms for simultaneously correcting multiple errors and detecting multiple errors and additive overflow. The computational complexity of the new procedure for single residue error correction is O( n2) while the computational complexity of previously known algorithms [l l] , [12] is O(n3) , n being the number of moduli in the RNS-PC. It is further found that the computational complexity of the new procedure for correcting double residue errors is still O(n2) while the computational complexity of the procedure derived by extending the previously known algorithm [ l l ] , [12] is

This paper consists of seven sections. In Section 11, we cover the definitions and a coding theory framework for the RNS- PC. In Section 111, we derive a procedure for simultaneous multiple errors detection and additive overflow detection. Three computationally efficient procedures, 1) for correcting single residue errors and detecting additive overflow, 2) for simultaneously correcting single error and detecting multi- ple errors and additive overflow, and 3) for simultaneously correcting double errors and detecting multiple errors and additive overflow are described in Sections IV, V, and VI, respectively. In Section VI, we also describe an extension of the previous algorithms [l l] , [12] for correcting double errors and detecting multiple errors and additive overflow. Finally, we discuss and compare the various results in Section VII. It is worthwhile to mention here that so far almost all the technical literature deals with the problem of single error correction in

0 ( ~ 4 ) .

RNS-PC.

11. DEFINITIONS AND A CODING THEORY FWEWORK FOR RESIDUE NUMBER SYSTEM PRODUCT CODE

An RNS I1 is defined by a set of n relatively prime positive integers ml, m2, . . . , m,. Let the product II:==, mi be denoted by M . A positive integer X in the range [0, M ) can be uniquely represented by the n-tuple, X t-)

z,z = [ z ~ , I c ~ , . . ,zn], of its residues modulo ma (xi X ( mod mi)). According to the Chinese remainder theorem (CRT), for any given n-tuple [z1,x2, . . . ,$,I, where 0 5 xi < mi, there exists one and only one integer X such that 0 5 X < M and zi X(modmi) . The numerical value of

0018-9340/93$03.00 0 1993 IEEE

KRISHNA AND S U N ON THEORY AND FAST ALGORITHMS FOR ERROR CORRECTION 841

X may be computed using n

X E x i T i M i (mod M ) (1) i=l

where

M M . - - 2 -

mi and the integers T, are computed a priori by solving the congruences

T,M, 1 (mod m%). (3)

For error control in RRNS [3], [14], a frequently used approach is to obtain the redundant residues from the nonredundant residues through the base extension (BEX) operation. The CRT, as described above, provides a method for the BEX operation. However, the CRT is not practical as it requires modular operations modulo a large valued integer M. In order to avoid processing large valued integers, the mixed radix conversion (MRC) approach is a useful method for the BEX operation. MRC is an operation to represent the interger X in the form X = a1 + a2m1 + u3m1m2 + . . . + al II;:: m, + . . . + u n l l ~ ~ ~ m t where 0 5 al < m2,Z = 1 , 2 , . . . , n . Let 11:=1 m, = 1; then the above equation can be written in a compact form as

n 2-1

x = C a l n m , . (4) z=1 2=1

An RNS-PC s2 is defined in an RNS I1 as follows. All the code-integers (legitimate numbers) X in RNS-PC must be of the form AX’,O 5 AX’ < M , where A is a given positive integer, called the code generator. In other words, an integer X,O 5 X < M , is a code-integer, if and only if X = O(modA). Associated with each code-integer X , is the vector of residues z = [ X I , 2 2 , . . . , 2,], which is termed as the corresponding codevector. A number L in the range [0, M ) , such that $ O(mod A ) is said to be an illegitimate number. It is clear that the integer X’ is in the range [0, R), where R = [ M / A ] + 1, where [MIA] denotes the integer part of M I A . Mandelbaum [lo] has shown that for a single error correcting RNS-PC, if gcd ( A , m,) = 1’ and A > max {m,} for i = 1 , 2 , . . . , n , the error detecting and correcting code of code generator A is optimum. Therefore, throughout this work A is always selected such that gcd ( A , m , ) = 1,i = 1,2, * . . , n.

In the following, we explore the mathematical structure of an RNS-PC using certain well-known algebraic results in coding theory [16], [17]. First, we define the RNS-PC as a semilinear code 0. All the integers having the form X = AX’ , 0 5 X < M , are valid, the corresponding residue vectors are said to constitute the code space. Every residue representation in the code space is a codevector. Strictly speaking, a Galois field defining the code does not exist. Also, the RNS-PC is not a linear code. For example, consider two code-integers X I = A X : and X2 = A X ; in RNS-PC, the

‘gcd (a . b) denotes the greatest common divisor of a and b.

- corresponding codevectors being z1 and 2 2 , respectively. Let X = X I + X2 and X = X ( m o d M ) . If M 5 x < 2M, then X = X I + X2 - M and X -M 8 O(modA), and therefore, the vector 2 1 + 2 2 is not a codevector. Clearly, this violates the definition of a linear code. Similarly, for a given scalar al , if M 5 a lX1 < A M , then the vector alzl is not a code vector. Since most results in coding theory are available for linear codes, we will circumvent this problem of nonlinearity in the RNS-PC by defining the term semilinearity (that is, linearity under additional conditions).

Definition I : A code is called semilinear if its codevectors satisfy the property of linearity under certain appropriately predefined conditions.

For an RNS-PC defined by the code generator A , given two code-integers X1 = A X ; and X2 = A X ; , where 0 5 X I , X2 < M , the corresponding codevectors being 51

and 2 2 , respectively, it is clear that for X = a l X 1 + ~ 2 x 2 ,

if 0 5 X < M , then alzl + a 2 2 2 is a codevector. Thus, an RNS-PC is a linear code under the condition that all the quantities X be in the range [0, M ) and X O(mod A ) ; or it is a semilinear code. We now present a coding theory based mathematical framework for an RNS-PC.

Definition 2: The Hamming weight of a codevector 5,

wt (z), in an RNS-PC is defined as the number of nonzero components of 5.

Definition 3: The Hamming distance between two codevec- tors zi and zj, d(zi, zj), is the number of places in which 2; and zj differ.

Definition 4: The minimum distance of the RNS-PC d is defined as

d = min{d(zi ,z j ) : zi,zj E 0,z; # zj}. (5)

An important result of the relation between d and Hamming weight of the RNS-PC is established in the following lemma.

Lemma I : For the semilinear RNS-PC, d, as defined in (5), is the same as the Hamming weight of the codevector in R having the smallest positive Hamming weight, that is

d = min {wt (z) : z E s2, z # 0) . (6)

Proof: By Definition 3

d ( z i , z j ) = wt (zi - zj); if X i > X j or

d ( q , zj) = wt (zj - zi) ; if X j > Xi . (7)

Without any loss of generality, let us assume that X i > X j . Therefore 0 < X = X i - X j = AX,! - A X ; = A(X,! - X i ) < M and z is a codevector in 0. In addition

5 = zi - zj. (8)

Combining (7) and (S), we get

d(z i ,z j ) = wt ( z ) , ~ # 0.

This proves the lemma. Before deriving the relationship between the minimum

distance and the error correction and detection capability, we

842 IEEE TRANSACTIONS ON COMPUTERS, VOL. 42, NO. 7, JULY 1993

derive the necessary and sufficient conditions of the moduli and code generator for an RNS-PC having minimum distance equal to d.

Theorem 1: The minimum distance of an RNS-PC is d if and only if the code generator A satisfies the following relation:

Example 1: Consider an RNS-PC based on the moduli ml = 2,ma = 3,m3 = 5,m4 = 7, and the code generator A = 31. Since m4 < A < m3m4, by Theorem 1, this RNS- PC has minimum distance 2. Now consider the same moduli set and change A = 31 to A = 37. Since m3m4 < A < m2m3m4, by Theorem 1, the new RNS-PC has minimum distance 3. The code spaces for A = 31 and A = 37 are given as follows:

RNS-PC A=31 (d=2)

Proof: For an RNS-PC to have minimum distance d , the following conditions must be satisfied: 1) there is no codevector of Hamming weight d - 1 or less (except for the all-zero codevector), and 2) there is at least one code- vector of Hamming weight d. Given an arbitrary vector z = [XI, 2 2 , . . . , ~ n ] , the first condition implies that if wt (z) = c 5 d - 3 , then X $ O(modA). Recall that if X < M and X O(mod A ) , then the corresponding vector z is a codevector. Let wt (z) = c, and z be nonzero in positions jl , j2 , . . . , .Ia , and zero elsewhere. As a result, X is a multiple of mj, j = 1 , 2 , . . . , n ; j #jl1j2,...,jc. Thus, we have

(10) M X = X‘A-

X 2 1 x2 x3 2 4

0 0 0 0 0 31 1 1 1 1 62 0 2 2 6 93 1 0 3 2 124 0 1 4 5 155 1 2 0 1 186 0 0 1 4

RNS-PC A=37 (d=3)

X XI x2 x3 I4 0 0 0 0 0 37 1 1 2 2 74 0 2 4 4 111 1 0 1 6 148 0 1 3 1 185 1 2 0 3

i=l

where X ’ is an arbitrary integer, satisfying The conditions on the moduli and code generator A for

error detection and correction in RNS-PC are described in [6], [lo], [ l l ] . In the following, error detection and correction capabilities are defined and their relationship to the minimum distance d of the RNS-PC is established from a coding theory point of view.

A. E~~~~ ~~~~~~i~~ and Correction in ms-pc

C

(11) 0 < X’A < H m j . .

The first condition is satisfied if and only if for X 2 M , c 5 ( d - 1). From (lo), the smallest value of X is obtained by setting X ‘ = 1, and by letting the product of c moduli be maximum in (10). Consequently, the moduli must satisfy

i= l

A M Once again, consider the RNS I1 defined by the moduli mi, i = 1,2 , . . . , n, and the RNS-PC R defined by the moduli mi, i = 1 ,2 , . . . , n, and code generator A . If the i t h residue digit zi is in error, then the altered residue digit will be yi, where

or yi 5 xi + ei (modm;), 0 < ei < mi (14)

e; being the error value. In general, the altered residue vector y can be expressed as the sum of the codevector z and error vector e

(12) A 2 ” { 1 mjt}.

In

Using a similar argument, we can show that there is at least one codevector of Hamming weight d if and only if y = z + e . (15)

Clearly, z E R, while, in general, y,e E II. The Hamming weight of the error vector e, wt (e), denoted by c , is called the number of errors in y. Also, we have d ( y , z ) = wt (e) = c. For a given y , one of the two fundamental problems arises:

1) Perform error detection, that is, check if y E R, and

(13) A < ” { lj mj.).

1IL In

Combining (12) and (13), we get the statement of the theorem.

. . .

KRISHNA AND SUN: ON THEORY AND FAST ALGORITHMS FOR ERROR CORRE(3ION 843

2 ) Perform error correction, that is, use a decoding pro- cedure to decode y to a unique codevector 5 E R (an estimate of z).

The following lemma plays a fundamental role in estab- lishing the relation between the minimum distance and error detection and error correction capabilities of an RNS-PC. The proof of this lemma has been given in [14], and therefore, is omitted here.

Lemma 2: Given any three vectors a, 6, and c in the RNS 11, the Hamming distance among a , b , and c, satisfies the triangular inequality

d(a, b) + d(b, c) 2 d(a, c) .

A conceptually simple but computationally impractical method to perform error detection is to compare y with every possible codevector in R. If y # 5 , but y E R, then undetectable errors are said to have occured. If y is not in R, then errors are detected. To assess the performance of this scheme, we define a parameter called the error detecting capability.

Definition 5: The error detecting capability 1 of an RNS- PC R is the largest number of errors that may occur for which an altered residue vector y is not in R.

In other words, 1 is the largest value of c for which an altered residue vector y is not in R. As defined earlier, c is the number of errors present in y. The following lemma establishes the relation between the parameter I and d of the RNS-PC.

Lemma 3: The error detecting capability 1 of an RNS-PC is d - 1.

In other words, any 1 or less residue errors in an RNS- PC of the code generator A are detectable if and only if the following condition is satisfied:

The decoding procedure for performing error correction depends on the criterion of performance. If errors occur independently, all errors are equiprobable, and the criterion of performance is to minimize the probability of decoding error (maximum likelihood decoding, MLD), then the decoding procedure can be summarized as: decode y to a code vector x which differs from y in the least number of places. We will use this decoding procedure in our subsequent analysis. A justification for this MLD-based decoding procedure is that probability of occurrence of i errors is smaller than probability of occurrence of j errors, i > j , under the above stated conditions. A proof for these statements can be found in [17] in the context of coding theory.

A conceptually simple but computationally impractical method to perform error correction is to compare y to every codevector in R. The vector y is decoded to that codevector k which satisfies the condition

d(y,k) I d(y,z),Vz E R , z # z.

If this condition is satisfied with equality, it means that there exist more than one codevector equidistant from y. In such a case, y can be decoded to any of them.

Definition 6: The error correcting capability t of an RNS- PC R is the largest number of errors that may occur for which correct decoding (z = z) takes place.

In other words, it is the largest value of c for which correct decoding takes place. The following lemma establishes the relation between the parameter t and d of the RNS-PC.

Lemma 4: The error correcting capability t of an RNS-PC is t = L(d - 1)/2].*

In other words, any t or less residue errors in an RNS- PC of the code generator A are correctable if and only if the following condition is satisfied:

In some RNS-PC, one may be interested in performing simultaneous error detection and correction. The following lemma deals with such a situation.

Lemma 5: A n RNS-PC of the code generator A is capable of correcting X or fewer residue errors and simultaneously detecting p(p > A) or fewer residue errors if and only if d 2 X + /3 + 1. In other words, the following condition is satisfied:

The proofs of Lemmas 3, 4, and 5 are similar to proofs of Lemmas 3, 4, and 5 in [14] and, therefore, are omitted here.

111. MULTIPLE ERRORS AND ADDITIVE OVERFLOW DETECTION IN RNS PRODUCT CODE

Under the assumption that no more than p residue errors occur, by the definition of RNS-PC and Lemma 3, given a number to be tested, a simple procedure for error detection is as follows.

Step 1: A = y( mod A), called syndrome, is computed. Step 2: Check if A 5 O(mod A); if yes, no error occurs;

otherwise, one or more errors are detected. Now, given B F(mod M ) , x = AX: + AX;, the

sum of two code-integers 0 I AX;,AX; < M , if no additive overflow occurs, (i.e., 0 5 x < M ) , P = is also a code-integer. If an additive overtlow occurs, then Y = y - M is illegitimate since B -M(modA) $ 0. From the above analysis, we see that this procedure is not suitable for simultaneously detecting residue errors and additive overflow, since in both cases, illegitimate numbers are generated. A procedure for simultaneously detecting additive overflow and multiple residue errors is analyzed and derived in the following. Given an integer X E [0, M ) , where X E X ( m o d M ) , X = AX; +AX; and 0 5 AX{,AXB < M , if

-

-

La] denotes the largest integer less than or equal to a

844 IEEE TRANSACTIONS ON COMPUTERS, VOL. 42, NO. 7, JULY 1993

c( 1 5 c 5 p) errors occur, then the altered residue vector can be represented as follows:

3) X + E < M and X = x - M. In this case - Y = x + E = ~ - M + E

- Y E X + E (modM)

* Y = [Wl, Y 2 , . .. , Ykl fY=l

x * z = [z1,22,. . . , 2 k ]

ya= x i , i # i a , a = l , 2 , . . * , c E * e = [ 0 , ~ ~ ~ , O , e ~ , , O , ~ ~ ~ , O , e ~ , , 0 , ~ ~ ~ , O , e ~ ~ , 0 , ~ ~ ~ , 0 ]

y . 2, E xi, + eaa

Since E F O(modmi) for all i # ia,a = 1 , 2 , . . . , c , and E f O(mod mi) for i = i,, a = 1,2, . , c, i.e., the number E is a multiple of all the moduli except mi,, mi,,

+ , mic, that is

( m o d m i a ) , l 5 i, 5 k , a = 1 , 2 , . . . , c .

,=l =eie (modmi-), a = 1 , 2 , . . . , c (21)

where 0 < e' < I I i=lmie. Based on y and the BEX operation [ 131 which avoids processing large valued integers, the syndrome digit A is computed.

A = P (modA). (22)

Since both X and E in (19) are less than M , we consider the following four cases.

1) X + E < M and X = x. In this case

4) M 5 X + E < 2M and X = - M. In this case - Y = X + E - M = X + E - 2 M

and

(mod A). (30) M

Under an additional constraint on the form of the moduli and code generator A, additive overflow and multiple errors can be distinguished and concurrently detected. The result is established in the following theorem.

Theorem 2: Under the assumption that no more than p residue errors occur, if the moduli and code generator A of an RNS-PC satisfy the condition

and

- M Y = X + E = X + e ' ? n 7% a=l

then /3 or fewer errors, affecting either an arbitrary legitimate number or the sum of two arbitrary legitimate numbers, are detectable and generate illegitimate numbers such that A $ O(modA) and A $ -M(modA).

Proofi Consider 1) for X + E < M and X = x. If

(23)

,=l Then, e' is a multiple of A. This is not possible as e' =

2) M 5 X + E < 2M and X = x. In this case n:=, miu < A,c 5 P. Now, if

- M A M (mod)A - M e ' y Y = X + E - M = X + (25) n mi- ,=l ,=l

then and

(mod A) E 0. miu) & (mod A). (26) M

KRISHNA AND SUN: ON THEORY AND FAST ALGORITHMS FOR ERROR CORRECTION 845

This is not possible as e’+&=, mia < 2D&, mia < A, c 5 /3. The cases 2), 3), and 4) can also be analyzed in an analogous manner. This proves the theorem.

Based on Theorem 2, we can add one more step to the procedure for error detection (given at the beginning of this section) to obtain the procedure for simultaneous detection of errors and additive overflow. The additional step is that if A -M(mod A) , then declare overflow detected; and if A 8 O(mod A) and A $ -M(mod A) , then declare one or more errors detected. When errors are detected, the procedures to determine error locations and error values for single, double, and multiple errors are described in the following sections.

Iv. A PROCEDURE FOR SINGLE-ERROR CORRECTION AND ADDITIVE OVERFLOW DETECTION

By Lemma 4 and Theorem 2, an RNS-PC with A > max { 2mj, . mj, }, 1 5 jl , j 2 5 n, can simultaneously correct single errors and detect additive overflow. Assume that only the pth residue digit is in error; then (23)-(30) become the following.

1) X + E < M and X = X. In this case

- M Y = X+E=X+e’ - - , O<e’<mp (32) mP

For j = 1 , 2 , . . . , n, solve the congruences

M A = (e?) - 2mj)-

mi (mod A)

to obtain the value e l l ) , e:z), and e?). Check if the solutions are consistent, i.e., one of the following three conditions is satisfied: Condition (1) el1) < mj, e?) > mj, and e?) > mj. Condition (2) e:.’) > m . e‘z) < mj, and e?) > mj. Condition (3) e:) > mj,y$ > mj, and e13) < mj. Let us say that one of the three conditions is satisfied, for j = I , then the lth residue digit is declared in error, the value of the error being el e(M/ml)(modml), where e = ej1’,ei2), or ei3) depending on as to whether Condition (l), (2), or (3) is satisfied, respectively. The correct value of the lth residue digit is (yl - el) mod ml, and y is decoded to z, where

z=[2?1,2?2,. . . ,2?/J

4. - - y j , j = 1 , 2 , . . ’ , k , j # l (43) and 2l ~ y l - el (modml). (44)

M

mP A = e’- (modA).

2) M 5 .Y + E < 2M and X = x. In this case - Y = X + E - M

M mP

= X + (e’ - mp)-, O < e’ < mp

and M mP

A (e’-m,)- (modA).

3) X + E < M and X = x - M. In this case

Y = X + E = x + E - M -

- M mP

=X+(e’-m,)-,O<e’<m,

(33) It is clear from (32), (33), and (40) that if one error takes place in the pth residue digit such that X + E < M and X = x, then for j = p,e$’) = e’ < mp and 1 = p . Similarly, if one error takes place in the pth residue digit such that M 5 X + E < 2M and X = X, then for j = p,e?) = e’ < mp and 1 = p from (34), (35), and (41); if one error takes place in the pth residue digit such that X+E < M and X = x- M , then for j = p , e y ) = e‘ < mp and 1 = p from (36), (37), and (41); if one error takes place in the pth residue digit such that M 5 X + E < 2M and X = X - M , then for j = p , e?) = e’ < mp and 1 = p from (38), (39), and (42). Based on the above analysis, if Condition (2) is satisfied, then after correcting for error, we recompute the syndrome, denoted by A’. If A’ E -M(modA) then declare overflow occurred. However, the following two cases have to be shown.

(34)

(35) -

(36)

and Case 1) If only one error occurs in the pth residue digit and j = p , then only one of the above three conditions

Case 2) If only one error occurs in the pth residue digit and j # p , then none of the above three conditions is

Under an additional constraint on the moduli and the code generator A, the result is established in the following theorem.

Theorem3: If the moduli and code generator A of an RNS product code are such that there do not exist integers n,, nj, 0 < np < m,, 0 < nj < mj, that satisfy either one

M mP

A (e’ - mp)- (modA). (37) is satisfied.

4) M 5 X + E < 2M and X =

- M

mP

- M . In this case - satisfied. Y = X + E - M = X+ E - 2M

(38) =X+(e’-2mp)- ,0<e’<m,

and

(39) of the following equations: M

mP A (e’ - 2mp)- (mod A) .

Given A , based on (32)-(39), a procedure to determine p (error location) and e, (error value) can be outlined as follows.

npmj + njm, = A (45)

(46) mpmj + n,mj + njm, = A

846 IEEE TRANSACTIONS ON COMPUTERS, VOL. 42, NO. 7, JULY 1993

where 1 5 .i 5 k , and the p t h residue digit is received in error, then i) only one of conditions (l), (2), or (3) is satisfied for j = p , and ii) none of conditions (l), (2), or (3) is satisfied for j # p .

Pro08 i) For j = p , if X + E < M and X = x, then e:') = e' is a solution to (40), Le.

This cannot hold due to (46). The cases for 1) M 5 X + E < 2 M and X = x, (2) X + E < M and X = F - M, and 3) A4 5 X + E < 2 M and X = x - M can also be analyzed in an analogous manner. This proves the theorem.

Lemma 6: If the moduli and code generator A of an RNS- PC satisfy the condition

A > max{3mj,mj2-mj,-mj,}, 1 < j l , j 2 I n (47)

where (M/mj)-' is the multiplicative inverse of (M/mj ) modA. From (41) and (42)

( A ( $ ) - ' + m j ) modAEe:) > m j

Similarly, for j = p , if M 5 X + E < 2M and X = x, then e?) = e' is a solution to (41), and is given by

Substituting the above solution in (40) and (42), we see that e y ) and e?), the solutions of (40) and (42), respectively, can be expressed as

e!) = (A (E) -' mod A)

E m j +e?) > mj.

The case for X + E < A4 and X = F - M , and the case for M 5 X + E < 2M and X = x - M can also be analyzed in an analogous manner.

ii) For j # p , X + E < M and X = x, if e:') < mj , then comparing (33) and (40), we obtain

(e'mj - e$')m,) 0 (mod A) M

'mj mp

that is, e'mj - e:')mp is a multiple of A. This is not possible as Je'mj - e j m,] < mjm, < A. Similarly, for X + E < M and X = x, if e?) < m j , then comparing (33) and (41), we obtain

(1)

[e'mj + ( m j - e:))m,] E 0 (mod A). M

m j mp

This cannot hold due to (45). For X + E < M and X = x, if e?) < m j , then comparing (33) and (42), we obtain

[e'mj + (2mj - ey))m,] G 0 (mod A). M

mi m,

and only one error occurs in the p t h residue digit, then i) only one of conditions (l), (2), or (3) is satisfied for j = p , and ii) none of conditions (l), (2), or (3) is satisfied for j # p .

Proof: The condition is sufficient since, if the moduli and code generator A satisfy (47), then the conditions in Theorem 3 are satisfied trivially. This completes the proof.

Based on the concept developed above and under the assumption that the moduli mj , j = 1 ,2 , . . . , n, and the code generator A satisfy the constraints in Theorem 3 (or Lemma 6), the algorithm to correct a single error and simultaneously detect additive overflow in RNS-PC can be described as follows.

Step 1: According to the received residue vector and BEX operation, compute the syndrome A.

Step 2: If A G O(mod A), then declare that no error has occurred and stop. If A E -M(modA) , then declare that no error has occurred and overflow is detected and stop. Otherwise, go to next step.

Step3: Let j = 1. Step 4: Perform single-error consistency-checking for the

modulus mj . Check the consistency of the solutions. If it is consistent, then go to Step 6; if it is inconsistent, then go to next step.

Step 5: Let j = j + 1. If j 5 n, go to Step 4. Go to Step 7 for j > n.

Step 6: 1) If e:') < m j , then only one error is in the j t h position.

Correct it and stop. 2) If e?) < m j , then declare that only one error is in

the j t h position and an additive overflow is detected. Correct error and stop.

(2) < m j , then declare that only one error is in the j t h position. Correct it and recompute the new syndrome A' by the BEX operation. If the new syndrome A' - M (mod A), then also declare an additive overflow detected and stop. Otherwise, stop.

3) If e j

Step 7: Declare more than one error detected and stop. A flowchart for this algorithm is given in Fig. 1. Example2: Consider an RNS-PC based on the moduli

ml = 3,m2 = 5,m3 = 7 ,m4 = l l , m 5 = 13,ms = 17,m7 = 19,ms = 23, and the code generator A = 1073, which satisfy the conditions in Theorem 3. Let X = 10,730 < M = II:==,mi = 111,546,435, and X E O(modA). - M(modA) E 499. Therefore, X is a code- integer in this RNS-PC. The residue representation of X is z = [l, 0,6,5,5,3,14,12] . Assume that X is altered by a single residue digit error, say that the first residue digit is in error, and E c) e = [2 ,0 ,0 ,0 ,0 ,0 ,0 ,0] . Then the received vector is y = [0, 0,6,5,5,3,14,12]. Based on the received

KRISHNA AND SUN: ON THEORY AND FAST ALGORITHMS FOR ERROR CORRECTION

ACCORDING TO THE RECEIVED VECTOR,

COMPUTE THE I SYNDROME A.

*XEiiij STOP.

+ N

j= 1

k I

PERFORM THE SINGLE- ERROR CONSISTEKY- CHECKING AT THE MODULUS mj.

N

Fig. 1. Decoder flowchart for single-error correction and multiple-error and additive overflow detection.

vector and the BEX operation, we compute the syndrome digit A 25(modA). Since A $ O(modA) and A $ -M(mod A), then, following the decoding algorithm, we check the consistency for j = 1,2, . . . ,8 , based on computing ej (’) ’ e j (2), and e?) from (40H42). It is seen that when j = 1

e?) G AmlM-’ (mod A) 2 < ml

e(2) = - ( A m l M - l + m l ) (mod A) 5 > ml

e?’ = ( A m l M - ’ + 2ml) (mod A ) 8 > ml.

Since e(,l) is a consistent solution, we declare that one error has occurred in the first position and the estimate of erroneous digit is

5 1 y1 - M m l

ep)- (modml) 1.

Exumple3: In the RNS-PC of Example 2, let X X = XI + Xz(modM), where X I = 107,300,000 H

z1 = [2 ,0,3,5,2,12,8,9] and X2 = 4,246,934 H 2 2 = [2,4,6,10,3,11,16,7]. Then z = [l, 4,2,4,5,6,5,16]. Based on 2 and the BEX operation, we compute the syndrome A 499 -M(modA). So, declare that an additive overflow is detected. Now, assume that a single residue digit error affects the number X considered above, the error vector being e = [2 ,0,0,0,0,0,0,0] . Then the received vector becomes y = [0,4,2,4,5,6,5,16]. Based on y and the BEX operation, we compute the syndrome A 524 f -M(modA). Following the decoding algorithm, we check the consistency

-

for j = 1,2, (40H42). It is seen that when j = 1

,8, based n computing e:.’), e?) , and e?) from

= - AmlM-’ (mod A ) = 1072 > m l

e?) = (AmlM-’ + ml) (mod A ) 2 < ml

e?) (AmlM-’ + 2ml) (mod A ) E 5 < ml.

Since e?) is a consistent solution, we declare that one error has occurred in the first position and the estimated value of erroneous digit is

M ml

i 1 y1 -e?)- (modml) G 1

Based on the corrected vector [ l , 4, 2, 4, 5, 6, 5, 161 and the BEX operation, we recompute the syndrome A’ = 499 = -M(mod A). Therefore, an additive overflow is detected.

Example 4: In the RNS-PC of Example 2, let X = 21,288,320 and z = [2 ,0,4,9,1,2,17,3] . Assume that X is altered by two residue errors, the error vector being e = [0 ,0,0,0,0,0,8,5] . Then the received vector is y [2 ,0,4,9,1,2,6,8] . Based on y and the BEX operation, we compute the syndrome A = 524(modA). Following the decoding algorithm, we check the consistency for j = 1,2, . . . , 8, based on computing e:.’), e?), and e?) from (40H42). It is seen that when j = 1

e?) = A m l M - l (mod A) 1072 > ml

e(2) = - ( A m l M - l + m l ) (mod A) 2 < ml

e?) ( A m l M - ’ + 2ml) (mod A) 5 < ml.

So, declare that one error has occurred in the first position. It is obvious that the decoder makes a decoding error. The following section will deal with this problem.

v. A PROCEDURE FOR SINGLE-ERROR CORRECTION AND MULTIPLE-ERROR AND ADDITIVE OVERFLOW DETECTION

By Lemma 5, an RNS-PC with A > max {If-?: mj, }, can simultaneously correct single error and detect the presence of p(p > 1) or fewer errors. The procedures to correct single error and simultaneously detect multiple errors and additive overflow are the same as that in Section IV. However, it has to be shown that if more than one but up to p errors take place, then there is no consistent solution. Under an additional constraint on the form of the moduli, the result is established in the following theorem.

Theorem 4: If the moduli and code generator A of an RNS- PC, are such that there do not exist integers nj, n B ; 0 5 nj < mj, 0 5 n B < MB = @=, miu , 1 5 i, 5 n, that satisfy

njMB + nemj = A (48)

or

mjMB + njMB + nBmj = A (49)

then for more than one but up to p residue digits received in error, there is no consistent solution to any one of (40), (41), or (42).

848 IEEE TRANSACTIONS ON COMPUTERS, VOL. 42, NO. I, JULY 1993

Proof: Assume that c( 1 < c 5 p) errors have occurred. For X + E < M and X = x, if e:) = e < mj, then comparing (24) to (40) we obtain

,=l

This congruence cannot hold as leII“,l mia - e’mjl < mj IT&, mia < A. Similarly, for X + E < M and X = x, if e?) = e < mj, comparing (24) to (41) we obtain

,=l

This congruence cannot hold as (e’mj+(mj-e) II&lmia) < 2mjII&1niia < A , for c < p; and because of (48) for c = p. For X + E < M and X = x, if e?) = e < mj, then comparing (24) to (42) we obtain

,=l

This congruence cannot hold as e’mj + (2mj - e ) II&l mia < A for c 5 13 - 1, and because of (49) for c = p. The case for i) M 5 X + E < 2M and X = x, ii) X + E < M and X = x - AB, and iii) M 5 X + E < 2M and X = x - M , can also be analyzed in an analogous manner. This proves the theorem.

Lemma 7: If the moduli and code generator A of an RNS PC satisfy

where MB = mia, 1 5 i,, j 5 n, then for more than one but up to p residue digits received in error, there is no consistent solution to any one of (40), (41), or (42).

The proof of Lemma 7 is similar to the proof of Lemma 6, and therefore, is omitted here.

Example5: Consider an RNS-PC based on the moduli ml = 3,m2,= 5,m3 = 7,m4 = 11,m5 = 1 3 , m ~ = 17, m7 = 19, m8 = 23, and the code generator A = 33,263 > 3m6m7m8 - m6 - m7m8 = 21,833. Let X = 21,288,320 < M = I&mi = 111,546,435, and X E O(modA). Therefore, X is a code-integer in this RNS-PC. The residue representation of X is z = [2,0,4,9,1,2,17,3]. Assume that X is altered by a single residue digit error in the first position, and E ++ e = [2,0,0,0,0,0,0,0]. Then the received vector is y = [l , 0 ,4 , 9,1,2,17,3]. Based on the received vector and the BEX operation, we compute, the syndrome A = 211485(mod A ) . Note that -M(mod A) = 17,667 and A f - M ( m o d A ) . Following the decoding algorithm, we check the consistency for j = 1,2 , . - . , 8 , based on computing

e:’), e?), and e?) from (40)-(42). It is seen that when j = 1

e(,l) A m l M - l (mod A) 2 < ml

= - AmlM-’ + ml (mod A) = 5 > ml

($3) = - AmlM-’ + 2ml (mod A) E 8 > ml.

Since e?) is a consistent solution, we declare that one error has occurred in the first position and the estimated value of erroneous digit is

Now, assume that X is altered by two residue errors, the error vector e = [O,O, 0, 0 , O , O , 8,5]. Then the received vector becomes y = [2,0,4,9,1,2,6,8]. Based on y and the BEX operation, we compute the syndrome A 28,422(mod A ) . Following the decoding algorithm, we check the consistency for j = 1,2 , . . . , 8. It is found that there is no consistent solution. Therefore, declare more than one error detected.

VI. A PROCEDURE FOR DOUBLE-ERROR CORRECTION AND MULTIPLE-ERROR AND ADDITIVE OVERFLOW DETECTION

By Lemma 5, an RNS-PC with A > max{IIfzfmje}, can simultaneously correct double residue errors and detect the presence of p(p > 2) or fewer errors. Assume that the pth and qth residue digits are in error, then (23H30) become the following.

1 ) X + E < M and X = x. In this case

, o < e’ < mpmq - M Y = X + e ’ -

mPm’ and

A E e’- (modA) . mPm‘

2) M 5 X + E < 2M and X = x. In this case

, O < e‘ < mpmq - M Y = X + ( e ’ - m m )- ‘ mpmq

and

A = ( e ’ - m m )- ( m o d A ) . ’ mpmq -

3) X + E < M and X = X - M. In this case

M M , O < e’ < mpmq (55) Y = X + ( e ’ - m m )-- ‘ mpmqmpmq _ -

and

A = ( e ’ - m m )- (modA) . (56) ‘ mpmq

4) M 5 X + E < 2M and X = x - M. In this case

, O < e’ < mpmq - - M Y = X + (e’ - 2mpmq)-

mPm’ (57)

and

A G (e’ - 2mpmq)- (modA) . (58) mPm’

KRISHNA AND SUN: ON THEORY AND FAST ALGORITHMS FOR ERROR CORRECTION 849

Given A, based on (51H58) a procedure to determine p , q (error locations) and ep , e, (error values) can be outlined as follows.

F o r i = 1 , 2 , ~ ~ ~ , n - 1 , a n d j = i + 1 , i + 2 , ~ ~ ~ , n , s o l v e the congruences

A e(1)- (modA) 23 mimj (59)

(mod A) (60)

(modA). (61)

Then check if one of the following three conditions are satisfied. Condition (1): e::) < mimj,e$) > mimj, and e:;) > mimj. Condition (2): e::) < mimj, e$) > mimj, and ej3) > mimj. Condition (3): e!:) < mimj, e!:) > mimj,

conditions is satisfied for i = f and j = h. Then the f t h and hth residue digits are declared to be in error; the value of errors are

and eij (2) > mimj. Let us say that one of the above three

where e = e$) if e!:) is a consistent solution to (59); e = e::) if e$’ is a consistent solution to (60); e = e!;) if e,!;’ is a consistent solution to (61). Note that if e = O(modmf) or e O(modmh), then only the hth or f t h residue digit is in error. The correct values of the f t h and hth residue digits are (yf - e f ) modmf and (Yh - eh) modmh, respectively, and y is decoded to 3, where

It is clear from (51), (52), and (59) that if two errors have occurred in the pth and qth residue digits such that X + E < M and X = x, then for i = p and j = q,e = e‘ = e$) < mimj is a solution to (59), and f = p and h = q. Similarly, if two errors have occured in the pth and qth residue digits such that 1) M 5 X + E < 2M and X = x, then for i = p and j = q, e = e‘ = e@ < mimj is a solution to (60), and f = p and h = q; (2) X + E < M and X = x - M , then for i = p and j = q ,e = e’ = e::’ < mimj is a solution to (60), and f = p and h = q; 3) M 5 X + E < 2M and X = Z - M , then for i = p and j = q, e = e‘ = e(3) < mimj is a solution to (61), and f = p and h = q. Based on the above analysis, if Condition (2) is satisfied, then we correct errors and recompute the new syndrome A’. If A’ -M(mod A), then declare an additive overflow detected. However, it remains to be shown

23

that there is no consistent solution, if one of the following three cases happens:

Case i) Only one error has occurred in the pth residue digit and p # i , j .

Case ii) Two errors have occurred in the pth and qth residue digits and p # i , j and/or q # i , j .

Case iii) More than two but up to p errors have occurred. Under an additional constraint on the moduli and code gener- ator A, the result is established in the following theorem.

Theorem 5: If the moduli and code generator A of an RNS- PC are such that there do not exist integers na3 , nB; 0 < na3 < m2m3, 0 5 nB < MB = IIt=l mXa , 1 5 i, 5 n, that satisfy either one of the following equations:

nBmam3 + nt3MB = A (65)

(66) m,m3MB + nBm,m3 + nZ3MB = A

where 1 5 i , j 5 n, then none of (59), (60), and (61) has a

Case i) If only one error has occurred in the pth residue digit and p # i , j .

Case ii) Two errors have occurred in the pth and qth residue digits and p # i , j and/or q # 2, j .

Case iii) More than two but up to p errors have occurred. Proof: Consider Case ii). Two errors have occurred and

i # p,q andlor j # p , q (Case i), only one error in the pth position and p # i , j , can be analyzed in a similar manner). For X + E < M and X = Zl if e!:’ < mam3 is a consistent solution to (59), then comparing (52) with (59), we get

consistent solution for any one of the following three cases:

(e’mimj - eii)m,m,) 0 (mod A) M

m;mjm,m,

that is, e’mimj - e!:)m,m, is a multiple of A. This is not possible as le’mimj - ej;)mpmql < mimjm,m, < A. Similarly, if e$) < mimj is a consistent solution to (60), then comparing (52) with (60), we get

M mi mj mp m, (e’mimj+(m;mj-e{:))mpmq) 0 (mod A).

This cannot hold as (e‘mimj + (mimj - e$))mpmq) < A. If e!;’ < mimj is a consistent solution to (61), then comparing (52) with (61), we get

M mimj mpmq (e’mimj+(2mimj-e,(;))mPm,) = 0 (mod A).

This cannot hold as (e’mimj + (2mimj - e$))m p m 9- ) < A. The cases for i) M 5 X + E < 2M and X = X, ii) X + E < M and X = x - M , and iii) M 5 X + E < 2M and X =

Now, consider Case iii) and assume that c(2 < c 5 p) errors has occurred. For X + E < M and X = x, if e::) < mimj, then comparing (24) to (59) we obtain

- M can also be analyzed in an analogous manner.

a=l

850 IEEE TRANSACTIONS ON COMPUTERS, VOL. 42, NO. 7, JULY 1993

This congruence cannot hold as le:,” II:=, mia - e’mimj I < mimjII&l miQ < A. Similarly, for X + E < M and X = x, if e!:’ < mimj, comparing (24) with (60), we obtain

C = 0 (modA). M

mimj miQ ,=l

This congruence cannot hold as (e‘mimj + (mimj -

because of (65) for c = p. For X + E < M and X = x, if e:;) < mi’mj, then comparing (24) with (61), we obtain

eij ( 1 ) )II&,mia) < 2mimjIIz=1mia < A, for c < p; and

C 5 0 (modA). M

mj n mia ,=l

This congruence cannot hold as e’mimj + (2mimj - e(3))II&lmia 23 < A for c < p, and because of (66) for c = p. The case for i) M < X + E < 2M and X = x, ii) X + E < M a n d X = x - M , a n d i i i ) M < X + E < 2 M a n d X = x - M , can also be analyzed in an analogous manner. This proves the theorem.

Lemma 8: If the moduli and the code generator A of an RNS-PC satisfy

A > max(3mimjMB - mimj - M B } (67)

where MB = mia, 1 5 i, j , i, 5 n, then none of (59), (60), and (61) has a consistent solution for either one of the three following cases:

Case i) If only one error has occurred in the pth residue digit and p # i , j .

Case ii) ’ b o errors have occurred in the pth and qth residue digits and p # i , j and/or q # i, j .

Case iii) More than two but up to p errors have occurred. The proof of Lemma 8 is similar to the proof of Lemma 6,

and therefore, is omitted here. Based on the concept developed above and under the assumption that the moduli mi, i = 1 ,2 , . . . , n, and the code generator A satisfy the conditions in Theorem 5 (or Lemma 8), the algorithm to simultaneously correct double errors and detect multiple errors and additive overflow in RNS-PC can be described as follows.

Step 1: According to the received residue vector and the BEX operation, we compute the syndrome A.

Step 2: If A = O(mod A), then declare that no error has occurred and stop. If A = -M(modA), then declare that no error has occurred and overflow is detected and Stop. Otherwise, go to next step.

Step3: Let i = 1. Step 4: Let j = i + 1.

COMPUTE THE - STOP.

1*0.171*lmTlnmpQ DETECTED AND STOP. MORE THAN TWO ERRORS ARE

PERFORM THE WUBLE- ERROR CONSISTENCY- CHECKING FOR THE COMBINATION OF mi AND mj.

AND j th POSITIONS. CORRECT THEM AND RECOMPUTE THE

ADDITIVE OVERFLOW

Fig. 2. Decoder flowchart for double-error correction and multiple-error and additive overflow detection.

Step 5: Perform double-error consistency-checking for the combination of the moduli mi and mj . Check the consistency of the solutions. If it is consistent, then go to Step 7; if it is inconsistent, go to next step.

Step 6: j = j + 1, go to Step 5 for j 5 n. For j > n, i = i + 1, go to Step 4 for i < n - 1. For i = n, go to Step 8.

Step 7: 1) If e$) is a consistent solution, then declare that two

errors have occurred in the i th and j t h position, Correct them and stop.

2) If e!,”) is a consistent solution, then declare that two errors have occurred in the i th and j t h position, and an additive overflow is detected. Correct errors and stop.

3) If e::’ is a consistent solution, then declare that two errors have occurred in the i th and j t h position. Correct them and recompute the syndrome A’ by the BEX operation. If the new syndrome A’ = -M(modA), then also declare an additive overflow detected and stop. Otherwise, stop.

Step 8: Declare more than two errors detected and stop. A flowchart for this algorithm is given in Fig. 2. By Lemma 4, an RNS-PC with A > max {II f==, mj,}, can

correct double residue errors. Under an additional constraint on the moduli and code generator A, the above decoding algorithm can be used for simultaneously correcting double residue errors and detecting additive overflow. The result is established in the following theorem and lemma. The proofs of

KRISHNA AND SUN: ON THEORY AND FAST ALGORITHMS FOR ERROR CORRECTION 851

Theorem 6 and Lemma 9 are similar to the proofs of Theorem 5 and Lemma 8, and therefore, are omitted here.

Theorem 6: If the moduli and code generator A of an RNS- PC are such that there do not exist integers npq, nij, 0 < npq < mpmll, 0 < nij < mimj, that satisfy either one of the following equations:

npqmtml + nt3mpmq = A mpmqmtmJ + npqmtml + nZJmpmq = A

(68) (69)

where 1 5 i , j 5 n, then none of (59x61) has a consistent solution for either one of the following cases:

Case 1) If only one error has occurred in the pth residue digit and p # i , j .

Case ii) Two errors have occurred in the pth and qth residue digits and p # i , j and/or q # i , j .

Lemma 9: If the moduli and code generator A of an RNS- PC satisfy

A > max {3m,mqmimj - mimj - mpmq} (70)

where 1 5 i , j 5 n, then none of (59), (60), and (61) has a consistent solution for either one of the following cases. Case (i): if only one error has occurred in the pth residue digit and p # i , j . Case (ii): two errors have occurred in the pth and qth residue digits and p # i , j and/or q # i , j .

Example6: Consider an RNS-PC based on the moduli m l = 3,mz = 5,m3 = 7,m4 = 11,m5 = 13,m6 = 17,m7 = 19,m8 = 23, and the code generator A = 289,078 > 3m~m6m7m8 - m5m6 - 77277728 = 289,073. Let X = 5,781,560 < M = 11:=1 mi = 111,546,435, and X O(modA). Therefore, X is a code-integer in this RNS-PC. The residue representation of X is z = [2,0,1,4,5,13,12,4]. Assume that .Y is altered by two residue errors in the seventh and eighth positions, and E tf e = [0 ,0 ,0 ,0 ,0 ,0 ,8 ,5] . Then the received vector is y = [2 ,0,1,4,5,13,1,9] . Based on the received vector and the BEX operation, we compute the syndrome digit A = 56,474(modA). Note that -M G

37,673(mod . A ) . Following the decoding algorithm, we check theconsistencyfori = 1 , 2 , . . . , 7 , j = i+ l , i+2 , . . . , 8 ,based on computing e:;), e::’, and e:;’ from (59x61) . We get

Since e&) 212(modA) < m7m8 is a consistent solution, we declare that two errors have occurred in the seventh and eighth positions, and the estimated values of erroneous residue digits being

(modm7) G 12 M

m7ma 2 7 E y7 - e(’) - 78

Example 7: In the RNS-PC of Example 6, let X X(mod M ) and 7 = X1 +X2, where X1 = 109,849,640 H

[0 ,3,4,8,1,2, 12,211. Then X = 108,441,923 ++ z = [2 ,3,2,7,5,11,12,5] . Based on the vector z and the BEX operation, we compute the syndrome A G 37,673(mod A). Since A -M(modA), we declare that an additive overflow is detected. Now, assume that X is altered by two residue errors in the seventh and eighth positions, and E H e = [0 ,0,0,0,0,0,8,5] . Then the received vector is y = [2 ,3,2,7,5,11,1, lo]. Based on the received vector y and the BEX operation, we compute the syndrome A 131,82O(mod A). Following the decoding algorithm, we check the consistency for i = 1,2 , + . . , 7 , j = i+l , i+2 , . . . , 8 , based on computing e:;), e,!:’, and e$) from (59x61) . We get

-

21 = [2 ,0,5,10,4,9,0,7] ,X2 = 110,138,718 H 2 2 =

e(l) 78 = - Am7m8M-l (mod A) 78 = - Am7m8Mp1+ m7mg (mod A) E 288,853 > m7mg

e(3) 78 = - Am7msM-l + 2m7m8 (mod A) E 212 < m7mg.

288,416 > m7mg

Since eg ) 212(modA) < m7m8 is a consistent solution, we declare that two errors have occurred in the seventh and eighth positions, and an additive overflow is detected, the estimated values of erroneous residue digits being

We have extended the previous algorithms for single error correction and additive overflow detection in [ l l ] , [12] to obtain a new algorithm for double error correction and p -error ( p > 2) and additive overflow detection [MI. This was done with the objective of comparing the computational complexity of the various algorithms. Based on the approaches in [ l l ] , [12], an algorithm for correcting double errors and simultane- ously detecting p(p > 2) errors and additive overflow can be outlined as follows.

Step 1: Based on the received residue vector, compute the syndrome A using the BEX method.

Step 2: If A O(mod A), then declare that no error has occurred and stop. If A -M(mod A), then declare that no error has occurred and an additive overflow is detected and stop. Otherwise, go to next step.

Step 3: Compute the mixed radix digits corresponding to each of the (;) projections of the image. Note that each of the projections is obtained by deleting 2 residue digits from the n residue digits. Let MA denote the product of the moduli corresponding to the deleted digits. Let a,+l be the last mixed radix

1)

2)

digit. If a,+l E [0, M A ) , then declare that two errors have occurred in the positions corresponding to the moduli of MA. Correct them by using the BEX method and stop. If a,+l E [MA, 2MA), then declare that two errors have occurred in the positions corresponding to the moduli of MA and an additive overflow is detected. Correct the errors by using the BEX method and stop.

852 IEEE TRANSACTIONS ON COMPUTERS, VOL. 42, NO. I, JULY 1993

TABLE I REQUIREMENT OF MMULT A N D MADD FOR SINGLE/DOUBLE ERRORS C O R R E ~ I O N A N D ADDITIVE OVERFLOW DETECTION czrzL?n Previous Algorithm [ 111, [ 121 New Algorithm

1

d = 3

2

(1 = .5

w3 + $ JI - 2(?1I1IULT) J I ~ + 211 - l(MX1ULT)

J I ~ + 311 - l ( l 1 A D D )

: J I ~ + f ~ ~ ( l l h 1 L I L T )

2,i2(51.ADD)

f I I ~ + $ I I - 2( XADD)

+ ) I ’ - n3 + : n 2 + 211 - 5(lIXlLILT)

+ J I ~ - 11:’ + : I I ’ + 2r1 - 5( l IADD)

3) If a,,+l E [2M11, A ) , for all (;) sets of two different

Step 4: Declare more than two errors detected. Stop. moduli, then go to next step.

VII. CONCLUSION AND COMPARISON

In this paper, we develop a coding theory based mathemat- ical framework for error control in residue number system product codes. Necessary and sufficient conditions on the moduli and code generator for an RNS-PC having minimum distance d are derived. We also further establish the relation- ship between d and error correction and detection capability of the R N S - P C . Based on the coding theory framework developed in this paper for the RNS-PC, we derive new algorithms for correcting and detecting multiple residue errors and detecting additive overflow. They are superior to the algorithms in [ l l ] , [12] from computational complexity point of view, Le., the requirement of modulo additions (MADD) and multiplications (MMULT). Based on the MRC method for the BEX operation [13], the comparison of our algorithms to those in [ l l ] , [12] in terms of requirement of MMULT and MADD is shown in Table I. We should point out that for double-error correction the expression in column 2 of Table I is obtained by extending the algorithms in [ I l l , [12] as described in the previous section. However, the algorithms in [ l l ] , [12] remain valid even for the case when the moduli and code generator do not satisfy the conditions stated in Theorems 3-7. Finally, the error-correcting procedure in [6] is based on the convergents of continued fractions, whereas our approach employs exclusively modulo operations. These two metholologies are completely different from each other. A detailed and thorough comparison of the two techniques requires further analysis.

ACKNOWLEDGMENT

The authors express their most sincere thanks to the review- ers for a very thorough review and constructive suggestions that have resulted in a significantly improved manuscript.

REFERENCES

R. W. Watson and C. W. Hastings, “Self-checked computation using residue arithmetic,” Proc. IEEE, no. 12, pp. 192G1931, Dec. 1966. F. Barsi and P. Maestrini, “Error correcting properties of redundant residue number systems,’’ IEEE Trans. Comput., vol. C-22, no. 3, pp. 307-315, Mar. 1973. S . S . - S . Yau and Y. -C. Liu, “Error correction in redundant residue number systems,” IEEE Trans. Comput., vol. C-22, pp. 5-11, Jan. 1973. D. M. Mandelbaum, “On a class of arithmetic codes and a decoding algorithm,” IEEE Trans. Inform. Theory, vol. IT-22, pp. 85-88, Jan. 1976.

-, “Further results on decoding arithmetic residue codes,” IEEE Trans. Inform. Theory, vol. IT-24, pp. 643444, Sept. 1978. F. Barsi and P. Maestrini, “Improved decoding algorithm for arithmetic residue codes,” IEEE Trans. Inform. Theory, vol. IT-24, pp. 6 4 M 4 3 , Sept. 1978. V. Rdmachandran, “Single residue error correction in residue number systems,” IEEE Trans. Compnt., vol. C-32, no. 5, pp. 504-507, May 1983. W. K. Jenkins and E. J. Altman, “Self-checking properties of residue number error checkers based on mixed radix conversion,” IEEE Trans. Circuits Syst.. pp. 159-167, Feb. 1988. C. -C. Su and H. -Y. Lo, “An algorithm for scaling and single residue error correction in residue number systems,” IEEE Trans. Coinpuf., vol. 39, no. 8, pp. 1053-1064, Aug. 1990. D. Mandelbaum, ‘‘Error correction in residue arithmetic,” IEEE Trans. Comput., no. 6 , pp. 538-545, June 1972. F. Barsi and P. Maestrini, “Error detection and correction by product codes in residue number system,” IEEE Trans. Comput., vol. C-23, pp. 915-924, Sept. 1974. W. K. Jenkins, “Failure resistant digital filters based on residue number system product code,” in Proc. IEEE Int. Conf Acoust. Speech Sigma1 Processing, vol. I , 1982, pp. 60-63. A. P. Shenoy and R. Kumaresan, “Fast base extension using a redundant modulus in RNS,” IEEE Trans. Comput., vol. 38, no. 2, pp. 292-297, Feb. 1989. H. Krishna, K. Y. Lin, and J. D. Sun, “A coding theory approach to error control in redundant residue number systems, Part I: Theory and single error correction,” IEEE Trans. Circuits Syst., vol. 39, no. I , pp. 8-17, Jan. 1992. J. D. Sun and H. Krishna, “A coding theory approach to error control in redundant residue number systems, Part 11: Multiple errors detection and correction,” IEEE Trans. Circuits Syst., vol. 39, no. 1, pp. 18-32, Jan. 1992. W. W. Peterson and E. J. Weldon, Jr., Error Correcting Codes. Cam- bridge, MA: MIT Press, 1972. S. Lin and D. J. Costello, Jr., Error Control Coding: Fundamentals and Applications. J. D. Sun, “Error control techniques in residue number systems: Theory, algorithms and implementation,” Ph.D. dissertation, Dep. Elec. Comput. Eng., Syracuse Univ., Syracuse, NY, 199 1.

Englewood Cliffs, NJ: Prentice-Hall, 1983.

Hari Krishna (S’84-M’XS) was born on September 30, 1960 in Roorkee, India He received the B Tech degree in electricdl engineering (first class with distinction) from the Indian Institute ot Technology, Delhi, India, in 1981 dnd the M Eng dnd Ph D degrees from Concordia University, ‘Montreal, P Q , Candda, In 1983 dnd 1985, respectiLely

In 1985 he joined the Depdrtment of Electricdl dnd Computer Engineering, Syracuse University, Syracuse, NY, as Assistant Professor At present he holds the rdnk of Associate Professor with the

same department His resedrch interests are in the area\ of digital com- municdtions, digital signal dnd image processing, and fdst algorithms for computdtional complexity problems arising in these dnd other rcldted areds Besides technicdl books, he is deeply interested in cldssical Indian literature He authored a resedrch monogrdph, Computational Complexity of Bilinear Forms Algebraic Coding Theory and Applications to Digital Communication Systems (Springer-Verldg, 1987) He also coauthored a book, Digital Signal Processing application^ to Communications and Algebraic Coding Theorier (Academic, 1990)

KRISHNA AND SUN: ON THEORY AND FAST ALGORITHMS FOR ERROR CORRECTION

Jenn-Dong Sun received the B.S. and M.S. de- grees in electrical engineering from Chung-Cheng Institute of Technology, Taiwan, R.O.C. in 1976 and 1982, respectively, and the Ph.D. degree in electrical engineering from Syracuse University in 1991.

During the period of 1977-1980 he worked at Taiwan Telecommunications Training School as an Instructor. From 1982 to 1987 he was an Assistant Researcher at Chung-Shan Institute of Science and Technology, Taiwdn, R.0.C where he hdb been

engaged in research concerning digitdl signal-processing techniques. His major areas of interest are computation algorithms for high-speed and fault-tolerant digital systems and digital signal-processing for radar.

853