Overflow Detection Scheme in RNS Multiplication Before Forward Conversion

Embed Size (px)

Citation preview

  • 7/29/2019 Overflow Detection Scheme in RNS Multiplication Before Forward Conversion

    1/4

    OVERFLOW DETECTION SCHEME IN RNS MULTIPLICATION BEFORE

    FORWARD CONVERSION

    M.I. DAABO1,2

    , K. A. GBOLAGADE1

    1 Department of Computer Science, Faculty of Mathematical Sciences, University for Development

    Studies, Navrongo, Ghana.

    2 Department of Mathematical Applications, Wisconsin International

    University College, Accra, Ghana.

    AbstractOverflow detection is one of the major issues that preclude Residue Number System (RNS) usage in

    general purpose computing. Contemporary authors have presented various schemes that rely on either the Chinese

    Remainder Theorem (CRT) or the Mixed Radix Conversion (MRC). This paper presents an overflow detection

    scheme in RNS multiplication before forward conversion. Overflow in RNS multiplication of integers X and Y

    occurs when the product of the calculated quotients, ab , where M = is the system dynamic range. Our

    proposal is a multiplicative overflow detector, which does not require computations involving the use of the time

    consuming CRT or MRC. The newly proposed scheme utilizes lesser modulo computations and hence has the

    advantage of having smaller hardware architecture with lesser delay.

    Keywords: Residue Number System, Multiplicative overflow detector, Dynamic Range. CRT. and MRC

    -------------------------------------------------------- -----------------------------------------------------------

    1.0IntroductionThe advantages of Residue Number System

    (RNS) over the conventional binary numbersystem include parallelism, fault tolerance

    low power and high speed computations and

    are well documented in [2], [8], [10], [12].However, the inability of RNS to efficiently

    manage dynamic range overflow is one of the

    major disadvantages [1], [7], [11].

    Overflow in RNS is a condition where a

    calculated number falls outside the validdynamic range of a particular RNS [4].

    Contemporary authors over the past decades

    have developed overflow detection

    algorithms, which rely on the ChineseRemainder Theorem (CRT) or the Mixed

    Radix Conversion (MRC) using one or more

    of relatively prime moduli as scale factors [9],[10]. Siewobr and Gbolagade [5] proposed a

    scheme that uses the large modulo (M+1)

    computation. Siewobr and Gbolagade againdeveloped an additive overflow detection

    scheme that reduces the large modulo M to Mi

    by scaling M and the integers X and Y with

    the modulus mi = 2n

    [4]. However, theproposed scheme in [4] does not consider

    overflow in multiplication of two numbers.

    In this paper, we present an overflow

    detection scheme in RNS multiplication

    before forward conversion. The algorithmsare based on first, the computation of the

    quotients, a = and b = for integers X and

    Y. Secondly, we make the proposition that

    overflow occurs in RNS multiplication of X

    and Y when ab , where M = is the

    system dynamic range. This new proposal

    detects multiplicative overflow. It also

    eliminates the time consuming reverseconversion approach characterized by the use

    of CRT and MRC with large modulo M. Theoverall achievement is reduced area cost and

    improvement in delay.

    JOURNAL OF COMPUTING, VOLUME 4, ISSUE 12, DECEMBER 2012, ISSN (Online) 2151-9617

    https://sites.google.com/site/journalofcomputing

    WWW.JOURNALOFCOMPUTING.ORG 13

    2012 Journal of Computing Press, NY, USA, ISSN 2151-9617

  • 7/29/2019 Overflow Detection Scheme in RNS Multiplication Before Forward Conversion

    2/4

    2.0The Proposed SchemeIn this work, we propose a simple overflow

    detection scheme in RNS multiplication

    before forward conversion. Given the

    binary/decimal numbers X and Y and themoduli set {m1, m2 m3,, mn}, with the

    dynamic range M = . The modulus

    m = 2 is chosen such that:

    a = (1)

    b = (2)

    = (3)

    ab (4)

    Proposition 1: An overflow only occurs in

    RNS multiplication of the binary/decimal

    numbers X and Y ifab

    Proof:

    If we let

    a = (5)

    b = (6)

    = (7)

    Then we proposed that an overflow will occur

    in RNS multiplication of X and Y if ab

    (8)

    From equations (5), (6), and (7) we see that

    X = a m (9)

    Y = b m (10)

    M = m (11)

    But overflow only occurs if XY M

    That is mm (ab) m

    Thus ab = as in equation (8)

    But we then choose m = 2

    Therefore a =

    b =

    =

    and ab as in equations (1)-(4)

    2.1 proposed overflow detection algorithm

    1. Given the binary/decimal numbers Xand Y and any moduli set {m1, m2m3,,mn}, with the dynamic range M

    = .

    2. Choose the modulus m = 23. Compute the following; a = , b = ,

    = , and ab .

    4. If ab then overflow occurs inRNS multiplication.

    2.2Numerical illustrationsFor purposes of illustrations, we show how

    the scheme works with some examples.

    1. Product of 30 and 4 using the moduli set

    {7, 5, 3}.

    Let X = 30, Y = 4 and M = 105. Then a =

    = 15, b = = 2 and = 26.25.

    If ab then overflow occurs in RNS

    multiplication. That is 30 26.25 is true and

    overflow does occur in RNS multiplication of

    30 and 4 for the moduli set {7, 5, 3}.

    2. Product of 20 and 4 using the moduli set

    {7, 5, 3}.

    JOURNAL OF COMPUTING, VOLUME 4, ISSUE 12, DECEMBER 2012, ISSN (Online) 2151-9617

    https://sites.google.com/site/journalofcomputing

    WWW.JOURNALOFCOMPUTING.ORG 14

    2012 Journal of Computing Press, NY, USA, ISSN 2151-9617

  • 7/29/2019 Overflow Detection Scheme in RNS Multiplication Before Forward Conversion

    3/4

    Let X = 20, Y = 4 and M = 105. Then a = =

    10, b = = 2, = 26.25.

    If ab then overflow occurs in RNS

    multiplication. But 20 26.25 is false andoverflow does not occur in RNS

    multiplication of 20 and 4 for the moduli set

    {7, 5, 3}.

    Table1

    Summary of illustrated examples

    X Y

    a

    =

    b

    = ab

    Is

    ab Is there

    overflow

    30 4 15 2 30 26.25 YES YES

    20 4 10 2 20 26.25 NO O

    8 10 4 5 20 26.25 NO O

    6 30 3 15 45 26.25 YES YES

    0 0 0 0 0 26.25 NO O

    32 20 16 10 160 26.25 YES YES

    40 4 20 2 40 26.25 YES YES

    M = 105

    3 ImplementationThe algorithms are implemented in stages.

    First, since a = , b = and are made up of

    integer divisions and remainders, we scale X

    and Y by 2 and scale M by 4. The product of

    a and b is implemented in three steps. Theresults in the previous two steps are multiplied

    to obtain ab. A simple logic circuit is used to

    implement ab and then output whether

    there is overflow or not. We note here that

    binary scaling and division by 2, that is,

    powers of two requires no hardware since it isjust a right logical shift operations. Also,

    computing the residue of a number with

    respect to 2 type moduli results in the oneleast significant bit of the number in question

    and also requires no hardware. Therefore the

    computations of a and b can be hardwired.

    The implementation is therefore reduced tosimple multiplication and magnitude

    comparison as shown in Fig. 2.

    4 Performance AnalysisTable 2

    Table of comparison

    ITEMS [5] [6, 3] TM OP

    Operation

    size

    Mod

    M+1

    M M Mi

    DOBFC No No yes yes

    Redundant

    moduli

    yes yes No No

    Sign

    Detection

    No No No No

    CRT/MRC No yes No No

    DOBFC = Detection of Overflow Before

    Forward Conversion. TM = Traditional

    Method. OP = Our Proposal

    In Table 2, it can be seen that it is only the

    new proposal, the TM and [4] that can detectoverflow before forward conversion. In

    addition, the proposed scheme detects

    overflow in multiplication operation and

    requires lesser modulo operation whencompared with the TM model and others. This

    results in the use of less hardware resources in

    design and minimum operation time. Theoverall achievement is reduced area cost and

    improvement in delay.

    Fi . 2. Dia ram of ro osed scheme

    No OverflowOverflow

    (ab)

    T F

    Logic gate 1

    ab

    Multiplier

    X Y

    JOURNAL OF COMPUTING, VOLUME 4, ISSUE 12, DECEMBER 2012, ISSN (Online) 2151-9617

    https://sites.google.com/site/journalofcomputing

    WWW.JOURNALOFCOMPUTING.ORG 15

    2012 Journal of Computing Press, NY, USA, ISSN 2151-9617

  • 7/29/2019 Overflow Detection Scheme in RNS Multiplication Before Forward Conversion

    4/4

    5 ConclusionIn this paper, we presented a dynamic range

    multiplicative overflow detection scheme in

    RNS before forward conversion. Firstly, the

    algorithms seek to compute the quotients a

    = and b= . Secondly we propose that

    overflow in RNS multiplication of integers Xand Y occurs when the product of the

    calculated quotients, ab , where M =

    is the system dynamic range. By

    design, our proposal is a multiplicative

    overflow detector and does not require

    computations involving the use of the timeconsuming CRT and MRC techniques with

    large modulo M. It is also found that the newscheme uses lesser modulo computations and

    hence has the advantage of moderatehardware architecture with lesser delay

    operations.

    6 Reference[1] F.J Taylor and C. Huang, An Auto scale

    Multiplier. IEEE Transactions on computers

    vol.c-31, no.4, April 1982.

    [2] F.J Taylor, Residue Arithmetic: A tutorialwith examples. IEEE Computer Magazine,

    vol.17, pp.50-62, May 1984.

    [3] H.L Garmer, Error Codes for Arithmetic

    Operations. IEEE Trans. Electron Computers

    vol.EC-15, October, 1966.

    [4] H.Siewobr and K.A Gbolagade, AnOverflow Detection in Residue Number

    Systems Addition before forward con version.

    International Journal of Com putational

    Intelligence and Information Security, vol.2,

    no.9, pp. 48-54, 2011.

    [5] H. Siewobr and K.A. Gbolagade, An

    Efficient RNS Overflow Detection Algorithm,

    Far East Journal of Electronics andCommunications. Vol. 6, No. 2, pp 83-91,

    2011.

    [6] J.L Massey and O.M Garcia, Error

    Correcting codes Computer Arithmetic. New

    York, Plenum 1972.

    [7] J.M Diamond, Checking codes for digital

    computers. Proc.IRE vol. 43, April 1954.

    [8] K.A Gbolagade and S.D Cotofana,

    Residue-to-decimal converters for moduli set

    with common factors. 52nd IEEE International

    Midwest Symposium on Circuits and Systems

    (MINSCAS, 2009), PP.624-627, 2009.

    [9] K.H Rosen, Discrete Mathematics and ItsApplications, Fourth Edition, McGraw-Hill,

    pp.145, 1999.

    [10] M.A Soderstand, W.K Jenkins, G.A

    Jullien and F.J Taylor, Residue NumberSystem Arithmetic: Modern Application in

    Digital Signal Processing. IEEE press, NewYork, 1986.

    [11] M.J Schulte et al., Integer multiplicationwith Overflow Detection or Saturation. IEEE

    Transactions on computers vol.49, no.6, June

    2000.

    [12] P.V Ananda Mohan, Residue Number

    system: Algorithms and Architecture. Kluwer

    Academic New York 2002.

    JOURNAL OF COMPUTING, VOLUME 4, ISSUE 12, DECEMBER 2012, ISSN (Online) 2151-9617

    https://sites.google.com/site/journalofcomputing

    WWW.JOURNALOFCOMPUTING.ORG 16

    2012 Journal of Computing Press, NY, USA, ISSN 2151-9617