WO2005013117A1 - 剰余系演算システム、スケーリング演算器、スケーリング演算方法、及びそのプログラムと記録媒体 - Google Patents

剰余系演算システム、スケーリング演算器、スケーリング演算方法、及びそのプログラムと記録媒体 Download PDF

Info

Publication number
WO2005013117A1
WO2005013117A1 PCT/JP2004/010510 JP2004010510W WO2005013117A1 WO 2005013117 A1 WO2005013117 A1 WO 2005013117A1 JP 2004010510 W JP2004010510 W JP 2004010510W WO 2005013117 A1 WO2005013117 A1 WO 2005013117A1
Authority
WO
WIPO (PCT)
Prior art keywords
modulus
value
remainder
sub
quotient
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
PCT/JP2004/010510
Other languages
English (en)
French (fr)
Inventor
Kazuyuki Maruo
Takahiro Yamaguchi
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Advantest Corp
Original Assignee
Advantest Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Advantest Corp filed Critical Advantest Corp
Publication of WO2005013117A1 publication Critical patent/WO2005013117A1/ja
Priority to US11/340,870 priority Critical patent/US8326908B2/en
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F7/00Methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F7/60Methods or arrangements for performing computations using a digital non-denominational number representation, i.e. number representation without radix; Computing devices using combinations of denominational and non-denominational quantity representations, e.g. using difunction pulse trains, STEELE computers, phase computers
    • G06F7/72Methods or arrangements for performing computations using a digital non-denominational number representation, i.e. number representation without radix; Computing devices using combinations of denominational and non-denominational quantity representations, e.g. using difunction pulse trains, STEELE computers, phase computers using residue arithmetic
    • G06F7/729Methods or arrangements for performing computations using a digital non-denominational number representation, i.e. number representation without radix; Computing devices using combinations of denominational and non-denominational quantity representations, e.g. using difunction pulse trains, STEELE computers, phase computers using residue arithmetic using representation by a residue number system

Definitions

  • the present invention relates to a modular arithmetic system, a scaling arithmetic unit, a scaling arithmetic method, a program thereof, and a recording medium.
  • the present invention relates to a modular arithmetic system, a scaling arithmetic unit, a scaling arithmetic method, and a program and a recording medium for efficiently performing a scaling arithmetic of a numerical value expressed in a modular system.
  • This application is related to the following Japanese application. For those designated countries that are allowed to be incorporated by reference to the literature, the contents described in the following application are incorporated into this application by reference and are made a part of this application.
  • Non-Patent Document 1 a numerical operation method using a residue number system (Residue Number System; RNS) has been proposed (Non-Patent Document 1). It is known that addition, subtraction, and multiplication by the remainder system can be calculated faster than the conventional operation using binary numbers for the following reasons.
  • RNS Residue Number System
  • one numerical value X is represented by a combination of N remainder numbers (remainder values).
  • mod is an abbreviation of modulo, and means that the following equation (1-2) is satisfied.
  • p is a quotient obtained by dividing X by m. At this time, X and X are combined to a modulus m
  • (0,0,0,0) is 0 or 840 or 1680 ⁇ '', (1,1,1,1) is 1 or 841 or
  • ⁇ B can be realized by calculating the remainder digits for each modulus of the operand.
  • the left side is a remainder value of m of m.
  • the operation according to the equation (1-5) is called remainder addition, remainder subtraction, or remainder multiplication.
  • the theorem of modular addition / subtraction multiplication is proved as follows.
  • p is the quotient of A divided by the modulus m
  • q is the quotient of B divided by the modulus m.
  • addition / subtraction multiplication in the remainder system is performed on each of the two input operands A and B and the corresponding remainder digit of the output operation result Y, with respect to the remainder digit. It can be realized by providing an ALU (Arithmetic Logic Unit) that performs the remainder operation. Then, calculation of a certain remainder digit can be performed independently of calculation of another remainder digit. In the operation by the remainder operation ALU corresponding to each remainder digit, the calculation can be performed at higher speed because the delay due to carry propagation can be limited to the number of bits of the remainder digit.
  • ALU Arimetic Logic Unit
  • Equation (1-5) can be transformed from the theorem of modular addition / subtraction multiplication shown in equation (1-5) to the following equation (1-11), and furthermore, the equation (1-12) Can be obtained.
  • the latter condition is m, m, m, m
  • / 30 is a natural number. If m 1, m, and m are relatively prime, the conditions of a) and b) can be rewritten into the following expression (1-15) from equation (1-4). be able to.
  • .-. (0,0,0,1) 280.
  • Patent Documents Parhami, Computer Arithmetic, Oxford University Press, 2000, pp.54-72
  • addition / subtraction multiplication can be performed at high speed.
  • due to the scaling operation described below there is a problem in that it is not faster than calculating addition / subtraction multiplication in binary numbers.
  • the multiplication result is (2n) bits.
  • the multiplication result of (2n) bits should be output as it is for n input bits.
  • the number of output bits increases. For example, when calculating decimal number (15/16) X (15/16), (225/256) is the power S that is the result of multiplication, and if the output bit is 4 bits, the result is truncated ( truncate) and output n bits as the number of input bits as the calculation result.
  • an object of the present invention is to provide a modular arithmetic system, a scaling arithmetic unit, a scaling arithmetic method, and a program and a recording medium which can solve the above-mentioned problems.
  • This purpose is achieved by combining the features described in the independent claims. More achieved.
  • the dependent claims define further advantageous embodiments of the present invention.
  • a scaling calculator for calculating a quotient of the first remainder form by dividing the input value of the remainder form by the second modulus, wherein the remainder of the input value and the second modulus are represented by the first modulus.
  • a subtractor that outputs an intermodulus difference value that is a difference value of the remainder value according to the first modulus of the quotient and a remainder of the quotient according to the second modulus based on the intermodulus difference value.
  • a quotient output unit that outputs a set of values as the quotient.
  • the first modulus and the second modulus may be relatively prime.
  • the difference between the second modulus and the second modulus is one, and the quotient output unit outputs the intermodulus difference as a remainder of the quotient according to the first modulus and a remainder of the quotient according to the second modulus.
  • a remainder value of the value according to the first modulus may be output.
  • the apparatus may further include an overflow detector for detecting an overflow.
  • the subtractor subtracts a modulus value of the input value in the remainder format, the modulus value being smaller than the first modulus and the second modulus by a modulus greater than a modulus of a smaller modulus.
  • a quotient output unit that outputs a remainder value obtained by dividing the inter-modulus difference value by an absolute value of a difference between the first modulus and the second modulus by the first modulus. The quotient may be calculated as a remainder value according to the first modulus and the quotient as a remainder value according to the second modulus.
  • the first modulus is a product of a plurality of first sub-moduli that are a plurality of relatively prime integers
  • the second modulus is a plurality of second sub-modules that are a plurality of relatively prime integers.
  • the remainder of the value according to the second modulus is equal to the plurality of second A remainder format converter for converting the input value in a second remainder format represented by a plurality of second sub-remainder values obtained by dividing the input value by each of the moduluses into the input value in the first remainder format;
  • a quotient in the first remainder format output by the quotient output unit to a quotient in the second remainder format.
  • the first modulus is a product of a plurality of first sub-moduli that are a plurality of disjoint integers
  • the second modulus is a plurality of second sub-modules that are a plurality of disjoint integers.
  • the input value is represented by a plurality of first sub-remainder values obtained by dividing the input value by each of the plurality of first sub-moduli
  • the remainder value by two modulus is further expressed by a second remainder format expressed by a plurality of second sub-remainder values obtained by dividing the input value by each of the plurality of second sub-moduli
  • a first conversion unit that converts a remainder value of the input value represented by a sub-remainder value according to the first modulus into a plurality of first conversion sub-remainder values that are remainders of the plurality of second sub-moduli.
  • a subtractor wherein the subtractor further comprises: a plurality of first conversion sub-remainder values indicating a remainder value of the input value according to the first modulus; and a remainder value of the input value according to the second modulus.
  • a second modulus corresponding subtractor for outputting a difference value, wherein the quotient output unit is represented by a plurality of residual values of each of the plurality of second submoduluses based on the first intermodulus difference value. And a second modulus corresponding quotient output unit that outputs a remainder value of the quotient obtained by the second modulus.
  • a remainder value of the input value represented by the plurality of second sub-remainder values according to the second modulus is converted into a plurality of second remainder modulo values of the plurality of first sub-moduli.
  • a second sub-remainder value conversion unit configured to convert the input value into a plurality of second conversion sub-residue values indicating a remainder value of the input value according to the second modulus;
  • the apparatus may further include a first modulus corresponding quotient output unit that outputs a remainder value of the quotient according to the first modulus.
  • a condition determination is performed to determine whether a remainder value of the input value according to the first modulus and a remainder value of the input value according to the second modulus satisfy a predetermined magnitude relation.
  • a quotient output unit wherein the remainder of the input value according to the first modulus and the remainder of the input value according to the second modulus satisfy the predetermined magnitude relationship.
  • the first inter-modulus difference value and the second inter-modulus difference value adjusted by adding a predetermined constant to one of the first inter-modulus difference value and the second inter-modulus difference value.
  • the apparatus may further include a difference value adjustment unit that supplies the first modulus-compatible quotient output unit and the second modulus-compatible quotient output unit, respectively.
  • condition determining unit wherein the first modulus is one greater than the second modulus, is such that a remainder of the input value by the first modulus is larger than a remainder of the input value by the second modulus.
  • the difference value adjustment unit adjusts the second modulus difference value by adding 1, and the first modulus corresponding quotient output unit adjusts the second modulus difference value adjusted by the difference value adjustment unit.
  • the output unit may use the first inter-modulus difference value as a remainder value of the quotient expressed by a plurality of remainder values of each of the plurality of second sub-moduli, according to the second modulus.
  • the first sub-remainder value conversion unit is configured to perform the conversion on the plurality of input values represented by the plurality of first sub-remainder values, using a remainder value according to the first modulus as an initial value. For each of the plurality of converted remainder values obtained by dividing the converted value by each of the first submoduli of The remainder value is set to 0, and all the other converted residue values already converted to 0 are kept at 0.
  • a conversion coefficient calculation unit for calculating a conversion coefficient, and the conversion coefficient calculation unit sequentially calculates the conversion coefficient.
  • the transform coefficients represented by the remainder value of the first modulus are sequentially added, and the transform coefficients are sequentially calculated by the transform coefficient adder and the transform coefficient calculating unit.
  • the transformed coefficient expressed by a plurality of residual values by each of the sub-modulus, the transformed value power, and a transformed value subtractor for sequentially reducing the transformed coefficient; and all the transformed values calculated for all of the plurality of transformed residue values.
  • a conversion result output unit that outputs a plurality of residue values obtained by dividing the added value obtained by adding the coefficient by the conversion coefficient adder by each of the plurality of second submoduli as the plurality of first conversion sub-remainder values; May be provided.
  • the conversion coefficient calculation unit stores the conversion coefficient corresponding to the converted residue value in an address corresponding to the converted residue value as data. May include memory to store.
  • the first modulus is a product of a plurality of first sub-moduli that are a plurality of relatively prime integers
  • the second modulus is a plurality of second sub-modules that are a plurality of relatively prime integers.
  • the input value is represented by a plurality of first sub-remainder values obtained by dividing the input value by each of the plurality of first sub-moduli
  • the remainder value by two modulus is further expressed by a second remainder format expressed by a plurality of second sub-remainder values obtained by dividing the input value by each of the plurality of second sub-moduli, and A value obtained by dividing the converted value by each of the plurality of first sub-moduli in a converted value whose initial value is the remainder value of the input value expressed by the sub-modulus value by the second modulus.
  • a conversion coefficient calculation unit that calculates a conversion coefficient to be kept at a predetermined value, and the conversion coefficient that is sequentially calculated by the conversion coefficient calculation unit and that is expressed by a plurality of residual values of each of the plurality of first submoduli.
  • a conversion value subtraction unit for sequentially subtracting the conversion value from the conversion value, wherein the subtractor is represented by a plurality of residual values of each of the plurality of second submoduli sequentially calculated by the conversion coefficient calculation unit.
  • the conversion coefficient obtained by the A residual value force of the input value represented by the remainder value by the second modulus sequentially decays and outputs a first intermodulus difference value represented by a plurality of remainder values by each of the plurality of second submoduli.
  • the second quotient output unit wherein the quotient output unit is configured to calculate the quotient of the quotient represented by a plurality of remainder values by each of the plurality of second submoduli based on the first intermodulus difference value.
  • the apparatus may further include a second modulus corresponding quotient output unit that outputs a remainder value according to the second modulus.
  • the first modulus is a product of a plurality of first sub-moduli that are a plurality of disjoint integers
  • the second modulus is a product of a plurality of second sub-moduli that are a plurality of disjoint integers.
  • the input value is represented by a plurality of first sub-remainder values obtained by dividing the input value by each of the plurality of first sub-moduli, and a remainder value of the first modulus is obtained by dividing the input value.
  • the remainder value according to the second modulus is further expressed in a second remainder form expressed by a plurality of second sub-remainder values obtained by dividing the input value by each of the plurality of second sub-moduli, and Converting a remainder value of the input value represented by a sub-residue value by the first modulus into a plurality of first conversion sub-residue values, which are remainders of each of the plurality of second sub-moduli.
  • a second modulus corresponding subtractor that outputs an inter-difference value, and further calculates the first inter-modulus difference value represented by a plurality of remainder values by each of the plurality of second sub-moduli.
  • a second sub-residual value conversion unit that converts the first sub-modulus into a converted inter-modulus difference value represented by a plurality of remainder values, wherein the quotient output unit is configured to perform conversion based on the converted inter-modulus difference value.
  • a first modulus corresponding quotient output unit for outputting a remainder value of the quotient represented by a plurality of remainder values of each of the plurality of first submoduli, the first modulus corresponding to the first modulus, and a first intermodulus difference.
  • a second value that outputs a remainder value of the quotient represented by a plurality of remainder values of each of the plurality of second submoduli based on the second modulus, based on the second modulus value.
  • a modulus-compatible quotient output unit for outputting a remainder value of the quotient represented by a plurality of remainder values of each of the plurality of first submoduli, the first modulus corresponding to the first modulus, and a first intermodulus difference.
  • a second value that outputs a remainder value of the quotient represented by a plurality of remainder values of each of the plurality of second submoduli based on the second modulus, based on the second modulus value.
  • a modulus-compatible quotient output unit
  • a remainder system using a remainder system in which a numerical value is expressed in a first remainder format by a set of a remainder value by a first modulus (modulus) and a remainder value by a second modulus.
  • An arithmetic system comprising: a modulo operation unit that inputs two operand values to be computed and performs addition, subtraction, or multiplication between the two operand values; and an operation result by the remainder operator.
  • a scaling calculator for inputting the calculation result as an input value when scaling is required, and calculating a quotient obtained by dividing the input value by the second modulus as a scaling result of the calculation result,
  • a scaling calculator configured to output a difference value between the modulus of the input value, the difference value being a difference value between a remainder value according to the first modulus and a remainder value according to the second modulus; Based on the minute value, it provides a coset computation system having a quotient output unit for outputting a set of remainder value by the second modulus of remainder value and the quotient of the first modulus of the quotient as the quotient.
  • the set of residue values And a quotient output step of outputting as a quotient.
  • the first modulus is a product of a plurality of first sub-moduli that are a plurality of relatively prime integers
  • the second modulus is a product of a plurality of second sub-moduli that are a plurality of relatively prime integers.
  • the input value is represented by a plurality of first sub-remainder values obtained by dividing the input value by each of the plurality of first sub-moduli
  • the second modulus Is further expressed in a second remainder format expressed by a plurality of second sub-remainder values obtained by dividing the input value by each of the plurality of second sub-moduli, and the plurality of second A first sub-residue for converting the remainder of the input value represented by the one sub-remainder value according to the first modulus into a plurality of first transform sub-remainder values which are remainders of the plurality of second sub-moduli, respectively; Further comprising a value conversion step, wherein the subtraction step includes the plurality of first conversion sub-remainder values indicating a remainder value of the input value according to the first modulus, and the remainder value indicating a remainder value of the input value according to the second modulus.
  • a second modulus-corresponding subtraction step wherein the quotient output step is configured to calculate the quotient of the quotient represented by a plurality of remainder values of each of the plurality of second sub-moduli based on the first inter-modulus difference value.
  • the method may further include a second modulus corresponding quotient output step of outputting a remainder value according to the second modulus.
  • FIG. 1 shows an outline of a scaling process according to an embodiment of the present invention.
  • FIG. 2 shows a configuration of a modular arithmetic system 5 according to an embodiment of the present invention.
  • FIG. 3 shows an operation flow of the modular arithmetic system 5 according to the embodiment of the present invention.
  • FIG. 4 shows a configuration of a scaling calculator 100 according to a first modification of the embodiment of the present invention.
  • FIG. 5 shows a configuration of a first sub-residue value conversion unit 300 and a second modulus corresponding subtractor 340 according to a first modification of the embodiment of the present invention.
  • FIG. 6 shows a configuration of a condition determining unit 350 and a difference value adjusting unit 360 according to a first modification of the embodiment of the present invention.
  • FIG. 7 shows an operation flow of a scaling calculator 100 according to a first modification of the embodiment of the present invention.
  • FIG. 8 shows a configuration of a scaling calculator 100 according to a second modification of the embodiment of the present invention.
  • FIG. 9 shows an operation flow of a scaling calculator 100 according to a second modification of the embodiment of the present invention.
  • FIG. 10 shows an example of a hardware configuration of a computer 900 according to the embodiment of the present invention. Explanation of symbols
  • the modular arithmetic system uses the following two types of modular representations, a scaling modular system (Scaling RNS) and an arithmetic modular system (Arithmetic RNS). Realizes addition, subtraction, multiplication and scaling operations at high speed by performing calculations in the scaling remainder system.
  • Scaling RNS scaling modular system
  • Arimetic RNS arithmetic modular system
  • the scaling residue system is a residue system aiming at scaling the scaled number Y at high speed.
  • the scaling method using the scaling residue system is called “Scaling by the Difference in Scaling RNS (SDSRNS)”.
  • the scaling remainder system is given a modulus ⁇ 1 ⁇ , and expresses a numerical value in a first remainder form by a set of a remainder value by a first modulus ra 1 and a remainder value by a second modulus m 1.
  • FIG. 1 shows an outline of a scaling process by the SDSRNS method.
  • the scaling calculator 3 shown in the figure performs scaling processing based on the equation (2-1) using the SDSRNS method. This allows the scaling calculator 3 to perform high-speed scaling using the subtraction result between the remainder digits of the input value Y.
  • the carrier propagation delay can be reduced. Therefore, according to the scaling remainder system in which the carry propagation delay increases as M increases, the merits of the remainder system cannot be fully utilized.
  • an arithmetic remainder system used for operations other than scaling is introduced to achieve both high-speed numerical calculation processing and high-speed scaling.
  • the arithmetic remainder system is defined below.
  • Arithmetic modulo a plurality of modulus of the first modulus n / scaling coset obtained by factoring ⁇ , m r, m T, ⁇ , m T ⁇ and, a second modulus m 1 Factoring
  • a plurality of obtained moduli ⁇ m l , l , m l , ⁇ ⁇ ⁇ , m 1 ⁇ is defined as a modulus set.
  • the arithmetic remainder system is ⁇ m T , m ⁇ , m ⁇ , ⁇ ⁇ , m T ⁇ , ⁇ m 1 , m 1 , m 1 ,
  • M 1 ⁇ is a modulo system with mod k-1 jurass set.
  • a plurality of moduli ⁇ m T , m T , m T ,..., M ⁇ ⁇ corresponding to the first modulus are represented by ol 2 M
  • m 1 , m 1 , ⁇ ., m 1 ⁇ is defined as a modulus subset corresponding to the second modulus m 1 or
  • the second sub-modulus ⁇ ⁇ , ⁇ , m one, m 1 ⁇ referred to as c
  • the first modulus m T is a plurality of first sub-moduli ⁇ m T , m T , m T , which are a plurality of relatively prime integers. , ⁇ ⁇ ⁇ , m ' ⁇ , the second module
  • the class m 1 is a plurality of second submoduli (m 1 , m l , m l , ⁇ ⁇ , m 1 ⁇
  • w 0 , w ,, w 2 , ... w j. are relatively prime (2-2) iii
  • X is divided by each of a plurality of second submoduli ⁇ m l , m l , m 1 , ⁇ ⁇ , m 1 ⁇ .
  • the modular arithmetic system 5 includes a number I A I represented by an arithmetic remainder system.
  • FIG. 2 shows the configuration of the modular arithmetic system 5 according to the present embodiment.
  • the modular arithmetic system 5 has a modular arithmetic unit 10 for inputting the numerical values A and B of the modular system to perform various arithmetic operations, and a modular arithmetic unit 10 when the arithmetic processing by the modular arithmetic unit 10 requires scaling processing.
  • a scaling operation unit 100 for performing a scaling operation.
  • the scaling operation unit 100 receives the operation result of the remainder operation unit 10 and, based on the result obtained by subtracting between the remainder digits of the input value, divides the input value by one of the modulus as a scaling result. calculate. This allows the scaling calculator 100 to perform scaling at a higher speed than in the case where the scaling operation is performed after temporarily converting to a binary number or a 10-base number using the Chinese remainder theorem.
  • the modular arithmetic system 5 includes a modular arithmetic unit 10 and a scaling arithmetic unit 100.
  • the remainder arithmetic unit 10 receives operands A and B expressed in an arithmetic remainder format, which is an example of a second remainder format according to the present invention, and performs addition, subtraction, or multiplication between A and B .
  • A is a plurality of first sub-moduli (m ′, m T , m T
  • the modular arithmetic unit 10 includes a plurality of modular arithmetic units ALU20 that perform addition, subtraction, or multiplication between the remainder values of the corresponding remainder digits of the operands A and B.
  • the scaling calculator 100 includes an overflow detector 110, a remainder format converter 120, a subtractor 130, a quotient output unit 140, and a remainder format inverse converter] 50.
  • the overflow detector 110 detects an overflow of the input value Y input to the scaling calculator 100.
  • the remainder format converter 12 ⁇ converts the input value Y represented by the arithmetic remainder system into the input value represented by the scaling remainder system.
  • the subtractor 130 subtracts the input value Y expressed by the scaling remainder system between the remainder digits shown in the following equation (3-5), and calculates the difference value between the modulus, which is the difference value between the remainder digits. Is output.
  • FIG. 3 shows an operation flow of the modular arithmetic system 5 according to the present embodiment.
  • the modular arithmetic unit 10 inputs operands ⁇ and B, which are two operands to be operated on, and performs addition, subtraction, or multiplication between A and B (step S200).
  • the remainder arithmetic unit 10 determines whether or not the operation result Y should be scaled (S210). When scaling is not required, the remainder arithmetic unit 10 outputs the operation result Y in the second remainder format as the operation result.
  • the remainder operation unit 10 inputs the operation result Y of the second remainder format to the scaling operation unit 100.
  • the overflow detector 110 detects an overflow of the input value Y input to the scaling calculator 100 (S220). That is, as described in the supplementary explanation “1 (1)” described later, when the upper limit of the input value Y, which is the number to be scaled, is limited, the overflow detector 110 detects the overflow. To detect.
  • the overflow detector 110 calculates the product m 1 of the first modulus and the second modulus as the first modulus m 1 and the second modulus. If the value divided by the absolute value of m 1 is greater than or equal to the input value Y, an overflow of the input value Y is detected.
  • the input value Y can be limited to a range where the expressions (3-13) and (3-16) described in (2) or (3) of the supplementary explanation 1 described later are satisfied.
  • the remainder format converter 120 converts the input value Y represented by the arithmetic remainder system into a schedule. Is converted to the input value Y expressed by the residual system. That is, the remainder format converter 120 calculates the remainder value y T of the input value ⁇ by the first modulus and the plurality of first sub-moduli ⁇ , m T
  • m T , m r ⁇ are represented by a plurality of first sub-remainder values (, y T ) obtained by dividing the input value Y by each of the input values Y, and the remainder y 1 force of the input value Y by the second modulus m
  • a plurality of second sub-remainder values (y ⁇ , y) obtained by dividing the input value by each of the two sub-modulus ⁇ , ⁇ 1 , m l ⁇
  • the subtracter 130 the input value Y, and outputs a modulus difference value between a remainder value / difference value by a remainder value y T and the second modulus m 1 according to the first modulus m T. More specifically, the subtractor 130 is represented by the equation (3-5), (3-6), (3-11), or (3-12) shown in Supplementary Explanation 1 below (y 1- y T) mod m T or (y T - a y) mod i, is the remainder subtracter for calculating and outputting a modulus difference value between.
  • the subtractor 130 outputs a modulus (eg, a force) larger than the remainder value (for example, the force) by the smaller modulus (for example, m 1 ) of the first modulus m 1 and the second modulus m 1 in the remainder form input value.
  • a modulus difference value (y) mod m T obtained by subtracting a remainder value (for example, m) by (m T ) may be output.
  • the quotient output unit 140 based on the modulus difference value between outputs of the set of second remainder values by the modulus m 1 modulo value and the quotient q of the first modulus of the quotient q as the quotient q. More specifically, quotient output section 140 outputs quotient q shown in equation (3-10), (3-13), or 1-16) in supplementary explanation 1 described later.
  • the modulus difference value between (y to y T ) mod m T or (yLy mod m T is the absolute value of the difference between the first modulus and the second modulus m 1
  • the remainder of the value divided by L I by the first modulus is calculated as the remainder of the quotient q by the first modulus and the remainder by the second modulus i of the quotient q.
  • addition and subtraction multiplication is performed by using the arithmetic residual system, and the scaling operation is performed by using the scaling residual system. And speeding-up of the scaling operation can be realized at the same time.
  • FIG. 4 shows a configuration of a scaling calculator 100 according to a first modification of the present embodiment.
  • the scaling operation unit 100 includes a plurality of first submodular units corresponding to the first modulus m T instead of performing the conversion of the remainder system between the scaling remainder system and the arithmetic remainder system).
  • the input value first plurality Retained surplus value force by the modulus first sub modulus Y ⁇ m T, m T, m T, m T ⁇ input value by the respective Y is divided by a plurality of first sub-remainder values (y f , y ⁇ , y ⁇ , y '), and the second modulus m of the input value Y is represented by a plurality of second sub-modulus ⁇ m l , mm 1 ⁇ , the input value ⁇ in the form of an arithmetic remainder expressed by a plurality of second sub-residue values (, ⁇ 1 , ⁇ 1 ) obtained by dividing the input value Y, and this input value ⁇ Perform scaling on.
  • the scaling calculator 100 includes a first sub-remainder value converter 300, a second sub-remainder value converter 310, a subtractor 320, a condition determination unit 350, and a quotient output unit 370.
  • the first sub-remainder value conversion unit 300 converts a remainder value of the input value Y represented by a plurality of first sub-remainder values (y T , y T , ⁇ ′, y i ) by a first modulus into a plurality of 2 sub-modulus ⁇ m 1, m l, m l ⁇ plurality of first converting sub remainder value is the remainder by the respective ( ⁇ 1, ⁇ ⁇ , ⁇ 1
  • the first sub-remainder value converter 300 generates a plurality of first sub-remainder values (y T , y T , y T , y T ).
  • a conversion result output section 304 for conversion is included.
  • the plurality of first transformed sub-residue values 1 , ⁇ 1 , ⁇ ) can be scaled by obtaining a difference value from (y l,, y x ). May be expressed.
  • the second sub-remainder value converter 310 converts a plurality of remainder values of the input value Y represented by the second sub-remainder values (y 1 , y J , y [ ) by the second modulus m 1 into a plurality of values.
  • Second and modulus m 1 remainder value converter 312 for converting the remainder value y 1 to y 1 binary by binary numbers of a plurality of second conversion sub remainder value expressed by (],, phi 1) Strange
  • ⁇ ⁇ , ⁇ ⁇ may be represented as a scaling factor ⁇ f .
  • the subtracter 320 the input value Y, and outputs a modulus difference value between a difference value of a remainder value and a second modular remainder value according Yurasu m 1 according to the first modulus 1 ⁇ .
  • the subtractor 320 includes a first modulus corresponding subtractor 330 and a second modulus corresponding subtractor 340.
  • the first modulus corresponding subtractor 330 includes a plurality of second conversion sub-remainder values ( ⁇ 1 , ⁇ , ⁇ ,) indicating a residue value y 1 of the input value Y according to the second modulus m 1 , and a first value of the input value ⁇ .
  • a difference value from a plurality of first sub-remainder values (y T , y J , y T , y T ) indicating a remainder value y 1 by a modulus m T a difference value from a plurality of first sub-remainder values (y T , y J , y T , y T
  • the second modulus corresponding subtractor 340 includes a plurality of first converting sub remainder value 1) indicating the remainder value y T by the first modulus m 'of input values Y, the second modulus m 1 of the input value Y Difference value from a plurality of second sub-remainder values (y 1 , .y 1 ) indicating the remainder value y 1
  • condition determining unit 350 the remainder value converter 302 in the first sub remainder value conversion unit 300 outputs in binary format, and a remainder value bin y ⁇ by the first modulus of the input value Upsilon, first Whether the second sub-remainder value converter 310 in the sub-remainder value converter 300 outputs a binary value in the form of a binary number and the remainder value bin y 1 of the second modulus of the input value Y satisfies a predetermined magnitude relationship. Judge the power.
  • condition judging section 350 outputs the first value of input value Y as described in Supplementary Explanation 2 below. 1 the modulus m when retained surplus value bin y 1 by T is greater than the remainder value bin according to the second modulus of the input value, and a remainder value y T by the first modulus m 1 of the input value Y, a second modulus m input values It is determined that the remainder value y by 1 satisfies a predetermined magnitude relationship.
  • the quotient output unit 370 generates a remainder z T z f , ⁇ ′ of the quotient q that is the scaling result Z based on the first modulus difference and the second modulus difference based on the first modulus. , ⁇
  • the quotient output unit 370 includes a difference value adjusting unit 360, a first modulus corresponding quotient output unit 372, and a second modulus corresponding quotient output unit 374.
  • difference value adjusting unit 360 and a remainder value y T by the first modulus of input values Y, and a remainder value y l according to the second modulus of the input value Y, the predetermined magnitude function by condition determining unit 350
  • a first intermodulus difference value and a second intermodulus difference value adjusted by adding a predetermined constant to one of the first intermodulus difference value and the second intermodulus difference value.
  • the intermodulus difference value is supplied to a first modulus corresponding quotient output unit 372 and a second modulus corresponding quotient output unit 374, respectively.
  • the difference value adjusting unit 360 when the condition determining unit 350 determines that the magnitude relation of bin y 1 and bin y T is satisfied, sets the second difference value between modulus (zUP 1 , zUP r , zUP T .zUP 1 ) plus 1 to adjust the second
  • the intermodulus difference value is supplied to a first modulus corresponding quotient output unit 372, and the first intermodulus difference value is supplied to a second modulus corresponding quotient output unit 374.
  • the first modulus corresponding quotient output unit 372 based on the second character Swinging interframe difference value supplied from the difference value adjusting portion 360, a plurality of first sub-modulus ⁇ m T, m T, m T, m T ⁇
  • the first modular Yurasu corresponding quotient output unit 372 the second modulus interframe difference value, which is adjusted by the difference value adjusting portion 360, a plurality of first sub-modulus ⁇ m f, m r, m r, ⁇ 1 ⁇ each By multiple remainders
  • the second modulus corresponding quotient output unit 374 based on the difference value between the first modulus and the second sub-modulus more ⁇ m 1,, ⁇ plurality of remainder values by the respective (z 1, z l, z l
  • the second modulus corresponding quotient output unit 374 converts the first intermodulus difference value into a plurality of remainders by each of the plurality of second submoduli ⁇ m 1 , m l , m l ⁇ .
  • FIG. 5 shows a configuration of the first sub-residue value converter 300 and the second modulus corresponding subtractor 340 according to a first modification of the present embodiment.
  • the second sub-remainder value converter 310 and the first modulus corresponding subtractor 330 are substantially the same as the first sub-remainder value converter 300 and the second modulus corresponding subtractor 340 except that the number of remainder digits is different. The description is omitted for the same configuration.
  • the remainder value converter 302 converts the remainder value y T by the first modulus in binary.
  • the power lj residual value converter 302 includes a converted value subtractor 400a-c, a conversion coefficient calculator 410b-d, and a conversion coefficient adder 420b-d.
  • the converted value subtractor 400a calculates a plurality of first submoduli (m T
  • the value ⁇ (0) subtracted from the value ⁇ (0) is input to the conversion coefficient adder 420b as the conversion coefficient ⁇ used to convert the converted remainder value (0) to 0.
  • the conversion coefficient calculation unit 410b sets the converted remainder value (1) to 0 when subtracted from the converted value ⁇ (1), and generates the first submodulus m f that has already been converted to 0. Calculate the conversion coefficient ⁇ that keeps the corresponding converted residue value at zero. The condition that the conversion coefficient ⁇ must satisfy will be described later.
  • the conversion coefficient adder 420b adds the conversion coefficient H represented by a binary number, calculated by the conversion coefficient calculation section 410b, to the conversion coefficient H. Since y T is less than the first modulus r, the sum of the transform coefficients can be regarded as a remainder value of the first modulus.
  • Converted value subtractor 400b is calculated by conversion coefficient calculation section 410b, a conversion coefficient ⁇ expressed by the remainder value of the first modulus m T, to be converted is subtracted from the converted value .XI (1)
  • the conversion coefficient calculation unit 410c sets the converted remainder value ⁇ (2) to ⁇ when subtracted from the converted value ⁇ (2), and converts the two first submoduli already converted to 0. And a conversion coefficient ⁇ that keeps the converted residue value corresponding to m T at 0.
  • the conversion coefficient adder 420c adds the conversion coefficient ct represented by a binary number, calculated by the conversion coefficient calculation unit 410c, to the conversion coefficients ⁇ and the added value of ⁇ .
  • Converted value subtracter 400c was calculated by the conversion coefficient calculating unit 410c, the transform coefficient a expressed by the remainder value of the first modulus m 1, the conversion is subtracted from the converted value .XI (2) Value ⁇ (3).
  • the conversion coefficient calculating unit 410d subtracts the value from the converted value ⁇ (3), the conversion coefficient value ⁇ (3)
  • the conversion coefficient adder 420d adds the conversion coefficient H represented by a binary number, calculated by the conversion coefficient calculation unit 410d, to the added value of the conversion coefficient ⁇ power. Then, the conversion coefficient adder 420d outputs the addition value of all the conversion coefficients as a binary remainder value /.
  • the conversion coefficient calculation unit 410b-d is the conversion coefficient ⁇ , which is a multiple of one or a plurality of first submoduli already converted to 0, and which is then converted to 0. Calculate the smallest natural number that satisfies the following equation (2-4) with the remainder value set to 0. Where s and are natural numbers.
  • the conversion result output unit 304 outputs a binary remainder, which is an addition value obtained by adding all the conversion coefficients ⁇ and ⁇ calculated by the conversion coefficient adders 420b-d, for all of the plurality of converted residue values.
  • the value y T is divided by each of the plurality of second submoduli ⁇ m 1 , m l , ⁇ 1 ⁇ to obtain a plurality of residue values as a plurality of first conversion sub residue values ⁇ ⁇ , m l , m l ⁇ Output.
  • the result output unit 304 generates a plurality of first conversion sub-residual values ( ⁇ > 1 , ⁇ ⁇ ), which are the remainders of the binary residue value y T by the plurality of second sub-moduli ⁇ m, ml , ml ⁇ , respectively. , [ ) Are included.
  • the first intermodulus difference value i.e., the difference value between the first transform sub-remainder value ( 1 , ⁇ 1 , ⁇ 1 ) and a plurality of second sub-remainder values (y 1 , y l , y l ) z 1
  • FIG. 6 shows a configuration of a condition determining unit 350 and a difference value adjusting unit 36 # according to a first modification of the present embodiment.
  • the condition determination unit 350 determines whether the remainder value bin y T of the input value Y by the first modulus m T and the remainder value bin of the input value Y by the second modulus satisfy a predetermined magnitude relationship. I do.
  • the difference value adjustment unit 360 is a selector that selects the output value 0 when the comparator 500 outputs the logical value 0 and selects the output value 1 when the comparator 500 outputs the logical value 1. including the 510, the output value of the selector 510 second modulus difference value between (zUP 1, ⁇ 1, zUP T, zUP T) and a plurality of modular adder 520 to obtain Caro to.
  • the scaling calculator 100 uses the method shown in Expressions (4-1-8) and (4-1-9) to obtain the second modulus.
  • FIG. 7 shows an operation flow of the scaling calculator 100 according to the first modification of the present embodiment.
  • the remainder value converter 302 in the first sub-residue value converter 300 converts a plurality of first sub-residue values (y T , y T , y r, expressed Ri by the y T), the remainder value y T by the first modulus of input values Y, that converts into binary y T (S600).
  • the residue value converter 312 in the second sub residue value conversion unit 310 converts the residue value by the second modulus expressed by the plurality of second sub residue values (y 1 , y l , y l ) into a binary number. the conversion of the y 1.
  • conversion coefficient calculation section 410b d in remainder value converter 302 a plurality of first sub remainder value (y 1, y T, y T, y T) represented by the input values by A plurality of first sub-moduli (m T ) in the transformed value ⁇ ( ⁇ ) with the remainder y 1 of the first modulus 1 ⁇ of Y as the initial value S (0)
  • the remainder value converter 302 sets the first conversion residue value, that is, the conversion coefficient H to ⁇ . Then, the converted value subtractor 400a also updates the converted value to ⁇ (1) by subtracting the conversion coefficient a for each remainder digit power of the converted value ⁇ (0).
  • the transform coefficient adder 420b-d in the remainder value converter 302 includes a transform coefficient ⁇ , which is sequentially calculated by the transform coefficient calculator 410b-d and represented by the remainder value by the first modulus. Are sequentially added. Then, the converted value subtractor 400b-d sequentially subtracts the conversion coefficient ⁇ , which is sequentially calculated by the conversion coefficient calculating unit 410b-c and is expressed by the remainder value by the first modulus, from the converted value S ( ⁇ ). .
  • the conversion result output unit 304 converts the binary number y 1 into a plurality of first conversion sub-residue values ( ⁇ 1 , ⁇ 1
  • the conversion result output unit 314 converts the binary number into a plurality of second conversion sub-residue values.
  • the first inter-modulus difference value (z, ⁇ 1 , ⁇ 1 ), which is the difference value between the remainder value y f of the first modulus n / and the remainder value y 1 of the second modulus, and the second inter-modulus difference value. (zUP ⁇
  • the condition determining unit 350 determines that / and y 1 are predetermined. It is determined that the obtained magnitude relationship is satisfied (S630).
  • the above-described transform coefficient calculation units 410b-d input each of the transformed residue values instead of being realized by the residue-based adder, and convert the transformed coefficient ct corresponding to the transformed residue value ⁇ . It may be constituted by an output lookup table. More specifically, the conversion coefficient calculation unit 410b-d stores, for each of the plurality of converted residue values, the conversion coefficient corresponding to the converted residue value as data at an address corresponding to the converted residue value. The conversion coefficient corresponding to the converted remainder value may be output from the memory.
  • the memory stores, at an address corresponding to the value of the converted residue value, a conversion coefficient corresponding to the converted residue value, a binary value and a plurality of second submodulus values. It may be stored as two kinds of data of the remainder value of a number.
  • the binary conversion coefficient supplied from the conversion coefficient calculation unit 410b to the conversion coefficient adder 420b-d to the conversion coefficient adder 420b-d and the plurality of second submoduli supplied to the converted value subtractor 400b-c are represented.
  • the conversion coefficients can be read directly from the memory and supplied.
  • the transform coefficient calculating unit 410b-d calculates, for each of the plurality of converted remainder values ⁇ in the converted value ⁇ , the first first sub-modulus m 1 to m f which is larger than the first one.
  • the second modulus corresponding subtractor 340 converts the transform coefficients sequentially calculated by the transform coefficient calculating units 410b-d into the input values Y From the remainder value (y 1 , y L , y l ) of the second modulus of
  • the second modulus corresponding subtractor 340 is sequentially calculated by a modification ⁇ number calculating section 410B- d, a plurality of second sub-modulus ⁇ m, m l , ⁇ Of the transform coefficients monument expressed by a plurality of residue values by the respective plurality of second sub remainder value 'im 1, m' .m ⁇ second modulus ⁇ n input values Y expressed by ⁇ .
  • the first inter-modulus difference value (, z l , z l ) represented by the value may be output.
  • FIG. 8 shows a configuration of a scaling calculator 100 according to a second modification of the present embodiment.
  • Z ⁇ m T from the following equation (3-8)
  • the following equation (2-5) is established by applying the following equation (3-9).
  • the first sub-modulus ⁇ m j , m J , ⁇ expresses the first sub-modulus represented by a plurality of residue values. scale one ring results a modulus difference value between, zeta 1, z l) a plurality of first sub-modulus ⁇ m 1, ⁇ ', m
  • m T ⁇ can be converted to a scaling result (z T , z T , z T , z r ) which is a difference value between the conversion moduli represented by a plurality of residual values.
  • the scaling calculator 100 includes a first sub-residue value converter 300, a subtractor 320 including a second modulus-subtractor 340, a second sub-residue value converter 310, And an output unit 370.
  • the first sub-remainder value converter 300, the second sub-remainder value converter 310, the second modulus corresponding subtractor 340, and the quotient output unit 370 according to the present modification are the first sub-remainder value converter shown in FIG. 300, the second sub-residue value converter 310, the second modulus corresponding subtractor 340, and the quotient output unit 370 have the same functions and configurations, respectively, and therefore the description will be omitted except for the following differences.
  • the subtracter 320 the input value Y, as a modulus difference value between a difference value of the remainder value y 1 by the remainder value y T and the second modular rocked by the first modulus and the second modulus pair ⁇ adder 340 Output the first modulus difference value output by.
  • the first intermodulus difference value is the same as the scaling result ( ⁇ 1 , ⁇ 1 , z l ) in the case of m ⁇ ri ⁇ -l.
  • the second sub-remainder value conversion section 310 generates a first inter-modulus difference value ( ⁇ 1 , ⁇ 1) expressed by a plurality of remainder values of each of the plurality of second sub-moduli ⁇ m 1 , ⁇ . , ⁇ 1 ) is converted into a difference value between the conversion moduli represented by a plurality of remainder values by each of the plurality of first submoduli ⁇ m T , m T , m T , m 1 ⁇ .
  • quotient output unit 370 does not have a difference value adjustment unit 360, a plurality by each, based on the difference value between the conversion modulus, a plurality of first sub-modulus ⁇ m T, m T, m .m 1 ⁇ of the more expressive the remainder value, the remainder value of the first modulus of the quotient q to be scaled result Z (z 1, ⁇ ⁇ , ⁇
  • FIG. 9 shows an operation flow of the scaling calculator 100 according to the second modification of the tree embodiment.
  • the remainder value converter 302 in the first sub-remainder value conversion unit 300 When the input value ⁇ , which is the number to be scaled in the arithmetic remainder format, is input, the remainder value converter 302 in the first sub-remainder value conversion unit 300 generates a plurality of first sub-remainder values (y f , ⁇ 1 , y T, expressed Ri by the y T), the first modulus [pi / by the remainder value of the input value Y, that converts into binary y T (S800). Next, the conversion result output unit 304 converts the binary yT into a plurality of first conversion sub-residue values ( ⁇ 1 , (S810
  • the second sub remainder value conversion unit 310 a plurality of second sub-modulus ⁇ m 1;! M, m l ⁇ first modulus expressed by a plurality of residue values by Noso respectively
  • the inter-difference value is converted into a converted inter-modulus difference value represented by a plurality of remainder values by each of the plurality of] sub-moduli ⁇ m T , m ′, m r , m T ⁇ (S830).
  • the quotient output unit 370 generates a remainder value (', ⁇ ⁇ , ⁇ ⁇ ) and a remainder value of the second modulus of the quotient q that is the scaling result Z as a result of scaling. value ( ⁇ , ⁇ 1) and outputs a set of (S850).
  • each remainder digit of the scaling result Z can be generated using one difference value between the modulus calculated by the subtractor 320, and the amount of hardware can be reduced.
  • FIG. 10 shows an example of a hardware configuration of a computer 900 according to the present embodiment.
  • the computer 900 according to the present embodiment includes a CPU 1000, a ROM 1010, a RAM 1020, a communication interface 1030, a hard disk drive 1040, a flexible disk drive 1050, and a CD-ROM drive 1060.
  • the CPU 1000 operates based on the programs stored in the ROM 1010 and the RAM 1020, and controls each unit.
  • the ROM 1010 stores a boot program executed by the CPU 1000 when the computer 900 is started, a program that depends on the hardware of the computer 900, and the like.
  • the RAM 1020 stores a program executed by the CPU 1000, data used by the CPU 1000, and the like.
  • the communication interface 1030 communicates with another device via a communication network.
  • the hard disk drive 1040 stores programs and data used by the computer 900 and supplies the programs and data to the CPU 1000 via the RAMI 020.
  • the flexible disk drive 1050 reads a program or data from the flexible disk 1070 and provides it to the RAM 1020.
  • the CD-ROM drive 1060 reads a program or data from the CD-ROM M1080 and provides it to the RAM 1020.
  • the program provided to the CPU 1000 via the RAM 1020 is stored in a recording medium such as a flexible disk 1070, a CD-ROM 1080, or an IC card and provided by a user.
  • the program is read from the recording medium, installed in the computer 900 via the RAM 1020, and executed by the computer 900.
  • the program is installed and executed on the computer 900, and the computer 900 is
  • the program functioning as the stem 5 includes a remainder operation module, and a scaling operation module including an overflow detection module, a remainder format conversion module, a subtraction module, a quotient output module, and a remainder format inverse conversion module.
  • These programs or modules control the CPU 1000 and / or the RAM 1020 in the computer 900, and store the remainder system arithmetic unit 10, the overflow detector 110, the remainder format converter 120, the subtractor 130, the quotient output unit 140, and the remainder format inverse unit. Each of them functions as the scaling calculator 100 including the converter 150.
  • the scaling operation module may include a first sub-remainder value conversion module including a remainder value conversion module and a conversion result output module, and a second sub-remainder value including the remainder value conversion module and a conversion result output module.
  • a quotient output module including an output module.
  • These programs or modules include a CPU 1000 and a Z or a RAM 1020 in the computer 900, a first sub-residue value conversion unit 300 including a residue value converter 302 and a conversion result output unit 304, a residue value converter 312 and a conversion unit.
  • a second sub-residue value converter 310 including a result output unit 314; a subtractor 320 including a first modulus corresponding subtractor 330 and a second modulus corresponding subtractor 340; a condition determining unit 350; a difference value adjusting unit 360 ,
  • a quotient output unit 370 including a first modulus quotient output unit 372 and a second modulus quotient output unit 374.
  • the scaling operation module includes a first sub-remainder value conversion module including a remainder value conversion module and a conversion result output module, and a second sub-remainder value conversion module including a remainder value conversion module and a conversion result output module.
  • a subtraction module including a second modulus corresponding subtraction module, and a quotient output module including a first modulus corresponding quotient output module and a second modulus corresponding quotient output module.
  • These programs or modules include a CPU 1000 and / or a RAM 1020 of a computer 900, a first sub-residue value converter 300 including a residue value converter 302 and a conversion result output unit 304, a residue value converter 312,
  • the second sub-residue value change including the conversion result output unit 314
  • the programs or modules described above may be stored in an external recording medium.
  • an optical recording medium such as a DVD or PD, a magneto-optical recording medium such as an MD, a tape medium, and a semiconductor memory such as an IC card can be used.
  • a storage device such as a hard disk or a RAM provided in a server system connected to a dedicated communication network or the Internet is used as a recording medium, and an external network device also provides a program to the computer 900 through the communication network. May be.
  • the Chinese remainder theorem shown in equation (1-17) is If you use it, you will be doing 24-bit binary multiplication 7 times.
  • the scaling calculator 100 shown in FIG. 2 the same scaling can be realized by performing 12-bit multiplication seven times.
  • the calculation amount of the product-sum operation is proportional to the square of the number of bits.
  • the calculation amount is (n / 2 C. Therefore, according to the scaling calculator 100 shown in FIG. 2, the calculation amount is reduced to 14 compared to the conventional method. Can be done.
  • each residue digit of the binary number (2 to 5 Bit) will be performed 9 to 12 times.
  • the force by selecting the modulus is approximately (n + (l / 2) n) C, and the amount of calculation is smaller than that of the conventional method. (l / 24) n.
  • the scaling number Y is represented by the first remainder form 1) of the first set of remainder value y 1 by the remainder value y f and a second modulus m 1 according to the modulus m 1.
  • equation (1 one 2), the following equation (3-2) and the equation - 3) is satisfied.
  • is the remainder value of
  • y 1 is the remainder value of Y divided by m 1
  • equation (3-4) By substituting equation (3-1) into equation (3-3) and subtracting this from equation (3-2), the following equation (3-4) can be obtained. — You can see that 5) holds.
  • the number to be scaled represented by a plurality of second sub-remainder values (y 1 , y l is converted to a plurality of second transformation sub-remainder values (a scaling coefficient ⁇ r represented by
  • a method of calculating ⁇ in the scaling result z using the converted modulus difference value will be described.
  • a scaling remainder system is used for convenience of description below.

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Computational Mathematics (AREA)
  • Mathematical Analysis (AREA)
  • Mathematical Optimization (AREA)
  • Pure & Applied Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • General Engineering & Computer Science (AREA)
  • Complex Calculations (AREA)

Abstract

 数値を第1モジュラスによる剰余値及び第2モジュラスによる剰余値の組による第1の剰余形式で表現する剰余系において、第1の剰余形式の入力値を第2モジュラスで割った第1の剰余形式の商を算出するスケーリング演算器であって、入力値における、第1モジュラスによる剰余値及び第2モジュラスによる剰余値の差分値であるモジュラス間差分値を出力する減算器と、モジュラス間差分値に基づいて、商の第1モジュラスによる剰余値及び商の第2モジュラスによる剰余値の組を商として出力する商出力部とを備えるスケーリング演算器を提供する。

Description

明 細 書
剰余系演算システム、スケーリング演算器、スケ一リング演算方法、及び そのプログラムと記録媒体
技術分野
[0001] 本.発明は、剰余系演算システム、スケーリング演算器、スケ一リング演算方法、及び そのプログラムと記録媒体に関する。特に本発明は、剰余系で表現された数値のス ケーリング演算を効率良く行う剰余系演算システム、スケーリング演算器、スケーリン グ演算方法、及びそのプログラムと記録媒体に関する。また、本出願は、下記の日本 出願に関連する。文献の参照による組み込みが認められる指定国については、下記 の出願に記載された内容を参照により本出願に組み込み、本出願の一部とする。
1.特願 2003— 284534 出願曰 2003年 07月 31曰
背景技術
[0002] 従来、ディジタル回路による数値演算は、 2進数にもとづく論理回路により実現され ている。また近年、剰余系 (Residue Number System; RNS)による数値演算方法が提 案されている (非特許文献 1)。剰余系による加算、減算、及び乗箕は、次に述べる理 由により、従来の 2進数による演算よりも高速に計算できることが知られている。
[0003] 2進数での加算は、各ビットの演算力 桁上がり(キャリー)信号が生じ、さらに LSB 側から MSB側に伝播する。このため、(i-1)番百のビットのキヤリ一が到達するまで。 i 番目の桁の計算結果は決定できない。したがって、演算対象となるオペランドのビッ ト数に比例して遅延量は大きくなる。一方、剰余系による演算は、各剰余桁で独立し て並列に計算することができ、計算速度が計算ビット数に依存しないため、高速化す ることができる。
[0004] 剰余系では 1つの数値 Xを、 N個の剰余数 (剰余値)の組み合わせで表現する。
[0005] [数 1]
[0006] 式(1一 1)において x = X mod m (x = |X| とも表現する)であり、 Xお番目のモジュラ ス(modulus:法) m,で割った剰余(Residue)である eまた, xを剰余桁 (Residue Digit)、 又は、モジュラス mによる剰余値ともよぶ。ここで、 modは moduloの略であり、以下の式 (1一 2)が成立することを意味する。
[0007] [数 2]
X = pm, + (. (1-2)
[0008] ここで pは Xを mで割った商である。このとき Xと Xはモジュラス mにつレ、て合同
(congruent)であるといい、合同式 (congruence)をもちいて以下の式により表現してもよ レ、。
[0009] 删
X≡X/ modw; (l"3)
[0010] N個のモジュラス m(i = 0,1,2, '··,Ν-1)が互いに素 (relatively prime)であるとき、以下 に示す範囲のすべての数値 Xを、 N個の剰余数の一意的組み合わせで表現すること ができる。このとき, {m , m , m, ·.., m }をモジュラスセットとよぶ。
[0011] 画
0<X <]lm, =M (1-4)
(=0
[0012] 例として,モジュラスセット {m , m , m , m }= {8,7, 5, をもちいた剰余表現を考えると、 この剰余系では iM二 8X7X5X3 = 840個の整数を表現することができる。例えば、 (0,0,0,0) は 0または 840または 1680·''、 (1,1,1,1) は 1または 841または
1681···、 (0,1,3,2) は 8または 848または 1688···、 (0,1,4,1) は 64または 904 または 1744·'·、となる。そしてモジュラスセット {8,7,5,3)の場合、各剰余桁を表現する ために必要となるビット数は、 [3bit, 3bit, 3bit, 2bit ] = libitである。
[0013] 剰余系においては、加算、減算、乗算について、各剰余桁同士を独立に演算する ことにより実現することができ、剰余桁間の情報の伝播は不要である。すなわち、次に 示す定理が成立する。
[0014] (剰余系加減乗算の定理) 演算子「〇」を加算、減算、又は乗算を表現する演算子とし、剰余系のモジュラスを {m ,m ,---,m }、オペランドを A= (a,a ,a,...,a )、 B= (b , b ,...,b )とすると、 Z=A
0 1 N-l 0 1 2 N-l 0 1 2 N~l
〇Bは、オペランドの各モジュラスに対する剰余桁同士の演算により実現できる。
[0015] [数 5]
(1-5)
= .V, = "'。 '
[0016] ここで、左辺は Υの mによる剰余値である。また、式(1—5)による演算を剰余加算、 剰余減算、又は剰余乗算とよぶ。剰余系加減乗算の定理は、以下に示すように証明 される。
[0017] (剰余系加減乗算の定理の証明)
剰余系の数値表現の定義から、以下の式(1一 6)が成立する。
[0018] [数 6]
A = Pj/rij +ai;B- qiml + '· (1-6)
[0019] こで、 pは Aをモジュラス mで割った商であり、 qは Bをモジュラス mで割った商であ る。
[0020] 加減算においては、以下の式(1一 7)が成立する。
[0021] [数 7]
Figure imgf000005_0001
[0022] ここで、(p+q)m≡0より、以下の式(1一 8)が成立する。
[0023] [数 8]
Y (1-8)
[0024] 一方、乗算においては、以下の式(1一 9)が成立する。
[0025] [数 9] ' (1-9)
\(plql-ml + ptbi + qlai )ms + albl
[0026] :で、(p q m+p b +q a)mョ 0より、以下の式(1一 10)が成立す
[0027] [数 10]
Figure imgf000006_0001
[0028] 上記の式(1一 8)及び式(1一 10)から、 Α及び Βの各剰余桁同士の演算により、 Yの 各剰余桁を算出できることが分かる。したがって、式 一 5)の定理が成立することが 証明される。
[0029] 剰余系加減乗算の定理より、剰余系での加減乗算は、入力される 2つのオペランド A及び Bと、出力される演算結果 Yの対応する剰余桁毎に、当該剰余桁についての演 算を行う剰余演算 ALU (Arithmetic Logic Unit)を設けることにより実現することがで きる。そして、ある剰余桁の計算は、他の剰余桁の計算と独立に行うことができる。各 剰余桁に対応する剰余演算 ALUでの演算においては、キャリー伝搬による遅延が 当該剰余桁のビット数分に限定できるため、より高速に計算することができる。
[0030] 剰余系を用いて数値演算を高速化するためには、 2進数系又は 10進数系から剰 余系への変換 (Binary-to- Residue (B/R) converter),および剰余系から 2進数系又は 10進数系への変換 (Residue- to- Binary (R/B) converter)が必要である。 B/R converterは比蛟的簡単に実現でき、 R/B converterを実現する方法はいくつか検討 されている。
[0031] R/B converterとしては、中国人の剰余定理(Chinese Remainder Theorem)を用い るものが一般的である。モジュラスセットが {m ,m ,m ,m }={8,7,5,3}の場合において、 Y
0 1 2 3
= (y ,y ,y,y )=(5,3,4,2)を 10進数に変換する場合を例に示す。
0 1 2 3
(5,3,4,2)は、式(1一 5)に示した剰余系加減乗算の定理から以下の式(1一 11)に示 すように変形でき、更に式(1一 12)を得ることができる。
[0032] [数 11]
(5,0,0, 0) + (0,3, 0, 0) + (0, 0, 4, 0) + (0, 0, 0,2) (1 - 11) [0033] [数 12]
5χ(1,0,0,0) + 3χ(0,1,0,0) + 4χ(0,0,1,0) + 2χ(0,0,0,1) (1-12)
[0034] このように、(1,0,0,0) , (0,1,0,0), (0,0,1,0),(0,0,0,1)に対応する 10進数表現を予め 求めておけば、以下の式(1一 13)を用レ、て任意の剰余表現 (y ,y ,y ,y)を 10進数表 現に変換できる。
[0035] [数 13]
^(Ι,Ο,Ο,Ο)", χ(0,1,0,0) + 2 (0,0,1,0) + 3x(0,0, 0,1) (1-13)
[0036] ここで、(1,0,0,0)は、モジュラス 8(=m )に対する剰余が 1、かつ、モジュラスのサブセ ット {7,5,3Mm ,m ,m Hこ対する剰余が 0である数値である。後者の条件は、 m , m , m
1
の最小公倍数であることを条件として (1,0,0,0)を算出すれば満たすことができる。これ らの条件は、以下の式(1一 14)により表すこと力 Sできる。
[0037] [数 14] a) (l,0,0,0)modWo-l, ひ 丄 b) (1,0,0,0) = ?0·^! -m2 -m3
[0038] ここで /30は自然数である そして、 m ,m,mが互いに素であれば、式(1一 4)より a) 及び b)の条件は以下の式(1一 15)に書き換えることができる。
[0039] [数 15]
^■( /mojmodwo =1 (1"15)
[0040] 上記の自然数^ を求めることにより、(1,0,0,0)の 10進数表現を求めることができる。
以下に、 {8,7, 5,3}乗 ij余系にっレ、て (1,0,0,0) , (0,1,0,0), (0,0,1,0), (0,0,0,1)の 10進数 表現を示す。
[0041] [数 16] m, =8: M/w。 = 105, 0 = 1(1ョ 105mod8)
人(1,0,0,0) = 105
in. =7: M/m, =120, β] =l(lsl20mod7)
.-.(0,1, 0,0) = 120
(1-16) m2 = 5: M/w2 = 168, = 2(1≡ 168x 2mod5)
.-.(0,0,1,0) = 336
m =3: W/w3 =280, ¾ = l(l≡ 280mod3)
.-.(0,0,0,1) = 280.
[0042] 式(1一 16)から、 {8,7, 5,3}剰余系で表現された数値 (5,3,4,2)の 10進数への変換は、
5X 105 + 3X 120 + 4 336 + 2X280 = 2117となる。ただし、この剰余系で表現できる 数値は 0≤Yく M=840であるため、 Y H2117I : 437となる。
M
[0043] 一般に, 中国人の剰余定理は次式で導かれる。
[0044] [数 17]
( ¾, ,…, ^(1,0,0,...(0)+^,(0, 1,0,...,0) + ...+ ^_1(0,0,0,...,1)
M
(1-17) m、
Figure imgf000008_0001
[0045] 特許文献 Parhami, Computer Arithmetic, Oxford University Press, 2000年, pp.54-72
発明の開示
発明が解決しょうとする課題
[0046] 剰余系をもちいると、加減乗算を高速に計算できる。しかし,次に述べるスケーリン グ演算のため、 2進数で加減乗算を計算するよりも高速にならないという問題点があ る。
[0047] 2進数で nビット X nビットの乗算をおこなうと、乗算結果は (2n)ビットとなる。 (514) X (237)のように 1回の乗算であれば、入力 nビットにたいして (2n)ビットの乗算結果をそ のまま出力すればよい。 [0048] ところが (514) Χ (237) Χ ' · · Χ (353)のように乗算を繰り返すと、出力ビット数は大きく なってしまう。例えば 10進数の (15/16) X (15/16)を計算すると、(225/256)が乗算結果 となる力 S、出力ビットが 4ビットし力ないときは計算結果の一部を切捨て (truncate)て、 入力ビット数と同じ nビットを計算結果として出力する。これは nビット右へシフトする という処理に相当する。本例においては (15/16) X (15/16) =(225/256)を、 4ビットシフ トし、乗算結果として 4/16)を出力する。この桁合わせ処理のことをスケーリング (Scaling :縮小化)といい、例えば浮動小数点乗算における仮数部の桁合わせ等に用 いられる。
[0049] このスケーリング処理を 2進数に施すには、 2進数の各桁に対応して重み付けされ ているから、ビットシフト処理、あるいは不要なビットをマスクするだけでよい。すなわ ち nビットに対応するシフト時間を必要とするのみである。しかし、剰余系で表現され た数値に対しては、スケーリングをビットシフト操作で実現できない。例えば {8,7,5,3} 剰余系で、 (5,3,4,2) X (3,2,4,2) (-437 X 779 dec)の乗算をすると、乗算結果は
340,423 decとなる。この剰余系では最大 839までの数値しか表現できない。したがつ て, {8,7,5,3}剰余系の^840でスケーリングして、乗算結果を 405とする必要がある。と ころが, (5,3,4,2) X (3,2,4,2) = (7,6,1,1) となり、このままでは 405 = (5,6,0,0)に
RNS[3,7,5,3l
スケーリングすることができなレ、。
[0050] 剰余系においてスケーリングを行うために、中国人の剰余定理を利用する方法も考 えられる。すなわち、乗算結果 (7,6,1 ,1)を 2進数 (1010011000111000111)に変換し、こ の結果を上述したビットシフトによりスケーリングして (101001 100)を得る。そして、再び 剰余系に変換して (5,6,0,0)を得るという処理である。し力しな力 、中国人の剰余定 理は式(1一 17)に示したように、各剰余桁 yと定数 b ' (M/m )との乗算を伴うため、計 算時間を要することになる。乗算を多用するような数値計算処理を行うとき、乗算毎に 中国人の剰余定理を用いて 2進数に変換しスケーリングすると、剰余系で乗算するメ リット(計算速度向上)が失われてしまう。
[0051] そこで本発明は、上記の課題を解決することのできる剰余系演算システム、スケーリ ング演算器、スケーリング演算方法、及びそのプログラムと記録媒体を提供することを 目的とする。この目的は請求の範囲における独立項に記載の特徴の組み合わせに より達成される。また従属項は本発明の更なる有利な具体例を規定する。
課題を解決するための手段
[0052] 本発明の第 1の形態によると、数値を第 1モジュラス(法)による剰余値及び第 2モジ ュラスによる剰余値の組による第 1の剰余形式で表現する剰余系において、前記第 1 の剰余形式の入力値を前記第 2モジュラスで割った前記第 1の剰余形式の商を算出 するスケーリング演算器であって、前記入力値における、前記第 1モジュラスによる剰 余値及び前記第 2モジュラスによる剰余値の差分値であるモジュラス間差分値を出 力する減算器と、前記モジュラス間差分値に基づいて、前記商の第 1モジュラスによ る剰余値及び前記商の前記第 2モジュラスによる剰余値の組を前記商として出力す る商出力部とを備えるスケーリング演算器を提供する。
[0053] 前記第 1モジュラス及び前記第 2モジュラスは互いに素であってよい。また、前記第 ]モジュラス及び前記第 2モジュラスの差は 1であり、前記商出力部は、前記商の第 1 モジュラスによる剰余値及び前記商の前記第 2モジュラスによる剰余値として、前記 モジュラス間差分値の前記第 1モジュラスによる剰余値を出力してよい。
[0054] また、前記第 1モジュラス及び前記第 2モジュラスの積を前記第 1モジュラス及び前 記第 2モジュラスの差の絶対値により割った値が前記入力値以上の場合に、前記入 力値のオーバーフローを検出するオーバ一フロー検出器を更に備えてもよい。
[0055] また、前記減算器は、前記剰余形式の前記入力値における、前記第 1モジュラス及 び前記第 2モジュラスのうちより小さいモジュラスによる剰余値力 より大きいモジュラ スによる剰余値を減じた前記モジュラス間差分値を出力し、前記商出力部は、前記 モジュラス間差分値を前記第 1モジュラス及び前記第 2モジュラスの差の絶対値によ り割った値の前記第 1モジュラスによる剰余値を、前記商の第 1モジュラスによる剰余 値及び前記商の前記第 2モジュラスによる剰余値として算出してもよい。
[0056] また、前記第 1モジュラスは、互いに素な複数の整数である複数の第 1サブモジュラ スの積であり、前記第 2モジュラスは、互いに素な複数の整数である複数の第 2サブ モジュラスの積であり、前記入力値の前記第 1モジュラスによる剰余値力;、前記複数 の第 1サブモジュラスのそれぞれにより前記入力値を割った複数の第 1サブ剰余値に より表現され、前記入力値の前記第 2モジュラスによる剰余値が、前記複数の第 2サ ブモジュラスのそれぞれにより前記入力値を割った複数の第 2サブ剰余値により表現 された第 2の剰余形式の前記入力値を、前記第 1の剰余形式の前記入力値に変換 する剰余形式変換器と、前記商出力部が出力した前記第 1の剰余形式の前記商を、 前記第 2の剰余形式の前記商に変換する剰余形式逆変換器とを備えてもよい。
[0057] また、前記第 1モジュラスは、互いに素な複数の整数である複数の第 1サブモジュラ スの積であり、前記第 2モジュラスは、互いに素な複数の整数である複数の第 2サブ モジュラスの積であり、前記入力値は、前記第 1モジュラスによる剰余値が、前記複数 の第 1サブモジュラスのそれぞれにより前記入力値を割った複数の第 1サブ剰余値に より表現され、前記第 2モジュラスによる剰余値が、前記複数の第 2サブモジュラスの それぞれにより前記入力値を割った複数の第 2サブ剰余値により表現された第 2の剰 余形式により更に表現され、前記複数の第 1サブ剰余値により表現された、前記入力 値の前記第 1モジュラスによる剰余値を、前記複数の第 2サブモジュラスのそれぞれ による剰余である複数の第 1変換サブ剰余値に変換する第 1サブ剰余値変換部を更 に備え、前記減算器は、前記入力値の前記第 1モジュラスによる剰余値を示す前記 複数の第 1変換サブ剰余値と、前記入力値の前記第 2モジュラスによる剰余値を示 す前記複数の第 2サブ剰余値との差分値であって、前記複数の第 2サブモジュラス のそれぞれにより当該差分値を割った複数の剰余値により表現された第 1の前記モ ジュラス間差分値を出力する第 2モジュラス対応減算器を有し、前記商出力部は、前 記第 1のモジュラス間差分値に基づいて、前記複数の第 2サブモジュラスのそれぞれ による複数の剰余値により表現された前記商の前記第 2モジュラスによる剰余値を出 力する第 2モジュラス対応商出力部を有してもよい。
[0058] また、前記複数の第 2サブ剰余値により表現された、前記入力値の前記第 2モジュ ラスによる剰余値を、前記複数の第 1サブモジュラスのそれぞれによる剰余である複 数の第 2変換サブ剰余値に変換する第 2サブ剰余値変換部を更に備え、前記減算 器は、前記入力値の前記第 2モジュラスによる剰余値を示す前記複数の第 2変換サ ブ剰余値と、前記入力値の前記第 1モジュラスによる剰余値を示す前記複数の第 1 サブ剰余値との差分値であって、前記複数の第 1サブモジュラスのそれぞれにより当 該差分値を割った複数の剰余値により表現された第 2の前記モジュラス間差分値を 出力する第 1モジュラス対応減算器を更に有し、前記商出力部は、前記第 2のモジュ ラス間差分値に基づいて、前記複数の第 1サブモジュラスのそれぞれによる複数の 剰余値により表現された前記商の前記第 1モジュラスによる剰余値を出力する第 1モ ジュラス対応商出力部を更に有してもよい。
[0059] また、前記入力値の前記第 1モジュラスによる剰余値と、前記入力値の前記第 2モ ジュラスによる剰余値とが、予め定められた大小関係を満たすか否かを判断する条 件判断部を更に備え、前記商出力部は、前記入力値の前記第 1モジュラスによる剰 余値と、前記入力値の前記第 2モジュラスによる剰余値とが、前記予め定められた大 小関係を満たす場合に、前記第 1のモジュラス間差分値及び前記第 2のモジュラス間 差分値の一方に予め定められた定数を加えて調整した前記第 1のモジュラス間差分 値及び前記第 2のモジュラス間差分値を、前記第 1モジュラス対応商出力部及び前 記第 2モジュラス対応商出力部にそれぞれ供給する差分値調整部を更に有してもよ レ、。
[0060] また、前記第 1モジュラスは、前記第 2モジュラスより 1大きぐ前記条件判断部は、 前記入力値の前記第 1モジュラスによる剰余値が前記入力値の前記第 2モジュラス による剰余値より大きい場合に、前記入力値の前記第 1モジュラスによる剰余値と、 前記入力値の前記第 2モジュラスによる剰余値とが、前記予め定められた大小関係 を満たすと判断し、前記予め定められた大小関係を満たす場合に、前記差分値調整 部は、前記第 2のモジュラス間差分値に 1を加えて調整し、前記第 1モジュラス対応商 出力部は、前記差分値調整部により調整された前記第 2のモジュラス間差分値を、前 記複数の第 1サブモジュラスのそれぞれによる複数の剰余値により表現された前記 商の前記第 1モジュラスによる剰余値とし、前記第 2モジュラス対応商出力部は、前記 第 1のモジュラス間差分値を、前記複数の第 2サブモジュラスのそれぞれによる複数 の剰余値により表現された前記商の前記第 2モジュラスによる剰余値としてもよい。
[0061] また、前記第 1サブ剰余値変換部は、前記複数の第 1サブ剰余値により表現された 前記入力値の前記第 1モジュラスによる剰余値を初期値とする被変換値における、 前記複数の第 1サブモジュラスのそれぞれにより前記被変換値を割った複数の被変 換剰余値のそれぞれについて、前記被変換値から減じた場合に、順次当該被変換 剰余値を 0とし、かつ、既に 0に変換された他の全ての前記被変換剰余値を 0に保つ 変換係数を算出する変換係数算出部と、前記変換係数算出部により順次算出される
、前記第 1モジュラスによる剰余値により表現された前記変換係数を、順次加算して レ、く変換係数加算器と、前記変換係数算出部により順次算出される、前記複数の第
1サブモジュラスのそれぞれによる複数の剰余値により表現された前記変換係数を、 前記被変換値力 順次減じる被変換値減算器と、前記複数の被変換剰余値の全て について算出された全ての前記変換係数が前記変換係数加算器により加算された 加算値を前記複数の第 2サブモジュラスのそれぞれにより割った複数の剰余値を、前 記複数の第 1変換サブ剰余値として出力する変換結果出力部とを備えてもよい。
[0062] また、前記変換係数算出部は、前記複数の被変換剰余値のそれぞれについて、当 該被変換剰余値に対応するアドレスに、当該被変換剰余値に対応する前記変換係 数をデータとして格納するメモリを含んでもょレ、。
[0063] また、前記第 1モジュラスは、互いに素な複数の整数である複数の第 1サブモジュラ スの積であり、前記第 2モジュラスは、互いに素な複数の整数である複数の第 2サブ モジュラスの積であり、前記入力値は、前記第 1モジュラスによる剰余値が、前記複数 の第 1サブモジュラスのそれぞれにより前記入力値を割った複数の第 1サブ剰余値に より表現され、前記第 2モジュラスによる剰余値が、前記複数の第 2サブモジュラスの それぞれにより前記入力値を割った複数の第 2サブ剰余値により表現された第 2の剰 余形式により更に表現され、前記複数の第 1サブ剰余値により表現された前記入力 値の前記第 2モジュラスによる剰余値を初期値とする被変換値における、前記複数の 第 1サブモジュラスのそれぞれにより前記被変換値を割った複数の被変換剰余値の それぞれについて、前記被変換値から減じた場合に、順次当該被変換剰余値を 0と し、かつ、既に 0に変換された他の全ての前記被変換剰余値を 0に保つ変換係数を 算出する変換係数算出部と、前記変換係数算出部により順次算出される、前記複数 の第 1サブモジュラスのそれぞれによる複数の剰余値により表現された前記変換係 数を、前記被変換値から順次減じる被変換値減算部とを更に備え、前記減算器は、 前記変換係数算出部により順次算出される、前記複数の第 2サブモジュラスのそれ ぞれによる複数の剰余値により表現された前記変換係数を、前記複数の第 2サブ剰 余値により表現された前記入力値の前記第 2モジュラスによる剰余値力 順次滅じて 前記複数の第 2サブモジュラスのそれぞれによる複数の剰余値により表現された第 1 の前記モジュラス間差分値を出力する第 2モジュラス対応減算器を有し、前記商出力 部は、前記第 1のモジュラス間差分値に基づいて、前記複数の第 2サブモジュラスの それぞれによる複数の剰余値により表現された前記商の前記第 2モジュラスによる剰 余値を出力する第 2モジュラス対応商出力部を有してもよい。
また、前記第 1モジュラスは、互いに素な複数の整数である複数の第 1サブモジュラ スの積であり、前記第 2モジュラスは、互いに素な複数の整数である複数の第 2サブ モジュラスの積であり、前記入力値は、前記第 1モジュラスによる剰余値が、前記複数 の第 1サブモジュラスのそれぞれにより前記入力値を割った複数の第 1サブ剰余値に より表現され、前記入力値の前記第 2モジュラスによる剰余値が、前記複数の第 2サ ブモジュラスのそれぞれにより前記入力値を割った複数の第 2サブ剰余値により表現 された第 2の剰余形式により更に表現され、前記複数の第 1サブ剰余値により表現さ れた前記入力値の前記第 1モジュラスによる剰余値を、前記複数の第 2サブモジュラ スのそれぞれによる剰余である複数の第 1変換サブ剰余値に変換する第 1サブ剰余 値変換部を更に備え、前記減算器は、前記入力値の前記第 1モジュラスによる剰余 値を示す前記複数の第 1変換サブ剰余値と、前記入力値の前記第 2モジュラスによ る剰余値を示す前記複数の第 2サブ剰余値との差分値であって、前記複数の第 2サ ブモジュラスのそれぞれにより当該差分値を割った複数の剰余値により表現された第 1の前記モジュラス間差分値を出力する第 2モジュラス対応減算器を有し、更に、前 記複数の第 2サブモジュラスのそれぞれによる複数の剰余値により表現された前記 第 1のモジュラス間差分値を、前記複数の第 1サブモジュラスのそれぞれによる複数 の剰余値により表現された変換モジュラス間差分値に変換する第 2サブ剰余値変換 部を備え、前記商出力部は、前記変換モジュラス間差分値に基づいて、前記複数の 第 1サブモジュラスのそれぞれによる複数の剰余値により表現された前記商の前記 第 1モジュラスによる剰余値を出力する第 1モジュラス対応商出力部と、前記第 1のモ ジュラス間差分値に基づいて、前記複数の第 2サブモジュラスのそれぞれによる複数 の剰余値により表現された前記商の前記第 2モジュラスによる剰余値を出力する第 2 モジュラス対応商出力部とを有してもよい。
[0065] 本発明の第 2の形態によれば、数値を第 1モジュラス(法)による剰余値及び第 2モ ジュラスによる剰余値の組による第 1の剰余形式で表現する剰余系を用いる剰余系 演算システムであって、演算対象となる 2つの被演算値を入力し、 2つの被演算値の 間で加算、減算、又は乗算を行う剰余系演算器と、前記剰余系演算器による演算結 果にスケーリングが必要である場合に、前記演算結果を入力値として入力し、前記入 力値を前記第 2モジュラスで割った商を前記演算結果のスケーリング結果として算出 するスケーリング演算器とを備え、前記スケーリング演算器は、前記入力値における 、前記第 1モジュラスによる剰余値及び前記第 2モジュラスによる剰余値の差分値で あるモジュラス間差分値を出力する減算器と、前記モジュラス間差分値に基づいて、 前記商の第 1モジュラスによる剰余値及び前記商の前記第 2モジュラスによる剰余値 の組を前記商として出力する商出力部とを有する剰余系演算システムを提供する。
[0066] 本発明の第 3の形態によれば、数値を第 1モジュラス(法)による剰余値及び第 2モ ジュラスによる剰余値の組による第 1の剰余形式で表現する剰余系において、前記 第 1の剰余形式の入力値を前記第 2モジュラスで割った前記第 1の剰余形式の商を 算出するスケーリング演算器としてコンピュータを機能させるプログラムであって、前 記コンピュータを、前記入力値における、前記第 1モジュラスによる剰余値及び前記 第 2モジュラスによる剰余値の差分値であるモジュラス間差分値を出力する減算器と 、前記モジュラス間差分値に基づいて、前記商の第 1モジュラスによる剰余値及び前 記商の前記第 2モジュラスによる剰余値の組を前記商として出力する商出力部として 機能させるプログラム、又は、当該プログラムを記録した記録媒体を提供する。
[0067] 本発明の第 4の形態によれば、数値を第 1モジュラス(法)による剰余値及び第 2モ ジュラスによる剰余値の組による第 1の剰余形式で表現する剰余系において、前記 第 1の剰余形式の入力値を前記第 2モジュラスで割った前記第 1の剰余形式の商を 演算器により算出するスケーリング演算方法であって、前記入力値における、前記第 1モジュラスによる剰余値及び前記第 2モジュラスによる剰余値の差分値であるモジュ ラス間差分値を出力する減算段階と、前記モジュラス間差分値に基づいて、前記商 の第 1モジュラスによる剰余値及び前記商の前記第 2モジュラスによる剰余値の組を 前記商として出力する商出力段階とを備えるスケーリング演算方法を提供する。
[0068] 前記第 1モジュラスは、互いに素な複数の整数である複数の第 1サブモジュラスの 積であり、前記第 2モジュラスは、互いに素な複数の整数である複数の第 2サブモジ ュラスの積であり、前記入力値は、前記第 1モジュラスによる剰余値が、前記複数の 第 1サブモジュラスのそれぞれにより前記入力値を割った複数の第 1サブ剰余値によ り表現され、前記第 2モジュラスによる剰余値が、前記複数の第 2サブモジュラスのそ れぞれにより前記入力値を割った複数の第 2サブ剰余値により表現された第 2の剰 余形式により更に表現され、前記複数の第 1サブ剰余値により表現された、前記入力 値の前記第 1モジュラスによる剰余値を、前記複数の第 2サブモジュラスのそれぞれ による剰余である複数の第 1変換サブ剰余値に変換する第 1サブ剰余値変換段階を 更に備え、前記減算段階は、前記入力値の前記第 1モジュラスによる剰余値を示す 前記複数の第 1変換サブ剰余値と、前記入力値の前記第 2モジュラスによる剰余値 を示す前記複数の第 2サブ剰余値との差分値であって、前記複数の第 2サブモジュ ラスのそれぞれにより当該差分値を割った複数の剰余値により表現された第 1の前記 モジュラス間差分値を出力する第 2モジュラス対応減算段階を有し、前記商出力段 階は、前記第 1のモジュラス間差分値に基づいて、前記複数の第 2サブモジュラスの それぞれによる複数の剰余値により表現された前記商の前記第 2モジュラスによる剰 余値を出力する第 2モジュラス対応商出力段階を有してもよい。
[0069] なお、上記の発明の概要は、本発明の必要な特徴の全てを列挙したものではなく、 これらの特徴群のサブコンビネーションもまた、発明となりうる。
発明の効果
[0070] 本発明によれば、剰余系による加減乗算の高速化と、スケーリング演算の高速化と を両立して実現する剰余系演算システムを提供することができる。
図面の簡単な説明
[0071] [図 1]本発明の実施形態に係るスケーリング処理の概略を示す。
[図 2]本発明の実施形態に係る剰余系演算システム 5の構成を示す。
[図 3]本発明の実施形態に係る剰余系演算システム 5の動作フローを示す。
[図 4]本発明の実施形態の第 1変形例に係るスケーリング演算器 100の構成を示す。 [図 5]本発明の実施形態の第 1変形例に係る第 1サブ剰余値変換部 300及び第 2モ ジュラス対応減算器 340の構成を示す。
[図 6]本発明の実施形態の第 1変形例に係る条件判断部 350及び差分値調整部 36 0の構成を示す。
[図 7]本発明の実施形態の第 1変形例に係るスケーリング演算器 100の動作フローを 示す。
[図 8]本発明の実施形態の第 2変形例に係るスケーリング演算器 100の構成を示す。
[図 9]本発明の実施形態の第 2変形例に係るスケ一リング演算器 100の動作フローを 示す。
[図 10]本発明の実施形態に係るコンピュータ 900のハードウェア構成の一例を示す。 符号の説明
3 スケーリング演算器
5 剰余系演算システム
10 剰余系演算器
20 剰余演算 ALU
100 スケーリング演算器
110 オーバーフロ一検出器
120 剰余形式変換器
130 減算器
140 商出力部
150 剰余形式逆変換器
300 第 1サブ剰余値変換部
302 剰余値変換器
304 変換結果出力部
310 第 2サブ剰余値変換部
312 剰余値変換器
314 変換結果出力部
320 減算器 330 第 1モジュラス対応減算器
340 第 2モジュラス対応減算器
350 条件判断部
360 差分値調整部
370 商出力部
372 第 1モジュラス対応商出力部
374 第 2モジュラス対応商出力部
400a— c 被変換値減算器
410b— d 変換係数算出部
420b— d 変換係数加算器
430 剰余演算器
440 剰余減算器
500 比較器
510 セレクタ
520 剰余加算器
900 コンピュータ
1000 CPU
1010 ROM
1020 RAM
1030 通信インターフェイス
1040 ハードディスク'ドライブ
1050 フレキシブルディスク'ドライブ
1060 CD - ROMドライブ
1070 フレキシブルディスク
1080 CD-ROM
発明を実施するための最良の形態
以下、発明の実施の形態を通じて本発明を説明するが、以下の実施形態は請求の 範囲にかかる発明を限定するものではなぐまた実施形態の中で説明されている特 徴の組み合わせの全てが発明の解決手段に必須であるとは限らない。
[0074] 本実施形態に係る剰余系演算システムは、以下に示すスケーリング剰余系 (Scaling RNS)と算術剰余系 (Arithmetic RNS)の 2種類の剰余表現を用い、加減乗算は算術 剰余系で、スケーリングはスケーリング剰余系で計算させることにより、加減乗算とス ケーリング演算を高速に実現する。
[0075] ( 1 )スケーリング剰余系 (Scaling RNS)
スケーリング剰余系は、被スケーリング数 Yを高速にスケーリングすることを目的とす る剰余系である。ここで、スケーリング剰余系を用いたスケーリング方法を、「スケーリ ング剰余系によるスケーリング (Scaling by the Difference in Scaling RNS; SDSRNS)」と 呼ぶ。
[0076] スケーリング剰余系は、モジュラス ΐ ιη1}が与えられ、数値を第 1モジュラス ra 1によ る剰余値及び第 2モジュラス m 1による剰余値の組による第 1の剰余形式で表現する 剰余系である。本実施形態において、 IT 及び i は互いに素であり、 m1及び の差 が 1、より具体的には m 1 =m 1である場合を中心に説明する。
[0077] 11^ =01し 1の場合、後述の補足説明 1に示した通り、 Y=p ' m T +y Tかつ Υ=ρ · π + と すると、 Υを により割った商 q、すなわち Yを m 1によりスケーリングしたスケーリング結 ■ 果 q=(q mod m ',q mod π )は、以下の式(2— 1 )により求められる。
[0078] ほ女18]
Figure imgf000019_0001
[0079] 図 1は、 SDSRNS法によるスケーリング処理の概略を示す。本図に示したスケーリン グ演算器 3は、 SDSRNS法を用いて式(2 - 1 )に基づきスケーリング処理を行う。これに より、スケーリング演算器 3は、入力値 Yの剰余桁間の減算結果を用いて高速にスケ 一リングを行うことができる。
[0080] (2)算術剰余系 (Arhkhmetic RNS)
SDSRNS法を用レ、ることにより、上記の式(2— 1)に示した様に、従来の剰余系にお けるスケーリングで必要となる中国人の剰余定理を用いた乗算等の、演算ビット数の 2乗に比例する演算量を要する処理が不要になる。このため、スケーリング処理を高 速ィ匕すること力でさる。
しかし、 SDSRNS法においては、被スケーリング数を 2つのモジュラスにより表現する ため、各モジュラスが大きい値となり、加減乗算のときにキャリー伝播遅延が大きくな るという問題点がある。例えば、表現する数値の最大値 Mを 224とすると、 mf及び m1は 212近傍の値となり、
Figure imgf000020_0001
ットにすることが考えられる。こ の結果、各剰余桁の計算のビット数が 12(=log M)となる。このように、 SDSRNS法によ
2
れば、キャリー伝播遅延が log Mに比例して大きくなる。本来の剰余系のメリットは、 4
2
一 5ビット程度のモジュラスを組み合わせて剰余桁毎に独立して計算することにより、 キヤリ一伝播遅延を低減できることにある。このため、 Mが大きくなるにつれてキャリー 伝播遅延も大きくなるスケーリング剰余系によれば、剰余系のメリットを十分に活かせ ない。
[0081] そこで、スケーリングの際に用いるスケーリング剰余系に加えて、スケーリング以外 の演算に用いる算術剰余系を導入し、数値演算処理の高速化とスケ一リングの高速 化を両立させる。以下に、算術剰余系を定義する。
[0082] 算術剰余系は、スケーリング剰余系の第 1モジュラス n /を素因数分解して得られる 複数のモジュラス { , mr , mT , ···, mT }と、第 2モジュラス m1を素因数分解して
0 1 2
得られる複数のモジュラス{ ml , l , ml , ·■·, m1 }とをモジュラスセットとする。す
0 1 2 k-1
なわち、算術剰余系は、 {{mT , m , m ,■··, mT },{ m1 , m1 , m1 ,
0 1 2 i-1 0 1 2 …, m1 }}をモ k-1 ジュラスセットとする剰余系である。
[0083] ここで、第 1モジュラス に対応する複数のモジュラス {mT , mT , mT , ···, m }を o l 2 M
、第 1モジュラス に対応するモジュラスサブセット又は複数の第 1サブモジュラス {m T , mT , mT ,■■·, mr }と呼び、第 2モジュラス に対応する複数のモジュラス { ml
0 1 2 j-1 0
, m1 , m1 ,■·., m1 }の組を、第 2モジュラス m1に対応するモジュラスサブセット又は
1 k-1
第 2サブモジュラス {π^, π , m 一, m1 }と呼ぶ c
0 1 Ί k-1
[0084] このとき、以下の式(2— 2)に示すように、第 1モジュラス mTは、互いに素な複数の整 数である複数の第 1サブモジュラス {mT , mT , mT , ■·■, m' }の積となり、第 2モジュ
0 1 2 J-1
ラス m1は、互いに素な複数の整数である複数の第 2サブモジュラス {m1 , ml , ml , ■■·, m1 }の積となる。
[0085] [数 19] m
τ τ τ
w 0,w ,,w 2,... w j. は互いに素 (2-2) i i i
m 0,m ' 1 W 2 は互いに素
[0086] ここで表現を簡略化するため、以下の式(2— 3)に示すように、スケーリング剰余系 で表現された数値を | X i 、算術剰余系で表現された数値を | Χ | と
ScalmgRNS Arithmetic NS 表現する。
[0087] [数 20]
I † 丄、
(2-3) y\ / † † † \ ^ ψ ^ 丄
Λ AnllwM^S^^ 0 2 0 k-[)>-
[0088] 式(2— 3)により、算術剰余系は、 Xの第 1モジュラス1^による剰余値 χτ力 複数の 第 1サブモジュラス {m れぞれにより Xを割った複数のサブ 剰余値 (xf χΤ , ···, 2モジュラス による剰余値 力;、
0 1
Figure imgf000021_0001
複数の第 2サブモジュラス {ml , ml , m1 , ■··, m1 }のそれぞれにより Xを割った複
U 1 ]-[
数のサブ剰余値 (X1 , χ1 , ■··, X1 )により表現された第 2の剰余形式を採るとみなす
0 1 】-1
ことができる。
[0089] 本実施形態に係る剰余系演算システム 5は、算術剰余系で表現された数 I A I
及び I B I を入力として剰余系演算器 10により加減乗算を行う。剰
- ithmetic NS ArithmeticRNS
余系演算器 10による計算の結果スケーリングが必要となった場合に、計算結果 I Y'
I を算術剰余形式からスケーリング剰余形式に変換し、 を得る
ArithmeticRNS I Y I Scaling NS
。次に、スケーリング剰余系で前述した SDSRNS法によるスケーリングを行い、 1 Y/m1
I を得る。そして、これをスケ一リング剰余形式力 算術剰余形式に変換し、
SealiriKRNS
I Y/ml I を得る。これにより剰余系演算システム 5は、加減乗算の高速化と
ArithmeticRNS
、スケーリングの高速化を両立させることができる。すなわち、加減乗算は各剰余桁 表現が例えば 4ビット等の、スケーリング剰余系と比較しビット幅の小さい算術剰余系 でおこなうため、キャリー伝播遅延を小さく抑えることができる。そして、スケーリングは SDSRNS法により減算のみで実現できるため、従来の中国人の剰余定理を利用する スケーリング方法より高速に計算できる。
[0090] 図 2は、本実施形態に係る剰余系演算システム 5の構成を示す。剰余系演算システ ム 5は、剰余系の数値 A及び Bを入力して各種の演算を行う剰余系演算器 10と、剰 余系演算器 10による演算の結果スケーリング処理が必要となった場合に、スケーリン グ演算を行うスケ一リング演算器 100とを備える。ここでスケーリング演算器 100は、 剰余系演算器 10による演算結果を入力し、入力値の剰余桁間で減算した結果に基 づいて、入力値をモジュラスの 1つで割った商をスケーリング結果として算出する。こ れによりスケーリング演算器 100は、中国人の剰余定理を利用して一旦 2進数又は 1 0進数に変換した後にスケーリングを行う場合と比較して高速にスケーリングを行うこ と力 Sできる。
[0091] 剰余系演算システム 5は、剰余系演算器 10と、スケーリング演算器 100とを備える。
剰余系演算器 10は、本発明に係る第 2の剰余形式の一例である算術剰余形式に より表現されたオペランド A及び Bを入力し、 A及び Bの間で加算、減算、又は乗算を 行う。本実施形態において、オペランド. Aは、複数の第 1サブモジュラス {m ' ,m T ,m T
,m T }のそれぞれによりオペランド Aを割った複数の剰余値 ( )と、複数の 第 2サブモジュラス {m 1 ,m l .m 1 )のそれぞれによりオペランド Aを割った複数の剰余 値(a ,aJ )との組により表現される 3同様にオペランド Bは、複数の剰余値 (b T ,b
T ,b f ,b r )と、複数の剰余値(b 1 ,b l ,b l )との組により表現される。剰余系演算器 10 は、オペランド A及びオペランド Bの対応する剰余桁の剰余値の間で加算、減算、又 は乗算を行う複数の剰余演算 ALU20を有する。
[0092] スケーリング演算器 100は、剰余系演算器 10による演算結果 Y=(y 1 ,y ,γ 1 ,y l ,y l )を入力値として入力し、入力値 Yを! で割った商を演算結果 Yのスケーリ 】
ング結果 Ζ-(ζ ' , ζ Τ )として算出する。スケーリング演算器 100は、 オーバーフロー検出器 110と、剰余形式変換器 120と、減算器 130と、商出力部 14 0と、剰余形式逆変換器] 50とを有する。 [0093] オーバーフロー検出器 1 10は、スケーリング演算器 100に入力される入力値 Yのォ 一バーフローを検出する。剰余形式変換器 1 2〇は、算術剰余系により表現された入 力値 Yを、スケーリング剰余系により表現された入力値 に変換する。減算器 130は、スケーリング剰余系により表現された入力値 Yに対して、後述の式(3—5)に 示した剰余桁間の減算を行い、剰余桁間の差分値であるモジュラス間差分値を出力 する。商出力部 140は、式(2—1 )に示した様に、モジュラス間差分値に基づいて、ス ケーリング剰余系により表現されたスケーリング結果 2=( , )、すなわち入力値 Yを m で割った商 Zを出力する。剰余形式逆変換器 150は、スケーリング剰余系により表 現されたスケーリング結果 Zを、算術剰余系により表現されたスケーリング結果 Z=
Τ,ζ Τ11 , ζ 11 )に変換し、スケーリング結果として出力する。
[0094] 図 3は、本実施形態に係る剰余系演算システム 5の動作フローを示す。
まず、剰余系演算器 10は、演算対象となる 2つの被演算値であるオペランド Α及び Bを入力して、 A及び Bの間で加算、減算、又は乗算を行う(ステップ S 200)。次に剰 余系演算器 10は、演算結果 Yをスケーリングすべきか否かを判断する(S210)。スケ 一リングが不要である場合、剰余系演算器 10は、第 2の剰余形式による演算結果 Y を演算結果として出力する。
[0095] 一方、スケーリングが必要である場合、剰余系演算器 10は、第 2の剰余形式の演 算結果 Yをスケーリング演算器 100に入力する。オーバーフロー検出器 1 10は、スケ 一リング演算器 100に入力された入力値 Yのオーバーフローを検出する(S 220)。す なわち、後述の補足説明 "1の(1 )に記載したように、被スケ一リング数である入力値 Y の上限が制限されている場合、オーバ一フロ一検出器 1 10はオーバーフローを検出 する。
また、 m T≠mし 1により剰余系演算システム 5を実現した場合、ォ一バーフロー検出 器 1 10は、第 1モジュラス 及び第 2モジュラスの積 m 1を第 1モジュラス m 1及び第 2 モジュラス m 1の差の絶対値により割った値が入力値 Y以上である場合に、入力値 Yの オーバーフローを検出する。これにより、後述の補足説明 1の(2)又は(3)に記載し た式 (3— 1 3)及び式 (3— 16)が成立する範囲に入力値 Yを制限することができる。
[0096] 次に、剰余形式変換器 120は、算術剰余系により表現された入力値 Yを、スケ一リ ング剰余系により表現された入力値 Yに変換する。すなわち剰余形式変換器 120は 、入力値 Υの第 1モジュラス による剰余値 yT力 複数の第 1サブモジュラス { ,mT
,mT ,mr }のそれぞれにより入力値 Yを割った複数の第 1サブ剰余値 ( ,yT ) により表現され、入力値 Yの第 2モジュラス m による剰余値 y1力 \複数の第 2サブモ ジュラス {π ,ιη1 ,ml }のそれぞれにより入力値を割った複数の第 2サブ剰余値 (y丄,y
1 )により表現された算術剰余形式の入力値 Yを、スケーリング剰余形式の入力値
Yに変換する。
[0097] 次に、減算器 130は、入力値 Yにおける、第 1モジュラス mTによる剰余値 yT及び第 2モジュラス m1による剰余値/の差分値であるモジュラス間差分値を出力する。より 具体的には、減算器 130は、後述の補足説明 1の式(3 - 5)、 (3-6), (3 - 11)、又は (3— 12)等に示した (y1- yT) mod mT又は (yT - y ) mod i を、モジュラス間差分値と して算出し出力する剰余減算器である。ここで、減算器 130は、剰余形式の入力値 における、第 1モジュラス m1及び第 2モジュラス m1のうちより小さいモジュラス(例えば m 1 )による剰余値 (例えは )力 より大きレ、モジュラス (例えば m T )による剰余値 (例 えば )を減じたモジュラス間差分値 (y ) mod mTを出力してよい。
[0098] 次に、商出力部 140は、モジュラス間差分値に基づいて、商 qの第 1モジュラス による剰余値及び商 qの第 2モジュラス m 1による剰余値の組を商 qとして出力する。よ り具体的には、商出力部 140は、後述の補足説明 1の式(3 - 10)、 (3— 13)、又は 一 16)に示した商 qを出力する。
すなわち、第 1モジュラス 及び第 2モジュラス m1の差カ^である場合、商出力部 1 40は、式(3— 10)に示した様に、商 qの第 1モジュラス1^による剰余値及び商 qの第 2 モジュラス による剰余値として、モジュラス間差分値の第 1モジュラス《^による剰余 値を出力する。また、式(3— 10)を用いる場合において、商出力部 140は、 q mod m' = の場合に q mod mT=0に変換する等により剰余桁の補正を行レ、、スケーリング剰 余形式の商 qを出力してよい。
[0099] また、第 1モジュラス m1及び第 2モジュラス の差力; 1でない場合、商出力部 140 は、式(3— 13)又は(3— 16)に示した様に、モジュラス間差分値 (yに yT) mod mT又 は (yLy mod m Tを第 1モジュラス 及び第 2モジュラス m 1の差の絶対値 | m7-tn L Iにより割った値の第 1モジュラス による剰余値を、商 qの第 1モジュラス による 剰余値及び商 qの第 2モジュラス i による剰余値として算出する。
[0100] 次に、剰余形式逆変換器 150は、商出力部 140が出力したスケーリング剰余形式 の商 qを、算術剰余形式の商 qに変換し、算術剰余形式のスケーリング結果 Z=(Z TΤ
,ζ' ,ζ ,ζ ,ζ11 )として出力する c
[0101] 以上に示した剰余系演算システム 5によれば、算術剰余系を用レ、て加減乗算を行 う一方、スケーリング剰余系を用いてスケーリング演算を行うため、剰余系による加減 乗算の高速化と、スケーリング演算の高速化とを両立して実現することができる。
[0102] 図 4は、本実施形態の第 1変形例に係るスケーリング演算器 100の構成を示す。本 変形例 (こ係るスケーリング演算器 100は、スケ一リング剰余系と算術剰余系の間で剰 余系の変換を行うのに代えて、第 1モジュラス mTに対応する複数の第 1サブモジュラ ス {m1 ,mT ,m ,m }により表された複数の剰余桁を、第 2モジュラス m 1に対応する複 数の第 2サブモジュラス {ml ,πι1 ,ral こより表された複数の剰余桁に変換し、変換さ れた第 1モジュラス mTによる剰余値及び第 2モジュラス m1による剰余値の差分値をモ ジュラス間差分値として算出する。これにより、剰余形式変換器 120及び剰余形式逆 変換器 150による変換処理のォ一バーヘッドを低減することができる。
なお、算術剰余系におけるモジュラスセット {{mT ,m ,mT ,mr Urn ,ml ,ml }}のモ ジュラスサブセッ HmT ,mT ,mT ,mT }及び {m ,ml ,ml }の間で剰余数を変換すること を、「モジュラスサブセットの桁揃え (Base Extention for Moduli Subset; BEMS)」と呼 ぶ。
[0103] 本変形例に係るスケーリング演算器 100は、入力値 Yの第 1モジュラス による剰 余値 力 複数の第 1サブモジュラス {mT ,mT ,mT ,mT }のそれぞれにより入力値 Yを 割った複数の第 1サブ剰余値 (yf ,y ,y ,y' )により表現され、入力値 Yの第 2モジュ ラス m こよる剰余値が、複数の第 2サブモジュラス {ml ,m m1 }のそれぞれにより入 力値 Yを割った複数の第 2サブ剰余値 ( ,γ11 )により表現された算術剰余形式の 入力値 Υを入力し、この入力値 Υに対してスケーリングを行う。スケーリング演算器 10 0は、第 1サブ剰余値変換部 300と、第 2サブ剰余値変換部 310と、減算器 320と、 条件判断部 350と、商出力部 370とを有する。 第 1サブ剰余値変換部 300は、複数の第 1サブ剰余値 (yT ,yT ,γ' ,yi )により表現 された、入力値 Yの第 1モジュラス による剰余値 を、複数の第 2サブモジュラス {m 1 ,ml ,ml }のそれぞれによる剰余である複数の第 1変換サブ剰余値 (φ 1ί1
)に変換する。第 1サブ剰余値変換部 300は、複数の第 1サブ剰余値 (yT ,yT ,yT ,yT
)により表現された第 1モジュラス による剰余値 yTを 2進数の y1に変換する剰余値 変換器 302と、 2進数の を複数の第 1変換サブ剰余値 ( 1 , 11 )に変換す る変換結果出力部 304を含む。ここで、複数の第 1変換サブ剰余値 11 ,φ ) は、 (yl , ,yx )との差分値を求めることによりスケーリングを実現することができるた め、スケーリング係数 Ψ と表現してよい。
[0104] 第 2サブ剰余値変換部 310は、複数の第 2サブ剰余値 (y1 ,yJ ,y[ )により表現され た、入力値 Yの第 2モジュラス m1による剰余値を、複数の第 1サブモジュラス {mT ,m
,m' ,mr }のそれぞれによる剰余である複数の第 2変換サブ剰余値 Τ , Τ Τ ,
Φ Τ )に変換する。第 1サブ剰余値変換部 300は、複数の第 2サブ剰余値 (y1 ,yJ ,yl
)により表現された第 2モジュラス m 1による剰余値 y 1を 2進数の y 1に変換する剰余値 変換器 312と、 2進数の を複数の第 2変換サブ剰余値 ( ] , ,φ 1 )に変
Figure imgf000026_0001
換する変換結果出力部 314を含む。ここで、複数の第 2変換サブ剰余値 τ , ,
Φ τ , Φ τ )を、スケーリング係数 Ψ fと表現してもよい。
[0105] 減算器 320は、入力値 Yにおける、第 1モジュラス1^ による剰余値 及び第 2モジ ュラス m 1による剰余値 の差分値であるモジュラス間差分値を出力する。減算器 32 0は、第 1モジュラス対応減算器 330及び第 2モジュラス対応減算器 340を含む。 第 1モジュラス対応減算器 330は、入力値 Yの第 2モジュラス m 1による剰余値 y 1を 示す複数の第 2変換サブ剰余値 (φ 1 ,φ ,φ, )と、入力値 Υの第 1モジュラス mTによる剰余値 y1を示す複数の第 1サブ剰余値 (yT ,yJ ,yT ,yT )との差分値であつ :
て、複数の第 1サブモジュラス imT ,mT,mT ,mT }のそれぞれにより当該差分値を割つ た複数の剰余値により表現された第 2のモジュラス間差分値 (2UPT ,zUPr ,ζυΡ1
,zUPT )を出力する。
[0106] 第 2モジュラス対応減算器 340は、入力値 Yの第 1モジュラス m'による剰余値 yTを 示す複数の第 1変換サブ剰余値 1 )と、入力値 Yの第2モジュラス m1に よる剰余値 y1を示す複数の第 2サブ剰余値 (y1 , .y1 )との差分値であって、複数
0 1 2
の第 2サブモジュラス {i ,tV ,ΓΠ1 }のそれぞれにより当該差分値を割った複数の剰
0 1 2
余値により表現された第 1のモジュラス間差分値を出力する。後述の補足説明 1に示 したように、第 1のモジュラス間差分値は、 mT=mに 1の場合スケーリング結果 (ζ1
0 1
1 )と同一となる。
[0107] 条件判断部 350は、第 1サブ剰余値変換部 300内の剰余値変換器 302が 2進数の 形式で出力する、入力値 Υの第 1モジュラス による剰余値 bin yと、第 1サブ剰余 値変換部 300内の第 2サブ剰余値変換部 310が 2進数の形式で出力する、入力値 Y の第 2モジュラス による剰余値 bin y1とが、予め定められた大小関係を満たすか否 力を判断する。
[0108] ここで第 1モジュラスが第 2モジュラスより 1大きい場合 (mT=mし 1の場合)、条件判 断部 350は、後述の補足説明 2に示した様に、入力値 Yの第 1モジュラス mTによる剰 余値 bin y1が入力値の第 2モジュラス による剰余値 bin より大きい場合に、入力 値 Yの第 1モジュラス m1による剰余値 yTと、入力値の第 2モジュラス m1による剰余値 y とが、予め定められた大小関係を満たすと判断する。
[0109] 商出力部 370は、第 1のモジュラス間差分値及び第 2のモジュラス間差分値に基づ いて、スケーリング結果 Zとなる商 qの第 1モジュラス による剰余値 zT zf ,ζ' ,ζ
0 1 2
Τ )、及び、商 qの第 2モジュラス による剰余値
0 1 2)の組を商 qとして出
3
力する。商出力部 370は、差分値調整部 360と、第 1モジュラス対応商出力部 372と 、第 2モジュラス対応商出力部 374とを含む。
[0110] 差分値調整部 360は、入力値 Yの第 1モジュラス による剰余値 yTと、入力値 Yの 第 2モジュラス による剰余値 ylとが、条件判断部 350により予め定められた大小関 係を満たすと判断された場合に、第 1のモジュラス間差分値及び第 2のモジュラス間 差分値の一方に予め定められた定数を加えて調整した第 1のモジュラス間差分値及 び第 2のモジュラス間差分値を、第 1モジュラス対応商出力部 372及び第 2モジュラス 対応商出力部 374にそれぞれ供給する。ここで m^m 1の場合、差分値調整部 36 0は、条件判断部 350により bin y1く bin y Tの大小関係を満たすと判断された場合に 、第 2のモジュラス間差分値 (zUP1 ,zUPr ,zUPT .zUP1 )に 1を加えて調整した第 2の モジュラス間差分値を第 1モジュラス対応商出力部 372に、第 1のモジュラス間差分 値を第 2モジュラス対応商出力部 374にそれぞれ供給する。
[0111] 第 1モジュラス対応商出力部 372は、差分値調整部 360から供給された第 2のモジ ユラス間差分値に基づいて、複数の第 1サブモジュラス {mT ,mT ,mT ,mT }のそれぞ
0 1 3 れによる複数の剰余値 (zTΤ )により表現されたスケーリング結果 Ζとなる商
0 1 2 3
の、第 1モジュラス による剰余値 を出力する。
Figure imgf000028_0001
第 1モジ ュラス対応商出力部 372は、差分値調整部 360により調整された第 2のモジュラス間 差分値を、複数の第 1サブモジュラス {mf ,mr ,mr ,πι1 }のそれぞれによる複数の剰
0 1 2 3
余値 {zT,zT ,zT ,zr }により表現された商 Qの第 1モジュラス による剰余値とする。
0 1 2 3
[0112] 第 2モジュラス対応商出力部 374は、第 1のモジュラス間差分値に基づいて、複数 の第 2サブモジュラス {m1, , }のそれぞれによる複数の剰余値 (z1 ,zl ,zl
0 1 2 0 1 2 )によ り表現されたスケーリング結果 Zとなる商の、第 2モジュラス m1による剰余値 を出力 する。ここで = - 1の場合、第 2モジュラス対応商出力部 374は、第 1のモジュラス 間差分値を、複数の第 2サブモジュラス {m1 ,ml ,ml }のそれぞれによる複数の剰余
0 1 2
11 ,zl }により表現された商 qの第 2モジュラス m1による剰余値とする。
0 1 2
[0113] 図 5は、本実施形態の第 1変形例に係る第 1サブ剰余値変換部 300及び第 2モジュ ラス対応減算器 340の構成を示す。なお、第 2サブ剰余値変換部 310及び第 1モジ ュラス対応減算器 330は、剰余桁の数が異なる点を除いて第 1サブ剰余値変換部 30 0及び第 2モジュラス対応減算器 340と略同様の構成をとるため、説明を省略する。
[0114] 第 1サブ剰余値変換部 300内の剰余値変換器 302は、複数の第 2サブモジュラス {m , m1 }のそれぞれによる剰余値の形式に変換すべき被変換値 Ξ(0)の初期値
0 1 2
(0), (0), ς (0), ξ (0))として、複数の第 1サブ剰余値 (yT,yT ,yT,yT )により表現
0 1 3 0 1 2 3 された、入力値 Yの第 1モジュラス による剰余値 y1を入力する。そして剰余値変換 器 302は、第 1モジュラス による剰余値 yTを 2進数に変換する。
[0115] 乗 lj余値変換器 302は、被変換値減算器 400a— cと、変換係数算出部 410b— dと、 変換係数加算器 420b— dとを含む。
被変換値減算器 400aは、被変換値 Ξ(0)における、複数の第 1サブモジュラス {mT
0
,m' ,mr,mf }のそれぞれにより被変換値 Ξ(0)を割った複数の被変換剰余値 (0), (0), ξ (0), e (0》のうち、第 1サブモジュラス に対応する被変換剰余値 (0)を
0に変換するべく ξ (0)を被変換値 Ξ (0)から減じて被変換値 とする。この結果、 被変換値 Ξ (1)の第 1サブモジュラス m Tに対応する剰余値が 0となり、 Ξ (1)= (0,
(o)- e (o), (o) - (o), ξ (ο)- ξ (ο))= (ο, ξ (ι), ξ ω, ξ ω)となる。そして被変換
0 2 2
値 Ξ (0)から減じた ξ (0)は、被変換剰余値 (0)を 0に変換するために用いた変換係 数 α として変換係数加算器 420bに入力される。
[0116] 変換係数算出部 410bは、被変換値 Ξ (1)から減じた場合に、被変換剰余値 (1) を 0とし、かつ、既に 0に変換された、第 1サブモジュラス m f に対応する被変換剰余 値を 0に保つ変換係数 α を算出する。なお、変換係数 α が満たすべき条件につい ては後述する。
[0117] 変換係数加算器 420bは、変換係数算出部 410bにより算出される、 2進数により表 現された変換係数ひ を、変換係数ひ に加算する。ここで、 yTは第 1モジュラス r より 小さいため、変換係数の加算値は第 1モジュラス による剰余値であると見なせる。
[0118] 被変換値減算器 400bは、変換係数算出部 410bにより算出された、第 1モジュラス m Tによる剰余値により表現された変換係数 α を、被変換値 Ξ (1)から減じて被変換
2
値 Ξ (2)とする。この結果、被変換値 Ξ (2)の 2つの第 1サブモジュラス 及び に 対応する被変換剰余値がそれぞれ 0となり、 Ξ (2)= (0, o, e ω-さ (1), ξ y e ω)=
(0,0, ξ (2), (2))となる。
[0119] 変換係数算出部 410cは、被変換値 Ξ (2)から減じた場合に、被変換剰余値 ξ (2) を〇とし、かつ、既に 0に変換された、 2つの第 1サブモジュラス 及び m T に対応す る被変換剰余値を 0に保つ変換係数 α を算出する。
[0120] 変換係数加算器 420cは、変換係数算出部 410cにより算出される、 2進数により表 現された変換係数 ct を、変換係数 α 及び α の加算値に加算する。
[0121] 被変換値減算器 400cは、変換係数算出部 410cにより算出された、第 1モジュラス m 1による剰余値により表現された変換係数 a を、被変換値 Ξ (2)から減じて被変換 値 Ξ (3)とする。この結果、被変換値 Ξ (3)の 3つの第 1サブモジュラス m T力 m T に対 応する被変換剰余値がそれぞれ 0となり、 ≡(3)= (0, 0,0,? (2) - ξ (2))= (0,0,0, ξ (3)) となる。 [0122] 変換係数算出部 410dは、被変換値 Ξ (3)から減じた場合に、被変換剰余値 ξ (3)
3 を 0とし、かつ、既に 0に変換された、 3つの第 1サブモジュラス!!!1力、ら m1 に対応す る被変換剰余値を 0に保つ変換係数ひ を算出する。
[0123] 変換係数加算器 420dは、変換係数算出部 410dにより算出される、 2進数により表 現された変換係数ひ を、変換係数 α力ら^ の加算値に加算する。そして変換係数 加算器 420dは、全ての変換係数の加算値を、 2進数の剰余値/として出力する。
[0124] 以上において、変換係数算出部 410b— dは、変換係数 α として、既に 0に変換さ れた 1又は複数の第 1サブモジュラスの倍数であり、かつ、次に 0に変換する被変換 剰余値を 0とする、以下の式 (2 - 4)を満たす最小の自然数を算出する。ただし、 s及 は自然数である。
[0125] [数 21]
Figure imgf000030_0001
[0126] 以上に示した様に、初期値を y1とする被変換値から変換係数を順次剰余減算する 一方、被変換値力 減じた変換係数を順次 2進数で加算していくことにより、被変換 値が◦となった時点で yTに対応する 2進数の yTを得ることができる。
[0127] 変換結果出力部 304は、複数の被変換剰余値の全てについて算出された全ての 変換係数 α 力も α が変換係数加算器 420b— dにより加算された加算値である 2進 数の剰余値 yTを、複数の第 2サブモジュラス {m1 ,ml ,τη1 }のそれぞれにより割った 複数の剰余値を、複数の第 1変換サブ剰余値 ίπ^ ,ml ,ml }として出力する。変換結
0 1 2
果出力部 304は、 2進数の剰余値 yTの、複数の第 2サブモジュラス {m ,ml ,ml }の それぞれによる剰余である複数の第 1変換サブ剰余値 (<> 1 , Ι , [ )を算出する複 数の剰余演算器 430を含む。
[0128] 第 2モジュラス対応減算器 340は、複数の第 2サブモジュラス {m11 ,ml }のそれ ぞれに対応する剰余桁間の滅算を行う複数の剰余減算器 440を含み、第 1変換サブ 剰余値 ( 1 , Φ 1 , Φ 1 )と、複数の第 2サブ剰余値 (y1 ,yl ,yl )との差分値である第 1 のモジュラス間差分値 (z1 )を出力する。 [0129] 図 6は、本実施形態の第 1変形例に係る条件判断部 350及び差分値調整部 36〇の 構成を示す。
条件判断部 350は、入力値 Yの第 1モジュラス mTによる剰余値 bin yTと、入力値 Yの 第 2モジュラス による剰余値 bin とが、予め定められた大小関係を満たすか否か を判断する。第 1モジュラスが第 2モジュラスより 1大きい場合 (mT=mに 1の場合)、条 件判断部 35〇は、入力値 Yの第 1モジュラス による乗 U余値 bin yTが入力値の第 2モ ジュラス m1による剰余値 bin より大きい場合に、論理値 1を出力する比較器 500を 含む。
[0130] 差分値調整部 360は、比較器 500が論理値 0を出力した場合に出力値 0が選択さ れ、比較器 500が論理値 1を出力した場合に出力値 1が選択されるセレクタ 510と、 セレクタ 510の出力値を第 2のモジュラス間差分値 (zUP1 ,ζυΡ1 ,zUPT ,zUPT )にカロ える複数の剰余加算器 520とを含む。
[0131] 以上に示した条件判断部 350及び差分値調整部 360により、スケーリング演算器 1 00は、式 (4一 8)及び式 (4一 9)に示した方法を用いて第 2のモジュラス間差分値 (zUP r ,zUPr ,zUPr ,zUPf )を調整し、スケーリング結果 Zの第 1モジュラス による剰余 値 zr=(zr )を出力することができる。
[0132] 図 7は、本実施形態の第 1変形例に係るスケーリング演算器 100の動作フローを示 す。
算術剰余形式の被スケーリング数である入力値 Yが入力されると、第 1サブ剰余値 変換部 300内の剰余値変換器 302は、複数の第 1サブ剰余値 (yT ,yT ,yr ,yT )によ り表現された、入力値 Yの第 1モジュラス による剰余値 yTを、 2進数の yTに変換す る(S600)。また、第 2サブ剰余値変換部 310内の剰余値変換器 312は、複数の第 2 サブ剰余値 (y1 ,yl ,yl )により表現された第 2モジュラス による剰余値を、 2進数の y1に変換する。
[0133] より具体的には、剰余値変換器 302内の変換係数算出部 410b dは、複数の第 1 サブ剰余値 (y1 ,yT ,yT ,yT )により表現された入力値 Yの第 1モジュラス1^による剰 余値 y1を初期値 S(0)とする被変換値 Ξ(η)における、複数の第 1サブモジュラス {mT
,mT ,mT ,mT }のそれぞれにより被変換値 Ξ(η)を割った複数の被変換剰余値(ξ , ξ )のそれぞれについて、被変換値 Ξ(η)から減じた場合に、順次当該被変換剰 余値 を 0とし、かつ、既に◦に変換された他の全ての被変換剰余値 力、ら ξ を 0 に保つ変換係数 α を算出する。
[0134] ここで剰余値変換器 302は、 1番目の被変換剰余値 につレ、ては、変換係数ひ を ξ とする。そして、被変換値減算器 400aは、被変換値 Ξ(0)の各剰余桁力も変換 係数 a を減じて被変換値を Ξ(1)に更新する。
[0135] 次に、剰余値変換器 302内の変換係数加算器 420b— dは、変換係数算出部 410 b— dにより順次算出される、第 1モジュラス による剰余値により表現された変換係 数 α を、順次加算してレ、く。そして、被変換値減算器 400b— dは、変換係数算出 部 410b— cにより順次算出される、第 1モジュラス による剰余値により表現された 変換係数 α を、被変換値 S (η)から順次減じる。
[0136] 次に、変換結果出力部 304は、 2進数の y1を複数の第 1変換サブ剰余値 ( φ 11
1 )に変換し、変換結果出力部 314は、 2進数の を複数の第 2変換サブ剰余値
( 11 , 1 }φ 1 )に変換する(S61〇)。次に、減算器 320は、入力値 Yにおける
、第 1モジュラス n /による剰余値 yf及び第 2モジュラス による剰余値 y1の差分値 である第 1のモジュラス間差分値 (z ,ζ11 )と、第 2のモジュラス間差分値 (zUP
,zUPf ,zUPT ,zUPT )とを出力する(S620)。
[0137] 次に、入力値 Yの第 1モジュラス による剰余値 bin yTが入力値の第 2モジュラス m による剰余値 bin y より大きい場合に、条件判断部 350は、/及び y1が予め定めら れた大小関係を満たすと判断する (S630)。
[0138] yT及び が予め定められた大小関係を満たす場合 (S630: Yes)、差分値調整部 360は、第 2のモジュラス間差分値 (zUPT ,zUPT ,zUPT ,zUP )を調整する(S640)
。一方、 yt及び》 が予め定められた大小関係を満たさない場合 (S630: No)、差分 値調整部 360は、第 2のモジュラス間差分値 (ζυΡ1 ,zUPT ,zUPT ,zUPT )を調整せ ず、そのまま商出力部 370に供給する(S650)。
[0139] 次に、商出力部 370は、第 1のモジュラス間差分値及び第 2のモジュラス間差分値 に基づいて、スケーリング結果 Zとなる商 qの第 1モジュラス による剰余値 ζΤ=(ζ' ,ζ
' ,ζΤ1 )、及び、商 qの第 2モジュラス m1による剰余値 =(2 Α ,ζ' ,zl )の組を商 qと して出力する(S660) c
[0140] 以上に示した通り、第 1変形例に係るスケーリング演算器] 00によれば、算術剰余 系における複数の剰余桁の一部を、他の複数の剰余桁における表現に変換してモ ジュラス間差分値を算出する。これにより、スケーリング剰余系と算術剰余系の間で 剰余系の変換を行った場合と比較し変換処理のオーバーヘッドを低滅することがで さる。
[0141] なお、以上の変換係数算出部 410b— dは、剰余系加算器により実現するのに代え て、各被変換剰余値 を入力し、当該被変換剰余値 ξに対応する変換係数 ctを出 力するルックアップテーブルにより構成してもよい。より具体的には、変換係数算出部 410b— dは、複数の被変換剰余値のそれぞれについて、当該被変換剰余値に対応 するアドレスに、当該被変換剰余値に対応する変換係数をデータとして格納するメモ リを含み、被変換剰余値に対応する変換係数を当該メモリから出力してよい。
[0142] この場合、当該メモリは、被変換剰余値の値に対応するアドレスに、当該被変換剰 余値に対応する変換係数を、 2進数の値、及び、複数の第 2サブモジュラスによる複 数の剰余値の 2通りのデータとして格納してよい。これにより、変換係数算出部 410b 一 dから変換係数加算器 420b— dに供給する 2進数の変換係数と、被変換値減算 器 400b— cに供給する、複数の第 2サブモジュラスにより表現された変換係数とを、 メモリから直接読み出して供給することができる。
[0143] また、変換係数算出部 410b— dは、被変換値 Ξにおける、複数の被変換剰余値 ξのそれぞれについて、複数の第 1サブモジュラス m 1から m fのうちより大きい第 1
0 j-1
サブモジュラス m 1に対応する被変換剰余値 ξ 力、ら順に、変換係数ひ を算出して η η η+1 よい。これにより、変換係数算出部 410b dをルックアップテーブルにより構成した場 合等におけるハードウェア量を低減することができる。
[0144] また、以上に示した変換係数加算器 420b— dを設ける代わりに、第 2モジュラス対 応減算器 340は、変換係数算出部 410b— dにより順次算出される変換係数を、入力 値 Yの第 2モジュラスによる剰余値 (y 1 ,y L ,y l )から順次減じて第 1のモジュラス間差
0 1 2
分値を算出し出力してもよレ、。より具体的には、第 2モジュラス対応減算器 340は、変 換係数算出部 410b— dにより順次算出される、複数の第 2サブモジュラス {m ,m l , }のそれぞれによる複数の剰余値により表現された変換係数ひ を、複数の第 2サ ブ剰余値' im1 ,m' .m^ }により表現された入力値 Yの第 2モジュラス {n .m1 ,ml }によ る剰余値 (y1 ,γ' ,yl )から順次減じて、複数の第 2サブモジュラス {m ,m! ,ml )のそ れぞれによる複数の剰余値により表現された第 1のモジュラス間差分値 ( ,zl ,zl ) を出力してよい。
[0145] 図 8は、本実施形態の第 2変形例に係るスケーリング演算器 100の構成を示す。本 変形例に係るスケーリング演算器 100は、一方のスケーリング結果 Z mod m^z^Cz111 )から、他方のスケーリング結果 Ζ mod mT=zT=(zT ,ζ' ,ζΓ ,τ )を算出する。 ここで後述の式(3—8)より Z≤mTであるから、後述の式(3— 9)を適用すれば以下の 式(2— 5)が成立する。
[0146] [数 22]
Zmod ^ =Zmod l ^ ζ = zl (2-5)
[0147] 従って、図 4の第 2サブ剰余値変換部 310を使用すれば、複数の第 2サブモジュラ ス {mj ,mJ ,ιη }のそれぞれによる複数の剰余値により表現された第 1のモジュラス間 差分値であるスケ一リング結果 ,ζ1 ,zl )を、複数の第 1サブモジュラス {m1 ,ΓΠ' ,m
1 ,mT }のそれぞれによる複数の剰余値により表現された変換モジュラス間差分値で あるスケーリング結果 (zT ,zT ,zT ,zr )に変換することができる。
[0148] 本変形例に係るスケーリング演算器 100は、第 1サブ剰余値変換部 300と、第 2モ ジュラス対応減算器 340を含む減算器 320と、第 2サブ剰余値変換部 310と、商出 力部 370とを有する。本変形例に係る第 1サブ剰余値変換部 300、第 2サブ剰余値 変換部 310、第 2モジュラス対応減算器 340、及び商出力部 370は、図 4に示した第 1サブ剰余値変換部 300、第 2サブ剰余値変換部 310、第 2モジュラス対応減算器 3 40、及び商出力部 370とそれぞれ同様の機能及び構成をとるため、以下相違点を 除き説明を省略する。
[0149] 減算器 320は、入力値 Yにおける、第 1モジュラス による剰余値 yT及び第 2モジ ユラス による剰余値 y1の差分値であるモジュラス間差分値として、第 2モジュラス対 応減算器 340により出力された第 1のモジュラス問差分値を出力する。後述の補足説 明 1に示したように、第 1のモジュラス間差分値は、 m^ri^-lの場合スケーリング結果 (ζ11 ,zl )と同一となる。
[0150] 第 2サブ剰余値変換部 310は、複数の第 2サブモジュラス {m1 , }のそれぞ れによる複数の剰余値により表現された第 1のモジュラス間差分値 (ζ111 )を、 複数の第 1サブモジュラス {mT ,mT ,mT,m1 }のそれぞれによる複数の剰余値により 表現された変換モジュラス間差分値に変換する。
[0151] 商出力部 370は、差分値調整部 360を有さず、変換モジュラス間差分値に基づい て、複数の第 1サブモジュラス {mT ,mT ,m .m1 }のそれぞれによる複数の剰余値に より表現された、スケーリング結果 Zとなる商 qの第 1モジュラスによる剰余値 (z1,ζΤ
1Γ )を出力する第 1モジュラス対応商出力部 372と、第 1のモジュラス間差分値に 基づいて、複数の第 2サブモジュラスのそれぞれによる複数の剰余値により表現され た、スケーリング結果 Ζとなる商 qの第 2モジュラスによる剰余値 (ζ111 )を出力す る。
[0152] 図 9は、木実施形態の第 2変形例に係るスケーリング演算器 100の動作フローを示 す。
算術剰余形式の被スケーリング数である入力値 Υが入力されると、第 1サブ剰余値 変換部 300内の剰余値変換器 302は、複数の第 1サブ剰余値 (yf1 ,yT,yT )によ り表現された、入力値 Yの第 1モジュラス π /による剰余値 を、 2進数の yTに変換す る(S800)。次に、変換結果出力部 304は、 2進数の yTを複数の第 1変換サブ剰余 値 (Φ Φ 1 , に変換する(S810
1 )。
[0153] 次に、減算器 320は、入力値 Yにおける、第 1モジュラス mTによる剰余値 yT及び第 2モジュラス による剰余値 y1の差分値であるモジュラス間差分値として、第 2モジュ ラス対応減算器 340により出力された第 1のモジュラス間差分値を出力する(S820)
[0154] 次に、第 2サブ剰余値変換部 310は、複数の第 2サブモジュラス {m1 ;m! ,ml }のそ れぞれによる複数の剰余値により表現された第 1のモジュラス間差分値を、複数の第 ]サブモジュラス {mT,m' ,mr ,mT }のそれぞれによる複数の剰余値により表現された 変換モジュラス間差分値に変換する(S830)。 [0155] 次に、商出力部 370は、変換モジュラス間差分値に基づいて、スケーリング結果 Zと なる商 qの第 1モジュラスによる剰余値 (' ,ζ Τ ,ζ Τ )及び第 2モジュラスによる剰余 値 (ζ ,ζ 1 )の組を出力する(S850)。
[0156] 以上に示した通り、第 2変形例に係るスケーリング演算器 100によれば、算術剰余 系における複数の剰余桁の一部を、他の複数の剰余桁における表現に変換してモ ジュラス間差分値を算出する。これにより、スケーリング剰余系と算術剰余系の間で 剰余系の変換を行った場合と比較し変換処理のオーバ一 ^ ^ドを低減すること力で きる。また、減算器 320が算出した 1つのモジュラス間差分値を用いて、スケーリング 結果 Zの各剰余桁を生成することができ、ハードウェア量を低減することができる。
[0157] 図 10は、本実施形態に係るコンピュータ 900のハードウェア構成の一例を示す。本 実施形態に係るコンピュータ 900は、 CPU1000、 ROM1010、 RAM1020、通信ィ ンターフェイス 1030、ハードディスク'ドライブ 1040、フレキシブルディスク'ドライブ 1 050、及び CD— ROMドライブ 1060を備える。
[0158] CPU1000は、 ROM1010及び RAM1020に格納されたプログラムに基づいて動 作し、各部の制御を行う。 ROM 1010は、コンピュータ 900の起動時に CPU1000が 実行するブートプログラムや、コンピュータ 900のハードウェアに依存するプログラム 等を格納する。 RAM1020は、 CPU1000が実行するプログラム及ぴ CPU1000が 使用するデータ等を格納する。通信インタ一フェイス 1030は、通信ネットワークを介 して他の装置と通信する。ハードディスク'ドライブ 1040は、コンピュータ 900が使用 するプログラム及ぴデータを格納し、 RAMI 020を介して CPU1000に供給する。フ レキシブルディスク 'ドライブ 1050は、フレキシブルディスク 1070からプログラム又は データを読み取り、 RAM1020に提供する。 CD— ROMドライブ 1060は、 CD-RO M1080からプログラム又はデータを読み取り、 RAM 1020に提供する。
[0159] RAM1020を介して CPU1000に提供されるプログラムは、フレキシブルディスク 1 070、 CD— ROM1080、又は ICカード等の記録媒体に格納されて利用者によって 提供される。プログラムは、記録媒体から読み出され、 RAM1020を介してコンビュ ータ 900にインスト一ノレされ、コンピュータ 900において実行される。
[0160] コンピュータ 900にインストールされて実行され、コンピュータ 900を剰余系演算シ ステム 5として機能させるプログラムは、剰余系演算モジュールと、オーバーフロー検 出モジュール、剰余形式変換モジュール、減算モジュール、商出力モジュール、及 び剰余形式逆変換モジュールを含むスケーリング演算モジュールとを備える。これら のプログラム又はモジュールは、コンピュータ 900内の CPU1000及び 又は RAM 1020等を、剰余系演算器 10と、オーバーフロー検出器 110、剰余形式変換器 120 、減算器 130、商出力部 140、及び剰余形式逆変換器 150を含むスケーリング演算 器 100としてそれぞれ機能させる。
[0161] これに代えて、スケーリング演算モジュールは、剰余値変換モジュール及び変換結 果出力モジュールを含む第 1サブ剰余値変換モジュールと、剰余値変換モジュール 及び変換結果出力モジュールを含む第 2サブ剰余値変換モジュールと、第 1モジュ ラス対応減算モジュール及び第 2モジュラス対応減算モジュールを含む減算モジュ ールと、条件判断モジュールと、差分値調整モジュール、第 1モジュラス対応商出力 モジュール、及び第 2モジュラス対応商出力モジュールを含む商出力モジュールとを 備えてもよレ、。これらのプログラム又はモジュールは、コンピュータ 900内の CPU100 0及び Z又は RAM1020等を、剰余値変換器 302及び変換結果出力部 304を含む 第 1サブ剰余値変換部 300と、剰余値変換器 312及び変換結果出力部 314を含む 第 2サブ剰余値変換部 310と、第 1モジュラス対応減算器 330及び第 2モジュラス対 応減算器 340を含む減算器 320と、条件判断部 350と、差分値調整部 360、第 1モ ジュラス対応商出力部 372、及び第 2モジュラス対応商出力部 374を含む商出力部 370としてそれぞれ機能させる。
[0162] また、スケーリング演算モジュールは、剰余値変換モジュール及び変換結果出力モ ジュールを含む第 1サブ剰余値変換モジュールと、剰余値変換モジュール及び変換 結果出力モジュールを含む第 2サブ剰余値変換モジュールと、第 2モジュラス対応滅 算モジュールを含む減算モジュールと、第 1モジュラス対応商出力モジュール及び第 2モジュラス対応商出力モジュールを含む商出力モジュールとを備えてもよい。これら のプログラム又はモジュールは、コンピュータ 900內の CPU1000及び/又は RAM 1020等を、剰余値変換器 302及び変換結果出力部 304を含む第 1サブ剰余値変 換部 300と、剰余値変換器 312及び変換結果出力部 314を含む第 2サブ剰余値変 換部 31 0と、第 2モジュラス対応減算器 340を含む減算器 320と、商出力部 3ァ0とし てそれぞれ機能させる。
[0163] 以上に示したプログラム又はモジュールは、外部の記録媒体に格納されてもよい。
記録媒体としては、フレキシブルディスク 1070、 CD— ROM1080の他に、 DVDや P D等の光学記録媒体、 MD等の光磁気記録媒体、テープ媒体、 ICカード等の半導 体メモリ等を用いることができる。また、専用通信ネットワークやインターネットに接続 されたサーバシステムに設けたハードディスク又は RAM等の記憶装置を記録媒体と して使用し、通信ネットワークを介して外部のネットワーク力もプログラムをコンビュ一 タ 900に提供してもよい。
[0164] 以上に示したスケーリング演算器 100によるスケーリング演算の計算量を、従来方 式と比較する。
例えば、 5,8, 7, 3, 19,17, 13)という 7個のモジュラスで表現される算術剰余系の数値 をスケーリングする場合、式(1一 17)に示した中国人の剰余定理を用いると、 2進数 の 24ビット乗算を 7回行うこととなる。これに対し、図 2に示したスケーリング演算器 10 0によれば、 12ビット乗算を 7回行うことにより同様のスケーリングを実現できる。ここで 、積和演算の計算量はビット数の 2乗に比例する。この様に、 2進数で nビットとなる数 値をスケーリングする場合、 1ビット加算器の計算量を C(CompleXity)とすると、従来方 式では n2Cの計算量に対して、図 2に示したスケーリング演算器 100では (n/ 2Cの計 算量となる。従って、図 2に示したスケーリング演算器 100によれば、従来方式と比較 し計算量を 1 4に低減させることができる。
[0165] また、図 4に示したスケーリング演算器 100において、剰余値変換器 302内の変換 係数算出部 41 Ob— dをルックアップテーブルにより構成すれば、 2進数の各剰余桁( 2から 5ビット)の剰余加減算を 9から 12回行うこととなる。この様に、図 4に示したスケ 一リング演算器 100においては、モジュラスの選択による力;、概ね (n+(l/2)n)Cの計算 量となり、従来方式と比較し計算量を約 (l/24)nに低減させることができる。
[0166] 以上、本発明を実施の形態を用いて説明したが、本発明の技術的範囲は上記実 施の形態に記載の範囲には限定されない。上記実施の形態に、多様な変更または 改良を加えることが可能であることが当業者に明らかである。その様な変更または改 良を加えた形態も本発明の技術的範囲に含まれ得ることが、請求の範囲の記載から 明らかである。
[0167] 以下に、剰余系演算システム 5を実現する前提となる事項について補足説明を行う
[0168] (補足説明 1)スケーリング剰余系によるスケーリング方式の説明
以下に、スケーリング剰余系によるスケーリング方式 (SDSRNS方式)について、
Figure imgf000039_0001
T-l及び m1≠mT- 1の各場合に分けて説明する。
[0169]
Figure imgf000039_0002
モジュラスが {m1, m1}の 2個力もなるスケーリング剰余系において、 Yを でスケー リングしたスケーリング結果は、 Yを で割った商 qを用いて (q mod mT, q mod m と レ、う形で与えられる。ここで、 mf及び は互いに素であり、 mTと m1の間には、以下 の式(3—1)の関係があるものとする。
[0170] [数 23] m = m - 1 、 丄ノ
[0171] この場合、
Figure imgf000039_0003
なる。
[0172] 被スケーリング数 Yをモジュラス でスケーリングした結果 qを算出する方法を以下 に示す。なお、被スケーリング数 Yのモジュラス によるスケーリング結果 pは、同様 の方法で算出できるため説明を省略する。
[0173] 被スケーリング数 Yは、第 1のモジュラス m1による剰余値 yf及び第 2のモジュラス m1 による剰余値 y1の組による第 1の剰余形式 1)で表現される。ここで式(1一2)より 、以下の式(3—2)及び式 —3)が成立する。ただし、 ま丫を で割った剰余値、 y 1は Yを m 1で割った剰余値、 pは Yを m 'で割った商(p= Y/m ' )、 qは Yを m 1で割った商 (q= Y/m1)である。
[0174] [数 24]
Y = pm + y (3-2) [0175] [数 25]
Y = qin' + 丄 (3-3)
[0176] 式(3— 1)を式(3—3)に代入し、これを式(3— 2)より引くと、以下の式(3— 4)を得るこ とができ、式(3— 5)が成立することが分かる。
[0177] [数 26]
-ν' ^ pm -q{ -1)
(3-4)
= {p-q)m +(?ョ modw
[0178] [数 27]
Figure imgf000040_0001
[0179] 式(3— 5)から、 2つの剰余数の差 (yし yr)を計算することにより、 Yをモジュラス でスケーリングした結果 qを得ることができる。同様に、 Yをモジュラス でスケ一リン グした結果 pの 2進数表現は、以下の式(3 - 6)で得られる。
[0180] [数 28]
Y
y - y Imod w ― p (3-6)
m
[0181] つぎに, 2進数表現のスケーリング結果 qを、スケ一リング剰余系による表現に変換 する。モジュラスが十分に大きな数であるとき、以下の式(3— 7)の近似を用いて、式 ( 3-8)を導くことができる。
[0182] [数 29]
V
M - m m m {m 1) m (3-7)
[0183] [数 30]
0≤q<M/wT =wJ'(-mT) (3-8) [0184] すなわち、剰余桁の差でもとめられる計算結果 qは、必ずモジュラス1^ (m1)よりも小 さレ、と近似することができ、以下の式(3— 9)が成立する。
[0185] [数 31] 卞 '
q modnj = q mod m - q (3-9)
[0186] 以上により、 Yをモジュラス m1でスケーリングした結果は、以下の式(3— 10)により求 めること力できる。
[0187] [数 32] q-\q mod m , q mod m I
; ノ 、 、 (3-1。)
= 1 -y Imodm ,( - y Imodm
[0188] ただし、以上の式(3— 7)の近似は、 となる場合には成立しなレ、。そこで、被ス ケーリング数 Yの上限を Yく m1 Χπ^に制限する力、、 mによりスケーリングを行うか、 q mod
Figure imgf000041_0001
の場合に mod ずれかの手段を用いて実現し てよい。
[0189] (2)ιηΤ≠π - 1の場合
!!!了 :!!に Iかつ m1 >π の場合、式(3— 2)及び(3— 3)から以下の式(3— 11)を導く こと力 Sできる。
[0190] [数 33] ふ 个 T
V - y = pm - qm
= /?wT -q{m -{m -m )) )
† † L
-{p~q)m --q{m —m )
† L †
= q( -m )modw
[0191] ここで、 TO -IT )く に制限すると、以下の式(3— 12)が成立する。なお、この 制限により、 Yの最大値 Mは (m1 Xrr V -m )未満に制限される。
[0192] [数 34] (y - y ) mod in
9 = (3-12) IT
( ~m )
[0193] 以上より、 Yをモジュラス でスケーリングした結果は、式(3— 6)から式(3—10)と同 様にして、以下の式(3— 13)により求めることができる。
[0194] [数 35]
(y -y imoam {y - y )modm '
(3-13)
( † 丄、
[0195] 一方、 m 1かつ mTく i の場合、式(3-2)及び(3-3)から以下の式(3— 14 )を導くことができる。
[0196] [数 36]
† 丄 T
y qm 一 pm
- q{m +\m — m ))- pm
(3-14) = {q- p)m +q(m 一 m )
I † †
-q(m -m )modm
[0197] で、 に mT)く mTに制限すると、以下の式(3— 15)が成立する。なお、この 制限により、 Yの最大値 Mは (m1 XiV)/(mに mT)未満に制限される
[0198]
(y - y )modw
(3-15)
(m -m )
[0199] 以上より、 Yをモジュラス m -リングした結果は、以下の式(3— 16)により求め ること力 ^でさる。
[0200] [数 38]
(3-16)
(m - ) ( - m ) [0201] (補足説明 2)差分値調整によるスケーリング結果の算出方法
複数の第 2サブ剰余値 (y1 ,yl により表現される被スケーリング数 を、複数の 第 2変換サブ剰余値 ( により表現されるスケーリング係数 Ψ r
Figure imgf000043_0001
変換したモジュラス間差分値を用いて、スケーリング結果 zにおける ^を算出する方 法を説明する。以下説明の便宜上スケーリング剰余系を用いる。
[0202] まず、 zTの m1によるスケーリング結果 (以下 zUP から、 の によるスケーリング 結果(以下 zLOT)を導出するために、 zUPT及び zLOTの関係を示す。ここで、 zUPT 及ぴ zLOTの間には、以下の補助定理が成立する。
[0203] 補助定理: m 1 =m f - 1の場合、 zUP 1及ぴ zLO 'は、 zし 0 T =zUP T又は zLO ' = zUP T + 1 を満たす。
[0204] 証明: zLOT=zUPT+Jと仮定する。ただし、 Jは整数である。また、 zLO iYを m1でスケ 一リングした結果、 zUP iYを mfでスケーリングした結果である。式(1_2)より、スケ 一リング剰余系 (y T,y 1 )を用レ、て以下の式 (4—1 )及び式 (4-2)が得られる。
[0205] [数 39] y = zLO^ - ml + yl (4Ί) [0206] [数 40] y^zUP^ -m^ (4"2)
[0207] 式 (4—1)は、 m 1 =rn Τ -1を用いて以下の式(4 3)に変形することができる。
[0208] [数 41]
Figure imgf000043_0002
[0209] 式 (4一 2)と式 (4—3)により、以下の式 (4一 4)が成立する。
[0210] [数 42] yl -y^ =zUP' -J- l (4-4) [0211] ここで、 y Γは第 1モジュラス m Tの剰余であるため、 0≤yT<mTを満たす。また、 y 1は 第 2モジュラス m1の剰余であるため、 0≤ を満たす。従って、以下の式 (4_5 )カ成立する。
[0212] [数 43]
I 、,† < †
0; y -y (4-5)
[0213] 更に、 zUPTは Yを でスケーリングした結果であるから、式(3— 8)を適用すれば以 下の式(4一 6)が成立する。
[0214] [数 44]
0 ≤ zUP^ < l (4-6)
[0215] ここで、式(4一 4)において J≥2と仮定し、 yTをとりえる最小値である 0、 zUP1をとりえ る最大値である (mし 1)とすると、以下の式 (4一 7)となり、 0≤yTく に矛盾する。
[0216] [数 45] ヌ 4 =zひ尸丁ーゾ一 m;+0
= (ml -\)-J- l +0 (4-7) = (\ -J)ml -\ + 0<Q
[0217] また、 Jく 0と仮定した場合においても、 y = (卜 ^On^-l+y^m1となり、 0≤yT<mT に矛盾する。従って、 Jの取り得る値は 0又は 1である。すなわち、 zLO=zUPT又は zLO^zUl^ + lとなる。
[0218] 以上に示した補助定理を用レ、て、 zUP 1からスケーリング結果 Z 1 (=zLO T )を算出する ことができる。以下に、 2進数の y'(binyT)及び y bin )を用いて zLOrが zUPT又は zUP T +1のいずれであるかを判定する方法を示す。
[0219] 式 (4— 4)から、 J=0のとき yに yT= zUPT≥0となり、 J=lのとき yし yT= zUPr- m1 <0と なる。このため、以下の式 (4一 8)及び式 (4—9)が成立する。
[0220] [数 46] † のとき = zUPX (4-8) [0221] [数 47] yl < のとき z OT = zUP^ + 1 (4-9)
[0222] したがって bin yl≥bin yTの場合には zUPrを、 bin y!く bin y Tの場合には zUP'+l を、スケーリング結果 として出力すればよい。
産業上の利用可能性
[0223] 以上の説明から明ら力 ように、本発明によれば、剰余系による加滅乗算の高速化 と、スケーリング演算の高速化とを両立して実現する剰余系演算システムを提供する こと力 Sできる。

Claims

請求の範囲
[1] 数値を第 1モジュラス(法)による剰余値及び第 2モジュラスによる剰余値の組による 第 1の剰余形式で表現する剰余系において、前記第 1の剰余形式の入力値を前記 第 2モジュラスで割った前記第 1の剰余形式の商を算出するスケーリング演算器であ つて、
前記入力値における、前記第 1モジュラスによる剰余値及び前記第 2モジュラスによ る乗 I」余値の差分値であるモジュラス間差分値を出力する減算器と、
前記モジュラス間差分値に基づいて、前記商の第 1モジュラスによる剰余値及び前 記商の前記第 2モジュラスによる剰余値の組を前記商として出力する商出力部と を備えるスケーリング演算器。
[2] 前記第 1モジュラス及び前記第 2モジュラスは互いに素である請求項 1記載のスケ 一リング演算器。
[3] 前記第 1モジュラス及び前記第 2モジュラスの差は 1であり、
前記商出力部は、前記商の第 1モジュラスによる剰余値及び前記商の前記第 2モ ジュラスによる剰余値として、前記モジュラス間差分値の前記第 1モジュラスによる剰 余値を出力する
請求項 2記載のスケーリング演算器。
[4] 前記減算器は、前記剰余形式の前記入力値における、前記第 1モジュラス及び前 記第 2モジュラスのうちより小さいモジュラスによる剰余値からより大きいモジュラスに よる剰余値を減じた前記モジュラス間差分値を出力し、
前記商出力部は、前記モジュラス間差分値を前記第 1モジュラス及び前記第 2モジ ュラスの差の絶対値により割った値の前記第 1モジュラスによる剰余値を、前記商の 第 1モジュラスによる剰余値及び前記商の前記第 2モジュラスによる剰余値として算 出する
請求項 1記載のスケーリング演算器。
[5] 前記第 1モジュラスは、互いに素な複数の整数である複数の第 1サブモジュラスの 積であり、
前記第 2モジュラスは、互いに素な複数の整数である複数の第 2サブモジュラスの 積であり、
前記入力値の前記第 1モジュラスによる剰余値が、前記複数の第 1サブモジュラス のそれぞれにより前記入力値を割った複数の第 1サブ剰余値により表現され、前記 入力値の前記第 2モジュラスによる剰余値が、前記複数の第 2サブモジュラスのそれ ぞれにより前記入力値を割った複数の第 2サブ剰余値により表現された第 2の剰余 形式の前記入力値を、前記第 1の剰余形式の前記入力値に変換する剰余形式変換 器と、
前記商出力部が出力した前記第 1の剰余形式の前記商を、前記第 2の剰余形式の 前記商に変換する剰余形式逆変換器と
を備える請求項 1記載のスケーリング演算器。
前記第 1モジュラスは、互いに素な複数の整数である複数の第 1サブモジュラスの 積であり、
前記第 2モジュラスは、互いに素な複数の整数である複数の第 2サブモジュラスの 積であり、
前記入力値は、前記第 1モジュラスによる剰余値が、前記複数の第 1サブモジュラ スのそれぞれにより前記入力値を割った複数の第 1サブ剰余値により表現され、前記 第 2モジュラスによる剰余値が、前記複数の第 2サブモジュラスのそれぞれにより前記 入力値を割った複数の第 2サブ剰余値により表現された第 2の剰余形式により更に 表現され、
前記複数の第 1サブ剰余値により表現された、前記入力値の前記第 1モジュラスに よる剰余値を、前記複数の第 2サブモジュラスのそれぞれによる剰余である複数の第 1変換サブ剰余値に変換する第 1サブ剰余値変換部を更に備え、
前記減算器は、前記入力値の前記第 1モジュラスによる剰余値を示す前記複数の 第 1変換サブ剰余値と、前記入力値の前記第 2モジュラスによる剰余値を示す前記 複数の第 2サブ剰余値との差分値であつて、前記複数の第 2サブモジュラスのそれぞ れにより当該差分値を割った複数の剰余値により表現された第 1の前記モジュラス間 差分値を出力する第 2モジュラス対応減算器を有し、
前記商出力部は、前記第 1のモジュラス間差分値に基づいて、前記複数の第 2サ ブモジュラスのそれぞれによる複数の剰余値により表現された前記商の前記第 2モジ ュラスによる剰余値を出力する第 2モジュラス対 '応商出力部を有する
請求項 1記載のスケーリング演算器。
[7] 前記複数の第 2サブ剰余値により表現された、前記入力値の前記第 2モジュラスに よる剰余値を、前記複数の第 1サブモジュラスのそれぞれによる剰余である複数の第 2変換サブ剰余値に変換する第 2サブ剰余値変換部を更に備え、
前記減算器は、前記入力値の前記第 2モジュラスによる剰余値を示す前記複数の 第 2変換サブ剰余値と、前記入力値の前記第 1モジュラスによる剰余値を示す前記 複数の第 1サブ剰余値との差分値であって、前記複数の第 1サブモジュラスのそれぞ れにより当該差分値を割った複数の剰余値により表現された第 2の前記モジュラス間 差分値を出力する第 1モジュラス対応減算器を更に有し、
前記商出力部は、前記第 2のモジュラス間差分値に基づいて、前記複数の第 1サ ブモジュラスのそれぞれによる複数の剰余値により表現された前記商の前記第 1モジ ュラスによる剰余値を出力する第 1モジュラス対応商出力部を更に有する 請求項 6記載のスケーリング演算器。
[8] 前記入力値の前記第 1モジュラスによる剰余値と、前記入力値の前記第 2モジュラ スによる剰余値とが、予め定められた大小関係を満たすか否力を判断する条件判断 部を更に備え、
前記商出力部は、前記入力値の前記第 1モジュラスによる剰余値と、前記入力値の 前記第 2モジュラスによる剰余値とが、前記予め定められた大小関係を満たす場合に 、前記第 1のモジュラス間差分値及び前記第 2のモジュラス間差分値の一方に予め 定められた定数を加えて調整した前記第 1のモジュラス間差分値及び前記第 2のモ ジュラス間差分値を、前記第 1モジュラス対応商出力部及び前記第 2モジュラス対応 商出力部にそれぞれ供給する差分値調整部を更に有する
請求項 7記載のスケーリング演算器。
[9] 前記第 1サブ剰余値変換部は、
前記複数の第 1サブ剰余値により表現された前記入力値の前記第 1モジュラスによ る剰余値を初期値とする被変換値における、前記複数の第 1サブモジュラスのそれ ぞれにより前記被変換値を割った複数の被変換剰余値のそれぞれについて、前記 被変換値力 減じた場合に、順次当該被変換剰余値を 0とし、かつ、既に 0に変換さ れた他の全ての前記被変換剰余値を 0に保つ変換係数を算出する変換係数算出部 と、
前記変換係数算出部により順次算出される、前記第 1モジュラスによる剰余値によ り表現された前記変換係数を、順次加算していく変換係数加算器と、
前記変換係数算出部により順次算出される、前記複数の第 1サブモジュラスのそれ ぞれによる複数の剰余値により表現された前記変換係数を、前記被変換値から順次 減じる被変換値減算器と、
前記複数の被変換剰余値の全てについて算出された全ての前記変換係数が前記 変換係数加算器により加算された加算値を前記複数の第 2サブモジュラスのそれぞ れにより割った複数の剰余値を、前記複数の第 1変換サブ剰余値として出力する変 換結果出力部と
を備える請求項 7記載のスケーリング演算器。
[10] 前記変換係数算出部は、前記複数の被変換剰余値のそれぞれについて、当該被 変換剰余値に対応するアドレスに、当該被変換剰余値に対応する前記変換係数を データとして格納するメモリを含む請求項 9記載のスケーリング演算器。
[11] 前記第 1モジュラスは、互いに素な複数の整数である複数の第 1サブモジュラスの 積であり、
前記第 2モジュラスは、互いに素な複数の整数である複数の第 2サブモジュラスの 積であり、
前記入力値は、前記第 1モジュラスによる剰余値が、前記複数の第 1サブモジュラ スのそれぞれにより前記入力値を割った複数の第 1サブ剰余値により表現され、前記 入力値の前記第 2モジュラスによる剰余値が、前記複数の第 2サブモジュラスのそれ ぞれにより前記入力値を割った複数の第 2サブ剰余値により表現された第 2の剰余 形式により更に表現され、
前記複数の第 1サブ剰余値により表現された前記入力値の前記第 1モジュラスによ る剰余値を、前記複数の第 2サブモジュラスのそれぞれによる剰余である複数の第 1 変換サブ剰余値に変換する第 1サブ剰余値変換部を更に備え、
前記減算器は、前記入力値の前記第 1モジュラスによる剰余値を示す前記複数の 第 1変換サブ剰余値と、前記入力値の前記第 2モジュラスによる剰余値を示す前記 複数の第 2サブ剰余値との差分値であって、前記複数の第 2サブモジュラスのそれぞ れにより当該差分値を割った複数の剰余値により表現された第 1の前記モジュラス間 差分値を出力する第 2モジュラス対応減算器を有し、
更に、前記複数の第 2サブモジュラスのそれぞれによる複数の剰余値により表現さ れた前記第 1のモジュラス間差分値を、前記複数の第 1サブモジュラスのそれぞれに よる複数の剰余値により表現された変換モジュラス間差分値に変換する第 2サブ剰 余値変換部を備え、
前記商出力部は、
前記変換モジュラス間差分値に基づいて、前記複数の第 1サブモジュラスのそれぞ れによる複数の剰余値により表現された前記商の前記第 1モジュラスによる剰余値を 出力する第 1モジュラス対応商出力部と、
前記第 1のモジュラス間差分値に基づいて、前記複数の第 2サブモジュラスのそれ ぞれによる複数の剰余値により表現された前記商の前記第 2モジュラスによる剰余値 を出力する第 2モジュラス対応商出力部と
を有する請求項 1記載のスケーリング演算器。
数値を第 1モジュラス(法)による剰余値及び第 2モジュラスによる剰余値の組による 第 1の剰余形式で表現する剰余系を用いる剰余系演算システムであって、 演算対象となる 2つの被演算値を入力し、 2つの被演算値の間で加算、減算、又は 乗算を行う剰余系演算器と、
前記剰余系演算器による演算結果にスケーリングが必要である場合に、前記演算 結果を入力値として入力し、前記入力値を前記第 2モジュラスで割った商を前記演算 結果のスケ一リング結果として算出するスケーリング演算器と
を備え、
前記スケーリング演算器は、
前記入力値における、前記第 1モジュラスによる剰余値及び前記第 2モジュラスによ る剰余値の差分値であるモジュラス間差分値を出力する減算器と、 前記モジュラス間差分値に基づいて、前記商の第 1モジュラスによる剰余値及び前 記商の前記第 2モジュラスによる剰余値の組を前記商として出力する商出力部と を有する剰余系演算システム。
[13] 数値を第 1モジュラス (法)による剰余値及び第 2モジュラスによる剰余値の組による 第 1の剰余形式で表現する剰余系において、前記第 1の剰余形式の入力値を前記 第 2モジュラスで割った前記第 1の剰余形式の商を演算器により算出するスケーリン グ演算方法であって、
前記入力値における、前記第 1モジュラスによる剰余値及び前記第 2モジュラスによ る剰余値の差分値であるモジュラス間差分値を出力する減算段階と、
前記モジュラス間差分値に基づレ、て、前記商の第 1モジュラスによる剰余値及び前 記商の前記第 2モジュラスによる剰余値の組を前記商として出力する商出力段階と を備えるスケーリング演算方法。
[14] 前記第 1モジュラスは、互いに素な複数の整数である複数の第 1サブモジュラスの 積であり、
前記第 2モジュラスは、互レ、に素な複数の整数である複数の第 2サブモジュラスの 積であり、
前記入力値は、前記第 1モジュラスによる剰余値が、前記複数の第 1サブモジュラ スのそれぞれにより前記入力値を割った複数の第 1サブ剰余値により表現され、前記 第 2モジュラスによる剰余値力、前記複数の第 2サブモジュラスのそれぞれにより前記 入力値を割った複数の第 2サブ剰余値により表現された第 2の剰余形式により更に 表現され、
前記複数の第 1サブ剰余値により表現された、前記入力値の前記第 1モジュラスに よる剰余値を、前記複数の第 2サブモジュラスのそれぞれによる剰余である複数の第 1変換サブ剰余値に変換する第 1サブ剰余値変換段階を更に備え、
前記減算段階は、前記入力値の前記第 1モジュラスによる剰余値を示す前記複数 の第 1変換サブ剰余値と、前記入力値の前記第 2モジュラスによる剰余値を示す前 記複数の第 2サブ剰余値との差分値であって、前記複数の第 2サブモジュラスのそれ ぞれにより当該差分値を割った複数の剰余値により表現された第 1の前記モジュラス 間差分値を出力する第 2モジュラス対応減算段階を有し、
前記商出力段階は、前記第 1のモジュラス間差分値に基づいて、前記複数の第 2 サブモジュラスのそれぞれによる複数の剰余値により表現された前記商の前記第 2モ ジュラスによる剰余値を出力する第 2モジュラス対応商出力段階を有する 請求項 13記載のスケーリング演算方法。
PCT/JP2004/010510 2003-07-31 2004-07-23 剰余系演算システム、スケーリング演算器、スケーリング演算方法、及びそのプログラムと記録媒体 Ceased WO2005013117A1 (ja)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US11/340,870 US8326908B2 (en) 2003-07-31 2006-01-27 Residue number system arithmetic operating system, scaling operator, scaling operation method and program and recording medium of the same

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2003284534A JP4279626B2 (ja) 2003-07-31 2003-07-31 剰余系演算システム、スケーリング演算器、スケーリング演算方法、及びそのプログラムと記録媒体
JP2003-284534 2003-07-31

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US11/340,870 Continuation US8326908B2 (en) 2003-07-31 2006-01-27 Residue number system arithmetic operating system, scaling operator, scaling operation method and program and recording medium of the same

Publications (1)

Publication Number Publication Date
WO2005013117A1 true WO2005013117A1 (ja) 2005-02-10

Family

ID=34113845

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2004/010510 Ceased WO2005013117A1 (ja) 2003-07-31 2004-07-23 剰余系演算システム、スケーリング演算器、スケーリング演算方法、及びそのプログラムと記録媒体

Country Status (3)

Country Link
US (1) US8326908B2 (ja)
JP (1) JP4279626B2 (ja)
WO (1) WO2005013117A1 (ja)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
RU2485574C1 (ru) * 2012-04-17 2013-06-20 Федеральное государственное бюджетное образовательное учреждение высшего профессионального образования Вятский государственный университет (ФГБОУ ВПО "ВятГУ") Способ организации умножения чисел с плавающей запятой, представленных в системе остаточных классов
US9081608B2 (en) * 2012-05-19 2015-07-14 Digital System Research Inc. Residue number arithmetic logic unit
RU2509345C1 (ru) * 2012-07-27 2014-03-10 Федеральное государственное бюджетное образовательное учреждение высшего профессионального образования Вятский государственный университет ФГБОУ ВПО "ВятГУ" Способ организации выполнения операции умножения двух чисел в модулярно-позиционном формате представления с плавающей точкой на универсальных многоядерных процессорах
US9513870B2 (en) * 2014-04-22 2016-12-06 Dialog Semiconductor (Uk) Limited Modulo9 and modulo7 operation on unsigned binary numbers
IT201700008949A1 (it) * 2017-01-27 2018-07-27 St Microelectronics Srl Procedimento di funzionamento di reti neurali, rete, apparecchiatura e prodotto informatico corrispondenti
US10387122B1 (en) 2018-05-04 2019-08-20 Olsen Ip Reserve, Llc Residue number matrix multiplier
US10992314B2 (en) * 2019-01-21 2021-04-27 Olsen Ip Reserve, Llc Residue number systems and methods for arithmetic error detection and correction
US10725788B1 (en) * 2019-03-25 2020-07-28 Intel Corporation Advanced error detection for integer single instruction, multiple data (SIMD) arithmetic operations

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001202232A (ja) * 2000-01-24 2001-07-27 Toshiba Corp 剰余系演算装置及び方法

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB2217882B (en) * 1988-04-29 1992-06-10 Philips Electronic Associated Arithmetic apparatus
GB2217883B (en) * 1988-04-29 1992-06-10 Philips Electronic Associated Arithmetic apparatus
US6898613B1 (en) * 1999-08-26 2005-05-24 Stmicroelectronics, Inc. Arithmetic circuits for use with the residue number system

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001202232A (ja) * 2000-01-24 2001-07-27 Toshiba Corp 剰余系演算装置及び方法

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
ANANTHA M ET AL: "A Fast and Accurate RNS Scaling Technique for High Speed Signal Processing", IEEE TRANSACTIONS ON ACOUSTICS, SPEECH, AND SIGNAL PROCESSING, vol. 37, no. 6, June 1986 (1986-06-01), pages 929 - 937, XP000111957 *
SHENOY A P ET AL: "An accurate scaling technique in improve d residue number system arithmetic", IEEE INTERNATIONAL CONFERENCE ON ICASSP - ACOUSTICS, SPEECH, AND SIGNAL PROCESSING, vol. 12, April 1987 (1987-04-01), pages 1414 - 1417, XP000758066 *

Also Published As

Publication number Publication date
JP2005056032A (ja) 2005-03-03
JP4279626B2 (ja) 2009-06-17
US8326908B2 (en) 2012-12-04
US20060184600A1 (en) 2006-08-17

Similar Documents

Publication Publication Date Title
KR100241076B1 (ko) 조정및정규화클래스를구비한부동소수점승산및누산장치
US5261001A (en) Microcircuit for the implementation of RSA algorithm and ordinary and modular arithmetic, in particular exponentiation, with large operands
EP1421472A2 (en) A method and apparatus for carrying out efficiently arithmetic computations in hardware
US6304890B1 (en) Exponential calculation device and decoding device
KR100465371B1 (ko) 덧셈 및 반올림 연산을 동시에 수행하는 부동 소수점alu 연산 장치
US7831650B2 (en) Method for modular multiplication
JP3551113B2 (ja) 除算器
JP4279626B2 (ja) 剰余系演算システム、スケーリング演算器、スケーリング演算方法、及びそのプログラムと記録媒体
CN100440136C (zh) 算术单元
JPH01302425A (ja) 浮動小数点加減算回路
Hung et al. Fast RNS division algorithms for fixed divisors with application to RSA encryption
JP3941868B2 (ja) 計算装置及び計算方法
US20040210613A1 (en) Method and apparatus for modular multiplication
JPH086766A (ja) 正弦余弦演算装置
JP2010102431A (ja) 浮動小数点数演算回路と浮動小数点演算方法及びサーボ制御装置
JP2795253B2 (ja) 除算器
JP4163967B2 (ja) 浮動小数点演算装置
JP3332270B2 (ja) べき乗演算装置
JP4080754B2 (ja) 剰余演算装置及び方法
JP2000081968A (ja) 逆数演算装置
JP2002358196A (ja) 平方根の逆数計算方法、計算回路、及びプログラム
JP4073513B2 (ja) 浮動小数点処理装置
JP2993119B2 (ja) 浮動小数点演算装置
JP2003029960A (ja) 浮動小数点加算器のショートパスにおける丸めステップの排除
JP3104569B2 (ja) 除算回路

Legal Events

Date Code Title Description
AK Designated states

Kind code of ref document: A1

Designated state(s): AE AG AL AM AT AU AZ BA BB BG BR BW BY BZ CA CH CN CO CR CU CZ DE DK DM DZ EC EE EG ES FI GB GD GE GH GM HR HU ID IL IN IS JP KE KG KP KR KZ LC LK LR LS LT LU LV MA MD MG MK MN MW MX MZ NA NI NO NZ OM PG PH PL PT RO RU SC SD SE SG SK SL SY TJ TM TN TR TT TZ UA UG US UZ VC VN YU ZA ZM ZW

AL Designated countries for regional patents

Kind code of ref document: A1

Designated state(s): BW GH GM KE LS MW MZ NA SD SL SZ TZ UG ZM ZW AM AZ BY KG KZ MD RU TJ TM AT BE BG CH CY CZ DE DK EE ES FI FR GB GR HU IE IT LU MC NL PL PT RO SE SI SK TR BF BJ CF CG CI CM GA GN GQ GW ML MR NE SN TD TG

121 Ep: the epo has been informed by wipo that ep was designated in this application
WWE Wipo information: entry into national phase

Ref document number: 11340870

Country of ref document: US

WWP Wipo information: published in national office

Ref document number: 11340870

Country of ref document: US

122 Ep: pct application non-entry in european phase
NENP Non-entry into the national phase

Ref country code: JP