9
The Mixed-Radix Chinese Remainder Theorem and Its Applications to Residue Comparison Shaoqiang Bi and Warren J. Gross, Member, IEEE Abstract—The Chinese remainder theorem (CRT) and the mixed-radix conversion (MRC) are two classic theorems used to convert a residue number to its binary correspondence for a given moduli set fP n ; ... ;P 2 ;P 1 g. The MRC is a weighted number system, and it requires operations modulo P i only, and hence, magnitude comparison is easily performed. However, the calculation of the mixed-radix coefficients in the MRC is a strictly sequential process and involves complex divisions. Thus, the residue-to-binary (R/B) conversions and residue comparisons based on the MRC require a large delay. In contrast, the R/B conversion and residue comparison based on the CRT are fully parallel processes. However, the CRT requires large operations modulo M ¼ P n ; ... ;P 2 P 1 . In this paper, a new mixed-radix CRT is proposed that possesses both the advantages of the CRT and the MRC, which are parallel processing, small operations modulo P i only, and the efficiency of making modulo comparison. Based on the proposed CRT, new residue comparators are developed for the three-moduli set f2 n 1; 2 n ; 2 n þ 1g. The FPGA implementation results show that the proposed modulo comparators are about 20 percent faster and smaller than one of the previous best designs. Index Terms—Chinese remainder theorem, mixed-radix conversion, residue comparator, FPGA. Ç 1 INTRODUCTION I NTEREST in the residue number system (RNS) in the face of standard number systems can be explained by the emergence of application-specific integrated circuits (ASICs) that benefit from the speed, area, and power advantage of the RNS. Specifically, the RNS has been receiving significant attention for high-speed digital signal processing (DSP) computation with high precision for the intrinsic properties of the RNS such as carry-free operations, parallelism, and modularity. The RNS is defined in terms of a set of mutually prime moduli that are independent of each other. Since there is no carry propagation among arithmetic operations based on each modulus, it is easy to implement RNS computations in parallel, thus resulting in very high-speed and low-power VLSI implementations [1]. However, due to the nonposition nature of the RNS, the magnitude comparison between residue numbers is much more complex than that in the weighed number system. Other residue arithmetic functions such as sign test, over- flow detection, and division suffer from the same difficulty. This difficulty prevents a wide variety of general-purpose computations from taking advantage of the residue arith- metic. To do the residue number comparison, the traditional techniques use the Chinese remainder theorem (CRT) or the mixed-radix conversion (MRC) [1]. A direct implementation of the CRT is inefficient since it is based on a large modulo M operation, where M is the dynamic range of the RNS. The MRC is a strictly sequential process and requires a long delay. Some techniques based on the core function [2], parity checking [3], or the diagonal function [4] have been proposed to compare the magnitudes of residue numbers. The core functions require an iterative process of descent and lifting to find the critical core value. An improved version of this technique was presented in [2] to avoid the iterative process at the cost of a redundant modulus. A different solution [3] to do the residue number comparison assumes that all moduli of the moduli set are odd and ROM lookup tables (LUTs) are mandatory to resolve the difficulty in the determination of the operand parity. The diagonal function [4] requires a large modulo SQ operation, which is usually implemented using large ROM LUTs. Another interesting technique is to do the residue comparison based on the New CRT [5], which combines the CRT and the MRC to reduce the residue computation delay. Other similar techniques [6], [7] can also be used to compare residue numbers. These techniques depend on ROMs that are addressed by the residue to get the mixed- radix (MR) representation for the ith orthogonal projection of X. Then, a log 2 n-level modulo adder tree is used to get the MR digits x 0 i . However, Mohan has pointed out in [8] that the last stage has carry propagation from the modulo adder network of one residue to another and introduces a relatively large delay. There is a large body of research on these methods in the literature [9], [10], [11], [12], [13], [14], [15], [16], [17], [18], [19], [20], [21], [22], [23], [24], [25], [26], [27]. Despite the theoretical validity of these algorithms, the VLSI design of residue comparators faces challenges due to the complexity and the ROM-based property of these algorithms. It is important to develop new residue compar- ison algorithms and propose VLSI comparators that are moduli parity independent, minimizing the utilization of ROM LUTs, and do not introduce any redundant modulus. In this paper, a new MR CRT is proposed that possesses both the advantages of the CRT and the MRC, which are parallel processing, small operations modulo P i only, and the efficiency of making residue comparison. Based on the proposed CRT, new residue comparators are developed for the three-moduli set f2 n 1; 2 n ; 2 n þ 1g. The FPGA 1624 IEEE TRANSACTIONS ON COMPUTERS, VOL. 57, NO. 12, DECEMBER 2008 . S. Bi is with Xilinx Inc., 2100 Logic Drive, San Jose, CA 95124. E-mail: [email protected]. . W.J. Gross is with the Department of Electrical and Computer Engineering, McGill University, 3480 University Street, Suite 633, Montreal, QC H3A 2A7, Canada. E-mail: [email protected]. Manuscript received 24 July 2006; revised 11 July 2007; accepted 16 June 2008; published online 25 July 2008. Recommended for acceptance by F. Lombardi. For information on obtaining reprints of this article, please send e-mail to: [email protected], and reference IEEECS Log Number TC-0286-0706. Digital Object Identifier no. 10.1109/TC.2008.126. 0018-9340/08/$25.00 ß 2008 IEEE Published by the IEEE Computer Society Authorized licensed use limited to: IEEE Xplore. Downloaded on November 18, 2008 at 14:24 from IEEE Xplore. Restrictions apply.

1624 IEEE TRANSACTIONS ON COMPUTERS, VOL. 57, NO. 12, …wjgross/papers/bi_gross_TC_2008.pdf · 2008-11-18 · The Mixed-Radix Chinese Remainder Theorem and Its Applications to Residue

  • Upload
    others

  • View
    0

  • Download
    0

Embed Size (px)

Citation preview

Page 1: 1624 IEEE TRANSACTIONS ON COMPUTERS, VOL. 57, NO. 12, …wjgross/papers/bi_gross_TC_2008.pdf · 2008-11-18 · The Mixed-Radix Chinese Remainder Theorem and Its Applications to Residue

The Mixed-Radix Chinese Remainder Theoremand Its Applications to Residue Comparison

Shaoqiang Bi and Warren J. Gross, Member, IEEE

Abstract—The Chinese remainder theorem (CRT) and the mixed-radix conversion (MRC) are two classic theorems used to convert aresidue number to its binary correspondence for a given moduli set fPn; . . . ; P2; P1g. The MRC is a weighted number system, and itrequires operations modulo Pi only, and hence, magnitude comparison is easily performed. However, the calculation of themixed-radix coefficients in the MRC is a strictly sequential process and involves complex divisions. Thus, the residue-to-binary (R/B)conversions and residue comparisons based on the MRC require a large delay. In contrast, the R/B conversion and residuecomparison based on the CRT are fully parallel processes. However, the CRT requires large operations modulo M ¼ Pn; . . . ; P2P1. Inthis paper, a new mixed-radix CRT is proposed that possesses both the advantages of the CRT and the MRC, which are parallelprocessing, small operations modulo Pi only, and the efficiency of making modulo comparison. Based on the proposed CRT, newresidue comparators are developed for the three-moduli set f2n � 1; 2n; 2n þ 1g. The FPGA implementation results show that theproposed modulo comparators are about 20 percent faster and smaller than one of the previous best designs.

Index Terms—Chinese remainder theorem, mixed-radix conversion, residue comparator, FPGA.

Ç

1 INTRODUCTION

INTEREST in the residue number system (RNS) in the face ofstandard number systems can be explained by the

emergence of application-specific integrated circuits (ASICs)that benefit from the speed, area, and power advantage of theRNS. Specifically, the RNS has been receiving significantattention for high-speed digital signal processing (DSP)computation with high precision for the intrinsic propertiesof the RNS such as carry-free operations, parallelism, andmodularity. The RNS is defined in terms of a set of mutuallyprime moduli that are independent of each other. Since thereis no carry propagation among arithmetic operations basedon each modulus, it is easy to implement RNS computationsin parallel, thus resulting in very high-speed and low-powerVLSI implementations [1].

However, due to the nonposition nature of the RNS, themagnitude comparison between residue numbers is muchmore complex than that in the weighed number system.Other residue arithmetic functions such as sign test, over-flow detection, and division suffer from the same difficulty.This difficulty prevents a wide variety of general-purposecomputations from taking advantage of the residue arith-metic. To do the residue number comparison, the traditionaltechniques use the Chinese remainder theorem (CRT) or themixed-radix conversion (MRC) [1]. A direct implementationof the CRT is inefficient since it is based on a large moduloMoperation, where M is the dynamic range of the RNS. TheMRC is a strictly sequential process and requires a longdelay. Some techniques based on the core function [2], parity

checking [3], or the diagonal function [4] have beenproposed to compare the magnitudes of residue numbers.The core functions require an iterative process of descentand lifting to find the critical core value. An improvedversion of this technique was presented in [2] to avoid theiterative process at the cost of a redundant modulus. Adifferent solution [3] to do the residue number comparisonassumes that all moduli of the moduli set are odd and ROMlookup tables (LUTs) are mandatory to resolve the difficultyin the determination of the operand parity. The diagonalfunction [4] requires a large modulo SQ operation, which isusually implemented using large ROM LUTs.

Another interesting technique is to do the residuecomparison based on the New CRT [5], which combinesthe CRT and the MRC to reduce the residue computationdelay. Other similar techniques [6], [7] can also be used tocompare residue numbers. These techniques depend onROMs that are addressed by the residue to get the mixed-radix (MR) representation for the ith orthogonal projectionofX. Then, a log2n-level modulo adder tree is used to get theMR digits x0i. However, Mohan has pointed out in [8] that thelast stage has carry propagation from the modulo addernetwork of one residue to another and introduces a relativelylarge delay. There is a large body of research on thesemethods in the literature [9], [10], [11], [12], [13], [14], [15],[16], [17], [18], [19], [20], [21], [22], [23], [24], [25], [26], [27].

Despite the theoretical validity of these algorithms, theVLSI design of residue comparators faces challenges due tothe complexity and the ROM-based property of thesealgorithms. It is important to develop new residue compar-ison algorithms and propose VLSI comparators that aremoduli parity independent, minimizing the utilization ofROM LUTs, and do not introduce any redundant modulus.

In this paper, a new MR CRT is proposed that possessesboth the advantages of the CRT and the MRC, which areparallel processing, small operations modulo Pi only, andthe efficiency of making residue comparison. Based onthe proposed CRT, new residue comparators are developedfor the three-moduli set f2n � 1; 2n; 2n þ 1g. The FPGA

1624 IEEE TRANSACTIONS ON COMPUTERS, VOL. 57, NO. 12, DECEMBER 2008

. S. Bi is with Xilinx Inc., 2100 Logic Drive, San Jose, CA 95124.E-mail: [email protected].

. W.J. Gross is with the Department of Electrical and ComputerEngineering, McGill University, 3480 University Street, Suite 633,Montreal, QC H3A 2A7, Canada. E-mail: [email protected].

Manuscript received 24 July 2006; revised 11 July 2007; accepted 16 June2008; published online 25 July 2008.Recommended for acceptance by F. Lombardi.For information on obtaining reprints of this article, please send e-mail to:[email protected], and reference IEEECS Log Number TC-0286-0706.Digital Object Identifier no. 10.1109/TC.2008.126.

0018-9340/08/$25.00 � 2008 IEEE Published by the IEEE Computer Society

Authorized licensed use limited to: IEEE Xplore. Downloaded on November 18, 2008 at 14:24 from IEEE Xplore. Restrictions apply.

Page 2: 1624 IEEE TRANSACTIONS ON COMPUTERS, VOL. 57, NO. 12, …wjgross/papers/bi_gross_TC_2008.pdf · 2008-11-18 · The Mixed-Radix Chinese Remainder Theorem and Its Applications to Residue

implementation results show that the proposed modulocomparators are about 20 percent faster and smaller thanone of the previous best designs.

The remaining sections of this paper are organized asfollows: In Section 2, a background overview of the RNSand different CRT algorithms is provided. In Section 3, theMR CRT is proposed. The proof of its correctness isestablished based on the modified CRT. Then, a newresidue comparison theorem is proposed based on the MRCRT in Section 4. The VLSI implementations of new residuecomparators for f2n � 1; 2n; 2n þ 1g are presented, and thearea cost and performance of the proposed comparator areevaluated and compared with previous designs in Section 5followed by the conclusion.

2 BACKGROUND MATERIALS

Let fPn; . . . ; P2; P1g be a set of positive numbers all greaterthan one. The Pi’s are called moduli, and then-tuple set fPn; . . . ; P2; P1g is called the moduli set. In orderto avoid redundancy, the moduli of an RNS must bepairwise relatively prime. For an integer number X, wehave xi ¼ X mod Pi (denoted as jXjPi ). Thus, a number X inRNS can be represented as X ¼ ðxn; . . . ; x2; x1Þ. Such arepresentation is unique for any integer X 2 ½0;M � 1�,where M ¼ Pn; . . . ; P2P1 is the dynamic range of the moduliset fPn; . . . ; P2; P1g [1]. To convert a residue numberðxn; . . . ; x2; x1Þ to its binary representation X, the MRCand the CRT are widely used.

Theorem 1 (MRC [1]). A number X can be computed by theformula

X ¼Xni¼1

viai; ð1Þ

where n > 1, vi ¼Qi�1

j¼1 Pj for 2 � i � n, v1 ¼ 1, and ai,which are called the MR digits, are computed by the formulasY1 ¼ X, Yi ¼ ðYi�1 � ai�1ÞjP�1

i�1jPi , and ai ¼ jYijPi .

We list a1, a2, and a3 as follows:

a1 ¼ x1;

a2 ¼ ðx2 � a1Þ P�11

�� ��P2

��� ���P2

;

a3 ¼ ððx3 � a1Þ P�11

�� ��P3� a2Þ P�1

2

�� ��P3

��� ���P3

:

MR representation is of great importance in residuecomputation for the following two related reasons [1]: 1) theMR system is a weighted number system, and hence,magnitude comparison is easily performed, and 2) the MRCprocedure requires operations modulo Pi only. However,the computation of the MR digits is a strictly sequentialprocess and is not as “parallel” as the CRT method. Theresidue-to-binary (R/B) conversion and the residue com-parison based on the MRC has a long delay and is notsuitable for high-speed design. In contrast, the CRT is afully parallel process.

Theorem 2 (CRT). The binary number X is computed by

X ¼Xni¼1

Ni N�1i

�� ��Pixi

����������M

; ð2Þ

where n > 1, Ni ¼M=Pi, and jN�1i jPi is the multiplicative

inverse of jNijPi defined by kN�1i jPiNijPi ¼ 1.

It can be noted that the CRT requires a binary innerproduct operation followed by a large modulo M operationthat is not efficient. This inefficiency makes the CRT-basedRNS algorithms such as residue comparison and R/Bconversion slow and complex. This real drawback makesVLSI design very difficult, especially for general moduli sets.In the literature, there exist extensive studies of the CRT, andsome good CRT theorems have been proposed [28], [7].

Theorem 3 (New CRT II [28]). The following algorithm,translate, finds the correct decimal representation of the RNSnumber X ¼ ðx1; x2; . . . ; xnÞ.

Algorithm: translateððx1; x2; . . . ; xnÞ; XÞif n ¼ 2t > 2 (n is an even number greater than 2)

then

translateððx1; . . . ; xtÞ; L1Þ, M1 ¼Qt

i¼1 Pitranslateððxtþ1; . . . ; xnÞ; L2Þ, M2 ¼

Qni¼tþ1 Pi

findnoðL1; L2;M1;M2; XÞend if

if n ¼ 2tþ 1 > 2 (n is an odd number greater than 2)

then

translateððx1; . . . ; xtÞ; L1Þ, M1 ¼Qt

i¼1 Pitranslateððxtþ1; . . . ; xnÞ; L2Þ, M2 ¼

Qni¼tþ1 Pi

findnoðL1; L2;M1;M2; XÞend if

if n ¼ 2 then

findnoðx1; x2; P1; P2; XÞend if

if n ¼ 1 then

X ¼ jx1jP1

end if

Procedure findno is defined as follows:

Algorithm: findnoðx1; x2; P1; P2; XÞfind a k0 such that jk0P2jP1

¼ 1

X ¼ x2 þ jk0ðx1 � x2ÞjP1P2

It can be noted that the New CRT II is designed using adivide-and-conquer approach. Each modulo multiplier inthe New CRT II is bounded by size

ffiffiffiffiffiMp

. Thus, efficientdesigns can be obtained based on the New CRT II for generalmoduli sets. However, the New CRT II utilizes logn-levelmodulo multipliers in sequence, which means that the totaldelay caused by the modulo operations increases with thenumber of the moduli that is OðlognÞ times.

Theorem 4 (modified CRT [7]). Given the moduli setfPn; . . . ; P2; P1g, the residue number xn; . . . ; x2; x1 is con-verted into the binary number X by

X ¼ x1 þ P1

Xni¼1

wix0i

����������Pn...P2

; ð3Þ

w h e r e n > 1, w1 ¼ ðN1jN�11 jP1

� 1Þ=P1, wi ¼ Ni=P1,x01 ¼ x1, and x0i ¼ jN�1

i jPixi, for i ¼ 2; 3; . . . ; n.

Comparing the CRT and the modified CRT, it can be notedthat the modified CRT reduces the modulo base byP1. Thus, itleads to an efficient converter design. However, for the

BI AND GROSS: THE MIXED-RADIX CHINESE REMAINDER THEOREM AND ITS APPLICATIONS TO RESIDUE COMPARISON 1625

Authorized licensed use limited to: IEEE Xplore. Downloaded on November 18, 2008 at 14:24 from IEEE Xplore. Restrictions apply.

Page 3: 1624 IEEE TRANSACTIONS ON COMPUTERS, VOL. 57, NO. 12, …wjgross/papers/bi_gross_TC_2008.pdf · 2008-11-18 · The Mixed-Radix Chinese Remainder Theorem and Its Applications to Residue

moduli sets with a large size, the modified CRT is still slow. If

the modulo base can be further reduced and the delay

becomes independent of the size of the moduli sets, then a

more efficient converter design can be obtained. Bi et al. in

[29] have proposed a modulo reduction theorem that can be

used to develop the new MR CRT in the next section.

Theorem 5 (modulo reduction theorem [29]). Given the

integers K;Pn; . . . ; P2; P1 and n > 1, we have

jKjPn ...P2P1¼ jKjP1

þXn�1

m¼1

Ymi¼1

PiKQmi¼1 Pi

� ���������Pmþ1

" #: ð4Þ

In the next section, we will propose the new MR CRT.

We need to use the following properties:

Lemma 1. j2n0Xj2n�1 ¼ xn�n0�1 . . .x0xn�1 . . .xn�n0for an n-bit

binary number X.

Lemma 2. j �Xj2n�1 ¼ xn�1 . . .x0 for any nonzero n-bit binary

number X.

3 THE NEW MIXED-RADIX CRT

In this section, we propose a novel MR CRT.

Theorem 6. Given fPn; . . . ; P2; P1g, the magnitude of a residue

number X ¼ ðxn; . . . ; x2; x1Þ is calculated as follows:

X ¼Xn�2

m¼1

�mþ1

Ymþ1

i¼1

Pi

" #þ �1P1 þ �0; ð5Þ

where �mþ1 ¼Pmþ2

i¼1 �ixi�Qmþ1

i¼2 Pi

j k��� ���Pmþ2

, �1 ¼ j�1x1 þ�2x2jP2

, �0 ¼ x1, n > 1, �1 ¼ ðN1jN�11 jP1

� 1Þ=P1, �i ¼MjN�1

i jPi=P1Pi, and M ¼ Pn; . . . ; P2P1 for i ¼ 2; 3; . . . ; n.

The floor function is indicated by b�c.Proof. The modulo operation of Theorem 4 can be

decomposed using Theorem 5 as follows:

X ¼x1 þ P1

Xni¼1

wix0i

����������Pn...P2

¼x1 þ P1

Xni¼1

wix0i

����������P2

þXn�2

m¼1

Pni¼1 wix

0iQmþ1

i¼2 Pi

$ %����������Pmþ2

Ymþ1

i¼2

Pi

24

35

8<:

9=;

¼x1 þ P1

Xni¼1

wix0i

����������P2

þP2P1

Pni¼1 wix

0i

P2

� ���������P3

þ � � � þ Pn�1 . . .P2P1

Pni¼1 wix

0i

Pn�1 . . .P3P2

� ���������Pn

:

Notice that

Xni¼1

wix0i ¼w1x

01 þ

N2

P1x02 þ

N3

P1x03 þ � � � þ

Nn

P1x0n

¼N1 N

�11

�� ��P1�1

P1x1 þ P3P4 . . .Pn N

�12

�� ��P2x2 þ P2P4

. . .Pn N�13

�� ��P3x3 þ � � � þ P2P3 � � �Pn�1 N

�1n

�� ��Pnxn

¼ �1x1 þ �2x2 þ � � � þ �nxn;

where �1 ¼ ðN1jN�11 jP1

� 1Þ=P1, �i ¼MjN�1i jPi=P1Pi, and

M ¼ Pn; . . . ; P2P1 for i ¼ 2; 3; . . . ; n. Thus, we have

X ¼x1 þ P1j�1x1 þ �2x2jP2þ P2P1

�1x1 þ �2x2 þ �3x3

P2

� ���������P3

þ P3P2P1�1x1 þ �2x2 þ �3x3 þ �4x4

P2P3

� ���������P4

þ � � � þ Pn�1 . . .P2P1�1x1 þ �2x2 þ � � � þ �nxn

P2P3 . . .Pn�1

� ���������Pn

¼�0 þ �1P1 þXn�2

m¼1

�mþ1

Ymþ1

i¼1

Pi

" #:

tuTheorem 6 decomposes the large modulo M ¼

Pn; . . . ; P2P1 operation of the CRT to a number of smalloperations modulo Pi only. Theorem 6 provides an MR formof the CRT that converts residue numbers to weightednumbers, and hence, magnitude comparison is easilyperformed. This New CRT is different from the MRCprocess. The calculation of the MR coefficients in the MRCis a strictly sequential process, whereas all �i’s of Theorem 6can be computed in a fully parallel way. Hence, Theorem 6possesses both the advantages of the CRT and the MRC,which are parallel processing, small operations modulo Pionly, and the efficiency of making residue comparison, andthus leads to efficient VLSI designs of residue comparators.

4 RESIDUE NUMBER COMPARISON

The MR CRT considerably reduces the complexity of theCRT by decomposing the large modulo M operation toseveral small modulo operations in parallel. In this section,we use this parallelism to present new residue comparisonalgorithms for f2n � 1; 2n; 2n þ 1g that are highly concurrentand suitable for VLSI implementation.

Definition 1. We define �n�1; . . . ; �1; �0 in Theorem 6 as thekernel set of X ¼ ðxn; . . . ; x2; x1Þ and denote it asEðxÞ ¼ ð�n�1; . . . ; �1; �0Þ.Similarly, we can define the kernel set EðyÞ ¼

ð�n�1; . . . ; �1; �0Þ for Y ¼ ðyn; . . . ; y2; y1Þ. With Definition 1,the comparison of two residue numbers is simplified tocomparing their kernel sets [30], [9]. Given any two residuenumbers X ¼ ðxn; . . . ; x2; x1Þ and Y ¼ ðyn; . . . ; y2; y1Þ withthe general moduli set fPn; . . . ; P2; P1g, we can do thecomparison using their kernel sets EðxÞ ¼ ð�n�1; . . . ; �1; �0Þand EðyÞ ¼ ð�n�1; . . . ; �1; �0Þ. Without losing generality,assuming �h and �h are the first occurring pair of nonequalelements in EðxÞ and EðyÞ respectively, namely, �h 6¼ �hand �j ¼ �j for n > j > h � 0, we have that if �h > �h, thenX > Y ; else, X < Y . However, if �h ¼ �h for n > h � 0, thenwe have X ¼ Y .

Based on Theorem 6 and Definition 1, we can directlyderive a new residue number comparison algorithm for themost popular three-moduli set f2n; 2n þ 1; 2n � 1g as thefollowing.

Theorem 7. Given any two positive integers X ¼ ðx3; x2; x1Þand Y ¼ ðy3; y2; y1Þ with the moduli set f2n � 1; 2n; 2n þ 1g,we can do the comparison using their kernel sets EðxÞ ¼ð�2; �1; �0Þ ¼ ðAX;BX; x1Þ a n d EðyÞ ¼ ð�2; �1; �0Þ ¼ðAY ;BY ; y1Þ. For the first occurring �h 6¼ �h, namely,

1626 IEEE TRANSACTIONS ON COMPUTERS, VOL. 57, NO. 12, DECEMBER 2008

Authorized licensed use limited to: IEEE Xplore. Downloaded on November 18, 2008 at 14:24 from IEEE Xplore. Restrictions apply.

Page 4: 1624 IEEE TRANSACTIONS ON COMPUTERS, VOL. 57, NO. 12, …wjgross/papers/bi_gross_TC_2008.pdf · 2008-11-18 · The Mixed-Radix Chinese Remainder Theorem and Its Applications to Residue

�j ¼ �j, where 3 > j > h � 0, we have that if �h > �h, then

X > Y ; else, X < Y . However, if �h ¼ �h for 3 > h � 0,

then we have X ¼ Y . Here, AX and BX are defined as follows

(AY and BY can be calculated in the same way):

X ¼ ð2n þ 1Þ2nAX þ ð2n þ 1ÞBX þ x1; ð6Þ

where n > 1, and

AX ¼

TX1þ TX2

þ TX3j j2n�1;

for x1 2 ½0; 2n � 1�; x2 � x1;

TX1þ TX2

þ TX3� 1j j2n�1;

for x1 2 ½0; 2n � 1�; x2 < x1;

ð2n�1 � 1Þ þ TX2þ TX3

�� ��2n�1

;

for x1 ¼ 2n;

8>>>>>>>><>>>>>>>>:

BX ¼jx2 � x1j2n ; for x1 2 ½0; 2n � 1�;x2; for x1 ¼ 2n;

where

TX1¼ j2n�1x1j2n�1 ¼ x1;0x1;n�1 . . .x1;1;

TX2¼ j � x2j2n�1 ¼ x2;n�1 . . .x2;0;

TX3¼ j2n�1x3j2n�1 ¼ x3;0x3;n�1 . . .x3;1:

Proof. For f2n; 2n þ 1; 2n � 1g, referred to Theorem 6, we

have X ¼ ð2n þ 1Þ2nAX þ ð2n þ 1ÞBX þ x1, where n > 1,

and

AX ¼ð22n�1 � 1Þx1 þ ð2n � 1Þ2x2 þ 22n�1x3

2n

$ %����������2n�1

¼ 2n�1x1 þ 2nx2 � 2x2 þ 2n�1x3 þx2 � x1

2n

j k��� ���2n�1

;

BX ¼ ð22n�1 � 1Þx1 þ ð2n � 1Þ2x2

�� ��2n

¼ x2 � x1j j2n :

1. I f x1 2 ½0; 2n � 1�, n a m e l y , x1;n ¼ 0, s i n c ex22½0; 2n�1�, we have x2�x12½�ð2n�1Þ; 2n�1�:

I. For x2 � x1, x2 � x1 2 ½0; 2n � 1�; then,ðx2�x1Þ=2n2½0; 1Þ. Thus, ðx2�x1Þ=2nb c¼0.We have

AX ¼ 2n�1x1 þ 2nx2 � 2x2 þ 2n�1x3

�� ��2n�1

¼ 2n�1x1 � x2 þ 2n�1x3

�� ��2n�1

¼ TX1þ TX2

þ TX3j j2n�1;

BX ¼ jx2 � x1j2n ;

where

TX1¼ j2n�1x1j2n�1 ¼ x1;0x1;n�1 . . .x1;1 by Lemma 1;

TX2¼ j � x2j2n�1 ¼ x2;n�1 . . .x2;0 by Lemma 2;

TX3¼ j2n�1x3j2n�1 ¼ x3;0x3;n�1 . . .x3;1 by Lemma 1:

II. For x2 < x1, x2 � x1 2 ½�ð2n � 1Þ; 0Þ; then,ðx2 � x1Þ=2n 2 ð�1; 0Þ. We have

AX ¼ 2n�1x1 þ 2nx2 � 2x2 þ 2n�1x3 � 1�� ��

2n�1

¼ TX1þ TX2

þ TX3j j2n�1;

BX ¼ jx2 � x1j2n :

2. If x1 ¼ 2n, namely, x1;n ¼ 1, since x2 2 ½0; 2n � 1�,we have x2 � x1 2 ½�2n;�1�; thus, bðx2 � x1Þ=2nc 2 ½�1; 0Þ. We have

AX ¼ 2n�1x1 þ 2nx2 � 2x2 þ 2n�1x3 � 1�� ��

2n�1

¼ 2n�12n � 1� x2 þ 2n�1x3

�� ��2n�1

¼ ð2n�1 � 1Þ þ TX2þ TX3

�� ��2n�1

;

BX ¼ jx2 � x1j2n¼ jx2 � 2nj2n¼ x2:

In conclusion, Theorem 7 holds for any residue numberðx3; x2; x1Þ. tuThe example shown in Fig. 1 demonstrates the improve-

ment of the new residue comparison algorithms over theprevious algorithms [4], [5] in the literature.

BI AND GROSS: THE MIXED-RADIX CHINESE REMAINDER THEOREM AND ITS APPLICATIONS TO RESIDUE COMPARISON 1627

Fig. 1. Example 1.

Authorized licensed use limited to: IEEE Xplore. Downloaded on November 18, 2008 at 14:24 from IEEE Xplore. Restrictions apply.

Page 5: 1624 IEEE TRANSACTIONS ON COMPUTERS, VOL. 57, NO. 12, …wjgross/papers/bi_gross_TC_2008.pdf · 2008-11-18 · The Mixed-Radix Chinese Remainder Theorem and Its Applications to Residue

When using the diagonal function in [4], the aboveresidue number comparison needs a modulo-191 addition,which is not the low cost modulus of 2n � 1. The length ofthe modulo addition is 8 bits. By using the algorithm in [5],which is based on the New CRT, two levels of 4-bit modulomultipliers in series are required. Both the modulo-191addition and the two modulo multipliers are implementedusing ROM LUTs as suggested by the authors [4], [5]. Ifusing the proposed algorithms, the same residue compar-ison requires only one 3-bit modulo-7 addition, which is alow cost modulus and can be implemented very efficientlywithout using any ROM LUTs.

With Theorem 7, we can implement a high-speed designof the residue number comparator for the three-moduli setf2n � 1; 2n; 2n þ 1g. There are different ways to do theimplementations. The approaches using a parallel structure(high-speed design) and using a cascade structure (cost-effective design) are evaluated in the following section.

5 NEW RNS COMPARATORS FOR f2n�1; 2n; 2nþ1gIn this section, based on Theorem 7, we present two high-speed and cost-effective residue comparators for the three-moduli set f2n � 1; 2n; 2n þ 1g.

Based on Theorem 7, to compare two residue numbersðx3; x2; x1Þ and ðy3; y2; y1Þ, we need to calculate four values:AX , BX, AY , and BY . Here, we only present how to derivethe values of AX and BX since we can get AY and BY bythe same way. It is easy to see that AX is on the criticalpath that determines the delay of the comparator. Based onTheorem 7, the formulas of AX can be rewritten as follows:

AX ¼jZj2n�1; for x1 2 ½0; 2n � 1�; x2 � x1;jZ � 1j2n�1; for x1 2 ½0; 2n � 1�; x2 < x1;jZ0j2n�1; for x1 ¼ 2n;

8<: ð7Þ

where Z ¼ TX1þTX2

þTX3, and Z0 ¼ ð2n�1�1ÞþTX2

þTX3.

It is noted that there is a modulo decrement operationjZ � 1j2n�1 in (7) that serves as a building block in theproposed residue comparators. There are different ways toimplement the proposed comparators. One way is to do thecalculations of jZ � 1j2n�1 and jZj2n�1 in parallel and leadsto a high-speed concurrent design. The other way is tocompute jZj2n�1 at first and then use a modulo decrementerto calculate jZ � 1j2n�1, which reduces the hardwareresources and results in a cost-effective design.

In the following sections, we first present two designschemes of the AX and BX generator in Figs. 2 and 3,

respectively. Fig. 5 is the structure of a new modulodecrementer. Then, we introduce the residue comparators,as shown in Fig. 6.

5.1 Generator with Parallel Structure—Generator 1

We use the following three steps to present the parallelstructure of Generator 1, which is used to calculate the AX

and BX.

5.1.1 Calculation of jZj2n�1 and jZ0j2n�1

Based on (7), we can see that the only difference between Zand Z0 is the first item, TX1

for Z and 2n�1 � 1 for Z0. We canintegrate the calculation of jZj2n�1 and jZ0j2n�1 using onemux (multiplexer) array, one stage of n-bit carry-save adder(CSA) with end-around-carry (EAC) and one n-bit 1’scomplement adder, as shown in Fig. 2. The detail structureof CSA with EAC can be found in [31]. The selecting signalof the mux array is x1;n. When x1;n ¼ 1, namely, x1 ¼ 2n, wehave the output of the mux array as 2n�1 � 1; otherwise,we have the output as TX1

. And the n-bit 1’s complementadder can be efficiently implemented as an n-bit carry-propagation adder (CPA) with EAC, as suggested in [31], orusing the parallel-prefix adder architecture, as presentedin [32]. The former is a cost-effective design, but the delay islarge, whereas the latter provides a high-speed design builtat extra cost of complexity. Besides the above two designschemes, there exist many other choices in the literature forthe 1’s complement adder whose area and delay stronglydepends on its implementation.

5.1.2 Calculation of jZ � 1j2n�1

According to (7), if we compute the value of jZ � 1j2n�1

simply as jTX1þ TX2

þ TX3� 1j2n�1, then we have to manage

four operands. We can simplify the computation as thefollowing. Based on Lemma 2, we have

jTX1þ TX2

þ TX3� 1j2n�1

¼ jTX1þ TX2

þ TX3þ ð11 . . . 10Þ2j2n�1:

It may be noted that the full adder (FA) cells having logicone as one input can be simplified to an exclusive-NOR

(XNOR) gate and an OR gate, while the FAs having logic zero

1628 IEEE TRANSACTIONS ON COMPUTERS, VOL. 57, NO. 12, DECEMBER 2008

Fig. 2. AX and BX Generator 1.

Fig. 3. AX and BX Generator 2.

Authorized licensed use limited to: IEEE Xplore. Downloaded on November 18, 2008 at 14:24 from IEEE Xplore. Restrictions apply.

Page 6: 1624 IEEE TRANSACTIONS ON COMPUTERS, VOL. 57, NO. 12, …wjgross/papers/bi_gross_TC_2008.pdf · 2008-11-18 · The Mixed-Radix Chinese Remainder Theorem and Its Applications to Residue

as one input can be reduced to an exclusive-OR (XOR) gateand an AND gate. Then, instead of arranging four operandsin two stages of CSAs and one n-bit 1’s complement adderto compute jTX1

þ TX2þ TX3

� 1j2n�1, we can perform thesummation of jTX1

þ TX2þ TX3

þ ð11 � � � 10Þ2j2n�1, as shownin Fig. 2. The n FA cells of the first stage of CSA can bereduced to n XOR/XNOR gates and n AND/OR gates, thussaving hardware.

5.1.3 Decision of Ax and Bx

Knowing the value of jZj2n�1, jZ0j2n�1, and jZ � 1j2n�1, wecan determine AX using a mux array. Based on (7), we cansee that AX equals to jZ � 1j2n�1 when x1 2 ½0; 2n � 1� andx2 < x1. Otherwise, AX takes the value of jZj2n�1 or jZ0j2n�1.Accordingly, the mux array uses the borrow out signal B ofthe subtractor x2 � x01 as its selecting signal. Here, x01consists of the n-bit least significant bits (LSBs) of x1. Then,we have x1 ¼ 2nx1;n þ x01. If x1 2 ½0; 2n � 1� and x2 < x1,namely, x1;n ¼ 0 and x2 < x01, then there is a borrow outputfrom the subtractor. Accordingly, AX has the value ofjZ � 1j2n�1, which is the output of 1’s complement adder 2.If x1 2 ½0; 2n � 1� and x2 � x1, namely, x1;n ¼ 0 and x2 > x01,there is no borrow, and AX takes the output of1’s complement adder 1 as its value. Then, we haveAX ¼ jZj2n�1. When x1 ¼ 2n ) x1;n ¼ 1, x01 ¼ 0, there is noborrow either. Thus, AX still takes the output of1’s complement adder 1 as its value, namely, AX ¼ jZ0j2n�1.

If we represent the subtraction x2 � x01 as x2 � x01 ¼2nBþD, where B is the borrow and D is the difference,thenBX is the differenceD of the subtractor x2 � x01, namely,BX ¼ D ¼ jx2 � x01j2n . For example, given x01 ¼ 6 ¼ ð110Þ2and x2 ¼ 1 ¼ ð001Þ2, we have x2 � x01 ¼ �5 ¼ �23 þ ð011Þ2,where BX ¼ D ¼ ð011Þ2. Based on Theorem 7, this propertycan be easily verified as follows:

G i v e n X ¼ ðx3; x2; x1Þ ¼ ðjXj2n�1; jXj2n ; jXj2nþ1Þ, w eknow that x1 ¼ jXj2nþ1 ¼ 2nx1;n þ x01 and x2 ¼ jXj2n . Ifx1 2 ½0; 2n � 1�, namely, x1;n ¼ 0, we have

BX ¼ jx2 � x1j2n ¼ x2 � 2nx1;n þ x01� �� ��

2n¼ x2 � x01�� ��

2n¼ D:

If x1 ¼ 2n, namely, x01 ¼ 0, we have

BX ¼ x2 ¼ jx2j2n ¼ x2 � x01�� ��

2n¼ D:

The whole design scheme of AX and BX Generator 1 canbe found in Fig. 2. It consists of n OR/AND gates, n XOR/XNOR gates, n inverters, 2n muxes, 3n FAs, and two n-bit 1’s

complement adders. The delay of Generator 1 is the sum ofthe delay of an XOR tXOR, the delay of an FA tFA, the delay ofan n-bit 1’s complement adder t1CAðnÞ, and the delay of amux tmux, i.e., tGenerator1 ¼ tXOR þ tFA þ t1CAðnÞ þ tmux.

5.2 Generator with Cascade Structure—Generator 2

Another way of computing AX and BX is to arrange thecalculations of jZj2n�1, jZ0j2n�1 and jZ � 1j2n�1 in a cascadestructure, as shown in Fig. 3. There are also three steps inGenerator 2. The first step is the calculation of jZj2n�1 andjZ0j2n�1 which has the same implementation scheme as thestep 1 in Generator 2. The second step is the calculation ofjZ � 1j2n�1. Knowing that jZ � 1j2n�1 ¼ kZj2n�1 � 1j2n�1, wecan build in a modulo 2n � 1 decrementer following the firststep. Depending on x1;n ¼ 0 or 1, the input of the modulodecrementer is jZj2n�1 or jZ0j2n�1, and the correspondingoutput is jZ � 1j2n�1 or jZ0 � 1j2n�1. Based on (7), we decidethe correct values of AX and BX using a mux array in thethird step. The selecting signal is the borrow out signal B ofthe subtractor x2 � x01. If x1;n ¼ 0 and x2 < x01, then there is aborrow out from the subtractor. Accordingly, AX has thevalue of jZ � 1j2n�1, which is the output of the modulodecrementer. If x1;n ¼ 0 and x2 � x01, there is no borrow, andAX takes the output of the 1’s complement adder as itsvalue, namely, AX ¼ jZj2n�1. When x1 ¼ 2n ) x1;n ¼ 1 andx01 ¼ 0, there is no borrow out. Thus, AX still takes theoutput of the 1’s complement adder as its value, namely,AX ¼ jZ0j2n�1. As to the computation of BX , we havediscussed it in the third step of Generator 1. Namely, thedifference of the subtractor x2 � x01 gives the value of BX .

There are different ways to design the modulo 2n � 1decrementer of jZ � 1j2n�1 [10]. An efficient design has beengiven in [33].

Proposition 1. Given any n-bit unsigned binary inputZ ¼ Zn�1 . . .Z1Z0, we get its modulo decrement result Y ¼jZ � 1j2n�1 as follows:

Y ¼ jZ � 1j2n�1 ð8Þ

¼ Zj ðZj�1 þ � � � þ Z1 þ Z0Þ; 1 � j � n� 1;Z0 ðZn�1 þ � � � þ Z1 þ Z0Þ; j ¼ 0:

�ð9Þ

The decrement operation is illustrated by the example inFig. 4.

BI AND GROSS: THE MIXED-RADIX CHINESE REMAINDER THEOREM AND ITS APPLICATIONS TO RESIDUE COMPARISON 1629

Fig. 4. Example 2. Fig. 5. The mux-based modulo decrementer.

Authorized licensed use limited to: IEEE Xplore. Downloaded on November 18, 2008 at 14:24 from IEEE Xplore. Restrictions apply.

Page 7: 1624 IEEE TRANSACTIONS ON COMPUTERS, VOL. 57, NO. 12, …wjgross/papers/bi_gross_TC_2008.pdf · 2008-11-18 · The Mixed-Radix Chinese Remainder Theorem and Its Applications to Residue

Based on Proposition 1, we can implement a mux-basedmodulo 2n � 1 decrementer, as shown in Fig. 5. In (9), theXNOR and the XOR operations can be implemented using amux array. The series of OR operations Zn�1 þ � � � þ Z1 þ Z0

can be implemented using logn stages of OR gates, which iscalled as the decision module in Fig. 5. Then, the delayintroduced by this mux-based modulo decrementer is onlythe delay of dlogne OR gates plus the delay of a mux, whered�e is the ceiling function. The required hardware consistsof n

2 logn �

OR gates, n inverters, and n muxes. Forimplementation in an FPGA, the data flow in eachconfigurable logic block (CLB) is from left to right. TheLUT for combinational logic implementation is on the left,and the muxes are on the right. The design in Fig. 5 pairs upOR gates and muxes. This structure has the advantage thatit can be easily placed into the CLB and achieve the bestcase performance.

The Generator 2 with cascade structure in Fig. 3 consistsof n

2 logn �

OR gates, 3n muxes, n inverters, 2n FAs, and onen-bit 1’s complement adder. The delay of Generator 2 is thesum of the delay of dlogne OR gates tOR, the delay of an FAtFA, the delay of an n-bit 1’s complement adder t1CAðnÞ, andthe delay of three muxes tmux, i.e., tGenerator2 ¼ dlognetOR þtFA þ t1CAðnÞ þ 3tmux.

Knowing the values of AX , BX, AY , and BY based oneither Generator 1 or Generator 2, we can compare themagnitudes of X and Y using Theorem 7. As shown inFig. 6, we use an n-bit binary comparator to compare AX

and AY . In the case of AX ¼ AY , we have E1 ¼ 1. IfAX > AY , then C1 ¼ 1, and E1 ¼ 0. If AX < AY , thenC1 ¼ 0, and E1 ¼ 0. Similarly, the other two binarycomparators are used to compare BX and BY and x1 andy1. There are two output signals of the proposed residuecomparator. One is EXY , which is used to indicate X ¼ Y

when EXY ¼ 1. Since we have E1 ¼ E2 ¼ E3 ¼ 1 in the caseof X ¼ Y , we can generate EXY using a three-input AND

gate, as shown in Fig. 6. The other signal is CXY . If X > Y ,then CXY ¼ 1. If X < Y , then CXY ¼ 0. Based on Theorem 7,we can see that CXY ¼ C1 if E1 ¼ 0, CXY ¼ C2 if E1 ¼ 1 andE2 ¼ 0, or CXY ¼ C3 if E1 ¼ 1 and E2 ¼ 1. Two muxesconnected in a cascade way as shown in Fig. 6 canimplement the logic for CXY . The proposed residuecomparator consists of two AX and BX generators, threebinary comparators, one three-input AND gate, and twomuxes. The delay of the proposed residue comparator is thesum of the delay of an AX and BX generator, the delay of anðnþ 1Þ-bit binary comparator tBCðnþ1Þ, and the delay of twomuxes, i.e., tComparator ¼ tGenerator1or2 þ tBCðnþ1Þ þ 2tmux.

5.3 Performance Evaluation

In this section, we present the performance evaluation ofour new residue comparators and compare it with previousrelated algorithms.

Based on Theorem 7, modulo 2n � 1 is the only requiredmodulo operation in the proposed residue comparisonalgorithm for f2n � 1; 2n; 2n þ 1g. Table 1 is the summary ofthe performances of the previous residue comparisonalgorithms. The “complexity” refers to the largest modulooperations or the largest integers involved in the residuecomparison operation, which indicates the delay and thecomplexity of the residue comparators. It can be noted thatthe previous algorithms are more complex than our newalgorithm. On the contrary, the proposed algorithm uses thesmallest modulo operation and does not introduce anyredundant modulus. In summary, our new algorithm is thebest residue comparison algorithm based on the criterialisted in Table 1.

Recently, many fast R/B converter designs have beenpresented for f2n � 1; 2n; 2n þ 1g in the literature. The CRT-based residue comparison algorithms have benefited fromthis technical innovation. For the convenience of compar-ison, we show a residue comparator in Fig. 7 that is one ofthe fastest existing VLSI converters for f2n � 1; 2n; 2n þ 1g.Based on X¼x2þ2njðA1þA2þCnþnÞþ2nðB1þB2Þj22n�1¼x2 þ 2nðBX þ 2nAXÞ, it has been proposed in [34] asConverter III, which uses two n-bit adders to compute AX

and BX , as shown in Fig. 7a. Then, we can compare twonumbers X and Y , as shown in Fig. 7b.

To get a practical performance measure, the proposedcomparators and the comparator based on Converter III in[34] are implemented using the most advanced Xilinx FPGAtechnology. The synthesis and implementation tools areXilinx Synthesis Tool (XST) and Xilinx Integrated Software(ISE) flow 9.2i. The target technology is a Xilinx Virtex-5

1630 IEEE TRANSACTIONS ON COMPUTERS, VOL. 57, NO. 12, DECEMBER 2008

Fig. 6. The proposed residue comparator.

TABLE 1Performance Evaluation of Different Residue Comparison Algorithms

Authorized licensed use limited to: IEEE Xplore. Downloaded on November 18, 2008 at 14:24 from IEEE Xplore. Restrictions apply.

Page 8: 1624 IEEE TRANSACTIONS ON COMPUTERS, VOL. 57, NO. 12, …wjgross/papers/bi_gross_TC_2008.pdf · 2008-11-18 · The Mixed-Radix Chinese Remainder Theorem and Its Applications to Residue

xc5vlx50t-ff665-1 FPGA. The performance evaluation iscarried out in terms of area and delay at the layout level.The reported area is evaluated using the number ofoccupied slices. The results are presented in Table 2. It canbe seen that C2, which is based on Generator 1, is the fastestdesign. C2 is faster than C1, which is based on Converter IIIin [34], by around 20 percent for small and middlewordwidth. For a large wordwidth such as 64 bits, thepercentage drops to around 12 percent. The reason is thatthe FPGA routing becomes more difficult when thewordwidth is large. When the design becomes morecomplex, the available FPGA routing resource is compara-tively decreased. As a consequence, more signals cannot berouted locally and large interconnection delay is introduced.For the applications where area is of prime importance, C3,which is based on Generator 2, is the best choice since itconsumes around 20 percent less hardware resource thanthe comparator in Fig. 7. The reason for such improvementis that the final modulo summation of the converter in [34]

based on 22n � 1. The new residue comparator is derived

from Theorem 7, where modulo 2n � 1 is the only required

modulo operation. Thus, the proposed residue comparator

reduces the modulo size by half. Since the modulo part is the

critical path of the residue comparator, a high-speed

implementation is obtained compared to the previous

works.

6 CONCLUSION

In this paper, a new MR CRT has been proposed that

possesses both the advantages of the CRT and the MRC,

which are parallel processing, small operations modulo Pionly, and the efficiency of making comparison. Based on the

proposed CRT, new residue comparators have been

developed for the three-moduli set f2n � 1; 2n; 2n þ 1g. The

FPGA implementation results show that the proposed

modulo comparators are about 20 percent faster and

smaller than one of the previous best designs.

REFERENCES

[1] N. Szabo and R. Tanaka, Residue Arithmetic and Its Applications toComputer Technology. McGraw-Hill, 1967.

[2] D.D. Miller, R.E. Altschul, J.R. King, and J.N. Polky, “Analysis ofthe Residue Class Core Function of Akushskii, Burcev and Pak,”Residue Number System Arithmetic, Modern Applications in DigitalSignal Processing, M.A. Soderstrand, W.C. Jenkins, G.A. Jullien,and F.J. Taylor, eds., pp. 390-402, IEEE Press, 1985.

[3] M. Lu and J. Chiang, “A Novel Division Algorithm for theResidue Number System,” IEEE Trans. Computers, vol. 41, no. 8,pp. 1026-1032, Aug. 1992.

[4] G. Dimauro, S. Impedovo, and G. Pirlo, “A New Technique forFast Number Comparison in Residue Number System,” IEEETrans. Computers, vol. 42, no. 5, pp. 608-612, May 1993.

[5] Y. Wang, X. Song, and M. Aboulhamid, “A New Algorithm forRNS Magnitude Comparison Based on New Chinese RemainderTheorem II,” Proc. Ninth Great Lakes Symp. VLSI (GSLVLSI ’99),pp. 362-365, 1999.

[6] C.H. Huang, “A Fully Parallel Mixed-Radix Conversion Algo-rithm for Residue Number Applications,” IEEE Trans. Computers,vol. 32, no. 4, pp. 398-402, Apr. 1983.

[7] W. Wang, M.N.S. Swamy, M.O. Ahmad, and Y. Wang, “A Studyof Residue-to-Binary Converters for Three-Moduli Sets,” IEEETrans. Computers. vol. 50, no. 2, pp. 235-243, Feb. 2003.

[8] P.V.A. Mohan, “Comments on “Residue-to-Binary ConvertersBased on New Chinese Remainder Theorem”,” IEEE Trans.Circuits and Systems, Part II, vol. 47, no. 12, p. 1541, Dec. 2000.

[9] P.V.A. Mohan, “Evaluation of Fast Conversion Techniques forBinary-Residue Number Systems,” IEEE Trans. Computers, vol. 45,no. 10, pp. 1107-1109, Oct. 1998.

[10] P.V.A. Mohan, “Comments on ’Breaking the 2n-Bit Carry-Propagation Barrier in Residue to Binary Conversion for the ½2n �1; 2n; 2n þ 1� Moduli Set’,” IEEE Trans. Computers, vol. 48, no. 8,p. 1031, Aug. 2001.

BI AND GROSS: THE MIXED-RADIX CHINESE REMAINDER THEOREM AND ITS APPLICATIONS TO RESIDUE COMPARISON 1631

Fig. 7. The residue comparator based on [34]. (a) Converter III [34].

(b) Comparator.

TABLE 2Complexity and Delay Comparison of CRT-Based Residue Comparators

Authorized licensed use limited to: IEEE Xplore. Downloaded on November 18, 2008 at 14:24 from IEEE Xplore. Restrictions apply.

Page 9: 1624 IEEE TRANSACTIONS ON COMPUTERS, VOL. 57, NO. 12, …wjgross/papers/bi_gross_TC_2008.pdf · 2008-11-18 · The Mixed-Radix Chinese Remainder Theorem and Its Applications to Residue

[11] W.K. Jenkins and J.V. Krogmeier, “The Design of Dual-ModeComplex Signal Processors Based on Quadratic Modular NumberCodes,” IEEE Trans. Circuits and Systems, vol. 34, pp. 354-364, 1987.

[12] S. Andraros and H. Ahmad, “A New Efficient MemorylessResidue to Binary Converter,” IEEE Trans. Circuits and Systems,vol. 35, pp. 1441-1444, Nov. 1988.

[13] M. Bhardwaj, A.B. Premkumar, and T. Srikanthan, “Breaking the2n-bit Carry Propagation Barrier in Residue to Binary Conversionfor the f2n � 1; 2n; 2n þ 1g Modula Set,” IEEE Trans. Circuits andSystems, Part I, vol. 45, no. 9, pp. 998-1002, Sept. 1998.

[14] M. Bhardwaj, T. Srikanthan, and T. Clarke, “A Residue Converterfor the 4-Moduli Superset f2n � 1; 2n; 2n þ 1; 2nþ1 þ 1g,” Proc. 14thIEEE Symp. Computer Arithmetic, Apr. 1999.

[15] A. Mohan, RNS: Algorithms and Architectures. Kluwer AcademicPublishers, 2002.

[16] B. Bernardson, “Fast Memoryless, over 64 Bits, Residue to DecimalConverter,” IEEE Trans. Circuits and Systems, vol. 32, pp. 298-300,Mar. 1985.

[17] K.M. Ibrahim and S. Saloum, “An Efficient Residue to BinaryConverter Design,” IEEE Trans. Circuits and Systems, vol. 35,pp. 1156-1158, Sept. 1988.

[18] G. Bi and E. Jones, “Fast Conversion between Binary and ResidueNumbers,” Electronics Letters, vol. 24, pp. 1195-1197, Sept. 1988.

[19] A. Dhurkadas, “Comments on ’An Efficient Residue to BinaryConverter Design’,” IEEE Trans. Circuits and Systems, Part II,vol. 37, pp. 849-850, 1990.

[20] K.A. Dhurkadas, “A High Speed Realization of a Residue toBinary Number System Converter,” IEEE Trans. Circuits andSystems II, vol. 45, no. 3, pp. 446-447, Mar. 1998.

[21] D. Gallaher, F.E. Petry, and P. Srinivasan, “The Digit ParallelMethod for Fast RNS to Weighted Number System Conversion forSpecific Moduli ð2k � 1; 2k; 2k þ 1Þ,” IEEE Trans. Circuits andSystems, Part II, vol. 44, pp. 53-57, Jan. 1997.

[22] R. Conway and J. Nelson, “Fast Converter for 3 Moduli RNSUsing New Property of CRT,” IEEE Trans. Computers, vol. 48,no. 8, pp. 852-860, Aug. 1999.

[23] Y. Wang, M.N.S. Swamy, and M.O. Ahmad, “Three NumberModuli Sets Based Residue Number Systems,” IEEE Trans.Computers, vol. 46, no. 2, pp. 180-183, Feb. 1999.

[24] P.V.A. Mohan, “Comments on ’The Digit Parallel Method forFast RNS to Weighted Number System Conversion for SpecificModuli ð2k � 1; 2k; 2k þ 1Þ’,” IEEE Trans. Circuits and Systems, PartII, vol. 47, no. 9, pp. 972-974, 2000.

[25] Z. Wang, G.A. Jullien, and W.C. Miller, “An Improved Residue toBinary Converter,” IEEE Trans. Computers, vol. 47, no. 9, pp. 1437-1440, Sept. 2000.

[26] W. Wang, M. Swamy, M. Ahmad, and Y. Wang, “A High-SpeedResidue-to-Binary Converter for Three-Moduli ð2k; 2k�1; 2k�1�1ÞRNS and a Scheme for Its VLSI Implementation,” IEEE Trans.Circuits and Systems, Part II, vol. 47, no. 12, pp. 1576-1581, Dec. 2000.

[27] W. Wang, M.N.S. Swamy, M.O. Ahmad, and Y. Wang, “A Noteon “A High-Speed Residue-To-Binary Converter for Three-Moduli ð2k; 2k � 1; 2k � 1� 1Þ RNS and a Scheme for Its VLSIImplementation”,” IEEE Trans. Circuits and Systems, Part II,vol. 49, Mar. 2002.

[28] Y. Wang, “Residue-to-Binary Converters Based on New ChineseRemainder Theorems,” IEEE Trans. Computers, vol. 49, no. 3,pp. 197-206, Mar. 2000.

[29] S. Bi, W. Wang, and A. Al-Khalili, “New Modulo DecomposedResidue-to-Binary Algorithm for General Moduli Sets,” Proc. IEEEInt’l Conf. Acoustics, Speech and Signal Processing (ICASSP ’04),vol. 5, pp. 141-144, 2004.

[30] B. Vinnakota and V.V. Rao, “Fast Conversion Techniques forBinary-Residue Number Systems,” IEEE Trans. Computers, vol. 41,no. 12, pp. 927-929, Dec. 1994.

[31] S.J. Piestrak, “A High-Speed Realization of a Residue to BinaryNumber System Converter,” IEEE Trans. Computers, vol. 44, no. 10,pp. 661-663, Oct. 1995.

[32] L. Kalampoukas, D. Nikolos, C. Efstathiou, H.T. Vergos, and J.Kalamatianos, “High-Speed Parallel-Prefix Modulo 2n � 1Adders,” IEEE Trans. Computers, vol. 49, no. 7, pp. 673-680, July2000.

[33] S. Bi, “Low Power Modulo Reduction Technique and ItsApplication in Residue-to-Binary Converters,” MEng thesis,Concordia Univ., Montreal, Mar. 2004.

[34] Y. Wang, X. Song, M. Aboulhamid, and H. Shen, “Adder BasedResidue to Binary Number Converters for f2n � 1; 2n; 2n þ 1g,”IEEE Trans. Computers, vol. 50, no. 7, pp. 1772-1779, July 2002.

Shaoqiang Bi received the BSc and MEngdegrees in electronics and communicationsengineering from Huazhong University ofScience and Technology in 1996 and 1999,respectively, and the MSc degree in electricaland computer engineering from ConcordiaUniversity in 2004. He currently works at XilinxInc., San Jose, California, as a senior productverification engineer. His research interests arein computer arithmetic and FPGAs.

Warren J. Gross received the BASc degree inelectrical engineering from the University ofWaterloo, Waterloo, Ontario, Canada, in 1996,and the MASc and PhD degrees from theUniversity of Toronto, Toronto, Ontario, in 1999and 2003, respectively. Currently, he is anassistant professor with the Department ofElectrical and Computer Engineering, McGillUniversity, Montreal, Quebec. In the summersof 2004 and 2005, he was a visiting professor

at the Universite de Bretagne-Sud. Lorient, France. His researchinterests are in the design and application of signal processingmicrosystems and custom computer architectures. He is a memberof the Design and Implementation of Signal Processing SystemsTechnical Committee of the IEEE Signal Processing Society. Heserved as the general chair of the Sixth Analog Decoding Workshop.He has served on the Program Committees for the IEEE Workshopon Signal Processing Systems, the IEEE Symposium on Field-Programmable Custom Computing Machines, and the InternationalConference on Field-Programmable Logic and Applications. He is amember of the IEEE and the IEEE Computer Society and is a licensedProfessional Engineer in the Province of Ontario.

. For more information on this or any other computing topic,please visit our Digital Library at www.computer.org/publications/dlib.

1632 IEEE TRANSACTIONS ON COMPUTERS, VOL. 57, NO. 12, DECEMBER 2008

Authorized licensed use limited to: IEEE Xplore. Downloaded on November 18, 2008 at 14:24 from IEEE Xplore. Restrictions apply.