WO2020090024A1 - 演算処理装置 - Google Patents

演算処理装置 Download PDF

Info

Publication number
WO2020090024A1
WO2020090024A1 PCT/JP2018/040475 JP2018040475W WO2020090024A1 WO 2020090024 A1 WO2020090024 A1 WO 2020090024A1 JP 2018040475 W JP2018040475 W JP 2018040475W WO 2020090024 A1 WO2020090024 A1 WO 2020090024A1
Authority
WO
WIPO (PCT)
Prior art keywords
arithmetic
circuit
selector
processing
calculation
Prior art date
Application number
PCT/JP2018/040475
Other languages
English (en)
French (fr)
Inventor
健 小薗井
洋征 和田
Original Assignee
富士通株式会社
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 富士通株式会社 filed Critical 富士通株式会社
Priority to JP2020554660A priority Critical patent/JP7131627B2/ja
Priority to PCT/JP2018/040475 priority patent/WO2020090024A1/ja
Publication of WO2020090024A1 publication Critical patent/WO2020090024A1/ja

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F7/00Methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F7/38Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation
    • G06F7/48Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation using non-contact-making devices, e.g. tube, solid state device; using unspecified devices
    • G06F7/57Arithmetic logic units [ALU], i.e. arrangements or devices for performing two or more of the operations covered by groups G06F7/483 – G06F7/556 or for performing logical operations
    • G06F7/575Basic arithmetic logic units, i.e. devices selectable to perform either addition, subtraction or one of several logical operations, using, at least partially, the same circuitry

Definitions

  • the present invention relates to an arithmetic processing device.
  • the processor of the information processing device is equipped with an arithmetic circuit (arithmetic unit) that realizes arithmetic.
  • arithmetic circuits include, for example, an adder circuit that performs addition, a multiplication circuit that performs multiplication, a square root arithmetic circuit that performs square root arithmetic, an exponential arithmetic circuit that performs exponential arithmetic, and a logarithmic arithmetic circuit that performs logarithmic arithmetic.
  • the present invention was created in view of such problems, and an object of the present invention is to enable exponential operation and logarithmic operation, and division and square root operation to be realized by a common arithmetic circuit.
  • this arithmetic processing device has a first processing unit that processes exponential arithmetic and logarithmic arithmetic, and a second processing unit that processes division and square root arithmetic.
  • the common processing section is shared by the processing section of the second processing section and the second processing section.
  • exponential arithmetic and logarithmic arithmetic, and division and square root arithmetic can be realized by a common arithmetic circuit.
  • FIG. 6 is a flowchart for explaining processing of an arithmetic processing circuit as an example of the first embodiment.
  • 6 is a flowchart for explaining processing of an arithmetic processing circuit as an example of the first embodiment.
  • 6 is a flowchart for explaining processing of an arithmetic processing circuit as an example of the first embodiment.
  • 6 is a flowchart for explaining processing of an arithmetic processing circuit as an example of the first embodiment.
  • 6 is a flowchart for explaining processing of an arithmetic processing circuit as an example of the first embodiment.
  • FIG. 1 is a diagram illustrating a configuration of an arithmetic processing circuit 1a as an example of the first embodiment.
  • the arithmetic processing circuit (arithmetic unit) 1a is provided, for example, in a processor (arithmetic processing unit) of an information processing device and realizes arithmetic.
  • the arithmetic processing circuit 1a shown in FIG. 1 is an arithmetic processing circuit that realizes four types of arithmetic operations: exponential (EXP) arithmetic, logarithmic (LOG) arithmetic, division (DIV) arithmetic, and square root (SQRT) arithmetic. That is, the arithmetic processing circuit 1a selectively realizes any one of an exponential operation, a logarithmic operation, a division operation, and a square root operation.
  • EXP exponential
  • LOG logarithmic
  • DIV division
  • SQL square root
  • E i E i calculation
  • the arithmetic processing circuit 1a uses the radix-4 STL method for logarithmic calculation.
  • x is input and log (x) is obtained.
  • L is a logarithmic space variable
  • E is an antilogarithmic space variable.
  • i is the number of repeated calculations.
  • the arithmetic processing circuit 1a uses the STL (Sequential Table Lookup) method (first algorithm) for exponential operation and logarithmic operation.
  • the arithmetic processing circuit 1a uses a radix-4 SRT (Sweeney, Robertson, Tocher) method (second algorithm) for obtaining a quotient of 2 bits in one operation for division.
  • SRT Silicon, Robertson, Tocher
  • Q is a partial quotient (a quotient halfway through the iteration)
  • D is a divisor.
  • R is the partial remainder
  • i is the number of iterations of the operation.
  • R i (R i calculation) uses the following equation (3).
  • R i + 1 R i -D ⁇ q i (3)
  • q i (-2 or -1 or 0 or +1 or +2) ⁇ 2 ⁇ -2i.
  • the arithmetic processing circuit 1a uses the radix-4 SRT method (second algorithm) for the square root calculation.
  • y is input and sqrt (y) is calculated.
  • Q is a partial quotient
  • R is a partial remainder
  • i is the number of iterations of the operation.
  • R i (R i calculation) uses the following equation (5).
  • R i + 1 Ri-2Q i ⁇ q i -q i ⁇ 2 (5)
  • q i (-2 or -1 or 0 or +1 or +2) ⁇ 2 ⁇ -2i.
  • the Q i calculate the (Q i calculation) using the following equation (6).
  • Q i + 1 Q i + q i (6)
  • the calculation method of R i and Q i is almost the same as the division calculation, but strictly speaking, the calculation of R i is different.
  • the magnitude relationship between R i and 0 and the difference are determined, and q i is selected so that R i comes closest to 0.
  • the arithmetic processing circuit 1a of the first embodiment has registers 101 to 104, determination circuits 105 and 106, and CSA (Carry-Save Adder) 107 and 108. , Log Table circuit 109, right shift circuits (RSFT) 110 and 111, processing circuit 112, arithmetic circuits 113 to 119, 130 and 131, and selectors 120 to 126.
  • CSA Carry-Save Adder
  • the register 101 may be referred to as a register LS / Q.
  • the register 102 may be referred to as a register LC / D
  • the register 103 may be referred to as a register ES / RS
  • the register 104 may be referred to as a register EC / RC.
  • the register 101 is connected to the determination circuits 105 and 106, the arithmetic circuits 115 and 119, and the CSA 107, respectively.
  • this arithmetic processing circuit 1a performs exponentiation or logarithmic calculation, the result of L i calculation by CSA107 described later in this register 101 (sum) is stored through the selector 124.
  • the register value L i read from the register 101 is input to the determination circuit 105 and the CSA 107, respectively.
  • the arithmetic processing circuit 1a performs division or square root operation
  • the operation result Q of (Q + q) by the arithmetic circuit 119 described later is selected by the selector 124 and stored in the register 101.
  • the register value Q read from the register 101 is input to the determination circuit 106 and the arithmetic circuits 115 and 119, respectively.
  • the register 102 is connected to the determination circuits 105 and 106 and the CSA 107, respectively.
  • the register 102 is also connected to the processing circuit 112 via the selector 120. Further, the output of the register 102 is also input to the selector 123.
  • the arithmetic processing circuit 1 a When the arithmetic processing circuit 1 a performs an exponential operation or a logarithmic operation, the result (carry) of the L i operation by the CSA 107 is stored in the register 102 via the selector 123.
  • the register value L i read from the register 102 is input to the determination circuit 105 and the CSA 107, respectively.
  • the register value D is selected by the selector 123 and stored in the register 102.
  • the register 102 is not used when the arithmetic processing circuit 1a performs square root calculation.
  • the register value D read from the register 102 is input to the determination circuit 106.
  • the register value D read from the register 102 is also input to the processing circuit 112 via the selector 120.
  • Log Table circuits 109 and CSA107 is, to achieve a L i operations in exponentiation or logarithmic operation.
  • the right shift circuits 110 and 111, the arithmetic circuits 113, 114, 116 and 117, and the CSA 108 realize E i arithmetic in exponential arithmetic or logarithmic arithmetic.
  • the processing circuit 112 when the arithmetic processing circuit 1a performs the division, the processing circuit 112, the arithmetic circuits 116, 117, 130, 131 and the CSA 108 realize the R i operation. Further, when the present arithmetic processing circuit 1a performs a square root operation, the processing circuit 112, the arithmetic circuits 116 to 118, 130, 131 and the CSA 108 realize the R i operation.
  • the digit of q i decreases by 2 bits per cycle, but by multiplying both sides of equations (3) and (5) by 4 for each cycle, the digit of q i To be constant. Further, the Q i calculation in the division and square root calculation is realized by the calculation circuit 119.
  • the judgment circuit 105 is used for exponential operation or logarithmic operation.
  • the decision circuit 105 selects n based on L i .
  • the determination circuit 105 determines the magnitude relationship and difference between L i and 0, and selects the value of n where L i is closest to 0.
  • the determination circuit 105 determines the magnitude relationship and difference between E i and 1, and selects the value of n at which E i is closest to 1.
  • the processing by the determination circuit 105 may be realized by using a known method, and detailed description thereof will be omitted.
  • n determined by the determination circuit 105 is input to the arithmetic circuits 113, 114, 116, 117 and the Log Table circuit 109.
  • the Log Table circuit 109 and the CSA 107 carry out the calculation of L i .
  • the Log Table circuit 109 is used for exponential operation or logarithmic operation.
  • the Log Table circuit 109 outputs log (1 + n * 2 ⁇ -2i).
  • the values of log (1 + n * 2 ⁇ -2i) corresponding to the variables i and n are set in advance, and log (1 Output the value of + n * 2 ⁇ -2i).
  • the CSA 107 is a carry-in adder (full adder) with three inputs and two outputs (3 in-2 out), and each output is input from the registers 101 and 102 and the Log Table circuit 109. Further, of the output (calculation result) of the CSA 107, the sequence of partial sum bits is output to the selector 124 and input to the register 101 via the selector 124. On the other hand, of the output (calculation result) of the CSA 107, the carry bit string is output to the selector 123 and input to the register 102 via the selector 123.
  • the CSA 107 is used for exponential calculation or logarithmic calculation.
  • the CSA 107 calculates L i + 1 .
  • the CSA 107 uses the value of log (1 + n * 2 ⁇ -2i) output from the Log Table circuit 109 to calculate L i based on the above equation (1).
  • the value of L i + 1 calculated by the CSA 107 is input to the selector 124.
  • the arithmetic circuit 119 is used for division or square root calculation.
  • the arithmetic circuit 115 is used for square root calculation.
  • the arithmetic circuit 115 is a doubling circuit that doubles the input value and outputs it.
  • the operation circuit 115 performs a double ( ⁇ 2) operation on the register value Q i read from the register 101.
  • the arithmetic circuit 115 realizes doubling by shifting the input register value to the left by bit.
  • the calculation result of the calculation circuit 115 is input to the processing circuit 112 via the selector 120.
  • the selector 120 selects and outputs the output of the arithmetic circuit 115 during square root calculation. Also, the selector 120 selects and outputs the register value D of the register 102 at the time of division.
  • the register 103 is connected to the determination circuits 105 and 106, the right shift circuit 110, and the arithmetic circuit 118, respectively.
  • this arithmetic processing circuit 1a performs exponentiation or logarithmic operation as a result of E i calculation output by the selector 125 and 126 to be described later in this register 103 (sum) is stored.
  • the register value E i read from the register 103 is input to the determination circuit 105 and the right shift circuit 110, respectively.
  • the register 103 stores the result (sum) of the R i calculation output by the selectors 125 and 126.
  • the register value R i read from the register 103 is input to the determination circuit 106 and the arithmetic circuit 118, respectively.
  • the register 104 is connected to the determination circuits 105 and 106, the right shift circuit 111, and the CSA 108, respectively.
  • the arithmetic processing circuit 1a When the arithmetic processing circuit 1a performs exponential arithmetic or logarithmic arithmetic, the result (carry) of the E i arithmetic output by the selectors 125 and 126 is stored in the register 104.
  • the register value E i read from the register 104 is input to the determination circuit 105 and the right shift circuit 111, respectively.
  • the register value E i read from the register 104 is also input to the CSA 108.
  • the register 104 stores the result (carry) of the R i calculation output by the selectors 125 and 126.
  • the register value R i read from the register 104 is input to the determination circuit 106 and the CSA 108, respectively.
  • the CSA 108 is a 4-input-2 output (4 in--2 out) carry save adder (full adder), to which the respective outputs from the arithmetic circuits 116, 117, 118 and the register 104 are input.
  • the column of partial sum bits of the output (calculation result) of the CSA 108 is input to the calculation circuit 130 and the selector 125.
  • the carry bit string of the output (calculation result) of the CSA 108 is input to the calculation circuit 131 and the selector 126.
  • FIG. 2 is a diagram illustrating the configuration of the CSA 108 of the arithmetic processing circuit 1a as an example of the first embodiment.
  • the CSA 108 has a multi-stage configuration in which two 3-input-2 output (3 in-2 out) full adders are combined.
  • the CSA 108 realizes 4 inputs by using the output (S, C) of one carry save adder with 3 inputs and 2 outputs as the input of another carry save adder with 3 inputs and 2 outputs. is doing.
  • the sequence of partial sum bits is input to the register 103 via the calculation circuit 130 and the selector 125.
  • the string of carry bits is input to the register 104 via the calculation circuit 131 and the selector 126.
  • the arithmetic circuits 130 and 131 perform a quadruple arithmetic operation ( ⁇ 4) arithmetic operation on the respective input values. Quadruple operation is realized by shifting the input value to the left by 2 bits.
  • the selectors 125 and 126 select and output the output of the CSA 108 when the arithmetic processing circuit 1a performs exponential arithmetic or logarithmic arithmetic.
  • the selector 125 selects and outputs the output of the arithmetic circuit 130 and the selector 126 selects and outputs the output of the arithmetic circuit 131, respectively.
  • the arithmetic circuits 130 and 131 perform the tuning of the 2 ⁇ -2i portion of q i .
  • the processing circuit 112 generates three signals of x0, x1, and x2. At the time of division, the selector 120 outputs the register value D. By the processing circuit 112 and the arithmetic circuit 116 multiplying D by 0 times / ⁇ 1 times / ⁇ 2 times, the operation of D ⁇ q i in Expression (3) is realized.
  • the arithmetic circuit 115 outputs twice the register value Q (2Q), and the selector 120 outputs 2Q.
  • the processing circuit 112 and the arithmetic circuit 116 multiplying 2Q by 0 times / ⁇ 1 times / ⁇ 2 times, the 2Q i ⁇ q i portion of Expression (5) is generated.
  • the arithmetic circuit 115 realizes doubling by shifting the output Q of the register 101 by 1 bit to the left.
  • the output of the arithmetic circuit 115 is input to the selector 120.
  • the output D of the register 102 and the output of the arithmetic circuit 115 are input to the selector 120.
  • the selector 120 selects the output D of the register 102 and outputs it to the processing circuit 112.
  • the selector 120 selects the output of the calculation circuit 115 and outputs it to the processing circuit 112.
  • the processing circuit 112 generates and outputs a fixed value 0 ( ⁇ 0), a value obtained by through-outputting the input value ( ⁇ 1), and a value obtained by shifting the input value by 1 bit to the left ( ⁇ 2).
  • the processing circuit 112 is configured to be able to output each value of x0, x1 and x2. These values set in the processing circuit 112 correspond to the options selected by the determination circuit 106.
  • the selector 121 selects one of the output values of x0, x1 and x2 output from the processing circuit 112 and outputs it to the selector 122.
  • the selector 121 selects and outputs an output value corresponding to q i determined by the determination circuit 106 from among a plurality of types of options ( ⁇ 0, ⁇ 1, ⁇ 2) output by the processing circuit 112.
  • the selector 121 selects an option corresponding to the absolute value of q i .
  • the arithmetic circuit 116 inverts the output value (positive value) of the selector 121 to make it a negative value.
  • the right shift circuits 110 and 111 respectively shift the register values ES and EC by 2i bits to the right, thereby generating the E i ⁇ 2 ⁇ -2i portion of the equation (2).
  • the right shift circuit 110 performs a 2i-bit right shift operation on the register output ES of the register 103 when the present operation processing circuit 1a performs an exponential operation or a logarithmic operation, thereby performing 2 ⁇ -2i multiplication. To achieve.
  • the output of the right shift circuit 110 is input to the arithmetic circuit 113.
  • the right shift circuit 111 realizes 2 ⁇ -2i multiplication by performing a 2i-bit right shift operation on the register output EC of the register 104 when the present arithmetic processing circuit 1a performs an exponential operation or a logarithmic operation. To do.
  • the output of the right shift circuit 111 is input to the arithmetic circuit 114.
  • E i ⁇ n ⁇ 2 ⁇ -2i is generated by the arithmetic circuits 113 and 116 in the subsequent stage of the right shift circuits 110 and 111.
  • the arithmetic circuits 113 and 114 perform a 1 ⁇ ( ⁇ 1) operation or a 2 ⁇ ( ⁇ 2) operation on the input value when the arithmetic processing circuit 1 a performs an exponential operation or a logarithmic operation.
  • the arithmetic circuits 113 and 114 realize the 1 ⁇ ( ⁇ 1) arithmetic operation by passing the input value. Further, the arithmetic circuits 113 and 114 realize the double operation by shifting the input register value to the left by 1 bit.
  • the calculation result of the calculation circuit 115 is input to the processing circuit 112 via the selector 120.
  • the selector 122 selects either the output ( ⁇ 0, ⁇ 1, ⁇ 2) from the selector 121 or the output from the arithmetic circuit 113 and inputs it to the arithmetic circuit 116.
  • the arithmetic circuits 116 and 117 output the input value through (+) or sign inversion (-).
  • the output from the determination circuit 105 and the output from the determination circuit 106 are input to the arithmetic circuit 116.
  • the arithmetic circuit 116 performs processing according to the sign of n at the time of exponential operation or logarithmic operation, and performs processing according to the sign of q i at the time of division or square root operation.
  • the arithmetic circuit 117 performs processing according to the sign of n during exponential arithmetic or logarithmic arithmetic.
  • the arithmetic circuit 117 is not used during division or square root calculation.
  • the output selected by the selector 122 is input to the arithmetic circuit 116.
  • the arithmetic circuit 118 subtracts q i ⁇ 2 from the register value RS and outputs the result.
  • the output of the arithmetic circuit 118 is input to the CSA 108.
  • the registers 101 to 104, the determination circuit 105, the right shift circuits 110 and 111, the arithmetic circuits 113, 114, 116 and 117, the Log Table circuit 109 and the CSAs 107 and 108 process exponential arithmetic and logarithmic arithmetic.
  • a first processing unit for performing the processing for performing the processing.
  • the registers 101 to 104, the determination circuit 106, the arithmetic circuits 115, 117, 118, 119, 130, 131, the processing circuit 112, the selectors 120, 121 and the CSA 108 form a second processing unit for processing division and square root calculation.
  • the control unit 10 controls the arithmetic processing in the arithmetic processing circuit 1a.
  • the control unit 10 operates according to an instruction from the program.
  • the control unit 10 has a function as an instruction decoder, decodes the content of the instruction read in an instruction register (not shown), and controls the arithmetic processing circuit 1a.
  • the memory 11 is, for example, a RAM (Random Access Memory).
  • the memory 11 stores, for example, initial values of the registers 101 to 104.
  • the initial value is provided according to the type of arithmetic processing (exponential operation, logarithmic operation, division and square root operation).
  • the control unit 10 initializes the registers 101 to 104 at the start of the arithmetic processing in the arithmetic processing circuit 1a.
  • the control unit 10 performs initialization by reading an initial value according to the type of operation executed in the arithmetic processing circuit 1a from the memory 11 and storing it in the registers 101 to 104.
  • the control unit 10 also reads out and outputs the calculation result from the registers 101 to 104 that store the result of the calculation process.
  • the control unit 10 also selects the determination circuits 105 and 106. That is, the determination circuits 105 and 106 are selected and made to function according to the type of operation instructed to be executed.
  • the control unit 10 may control switching of the selectors 120 to 126. Further, the control unit 10 may give an instruction to start arithmetic processing in the arithmetic processing circuit 1a.
  • the control unit 10 may manage i, which indicates the number of iterations (loops) of computations in the computation processing circuit 1a.
  • the control unit 10 may count i, and compare the value of i with a preset threshold value (imax) to determine that the loop has ended.
  • FIGS. 3 to 6 show the processing of steps S1 to S9
  • FIG. 4 shows the processing of steps S10 to S17
  • FIG. 5 shows the processing of steps S18 to S25
  • FIG. 6 shows the processing of steps S26 to S34.
  • step S1 of FIG. 3 the control unit 10 confirms the calculation type. If the calculation type is exponential calculation (see EXP route in step S1), the process proceeds to step S2 in FIG.
  • step S2 the registers 101 to 104 are initialized.
  • the initialization of the register is performed by the control unit 10, for example.
  • LS + LC L 1
  • x is set in either one of LS and LC and 0 is set in the other.
  • ES + EC E 1
  • 1 is set to either ES or EC and 0 is set to the other.
  • step S3 of FIG. 3 until the i reaches a predetermined maximum value (imax) in the exponent calculation of the processing target, the loop processing for repeatedly executing the control up to step S8 is started.
  • step S4 of FIG. 3 the determination circuit 105 determines n based on L i and outputs it to the Log Table circuit 109 and the arithmetic circuits 113, 114, 116, 117.
  • step S5 of FIG. 3 the Log Table circuit 109 outputs the value of log (1 + n ⁇ 2 ⁇ -2i).
  • step S6 in FIG. 3 CSA107 performs L i calculates (the equation (1) refer).
  • step S7 of FIG. 3 the right shift circuits 110 and 111, the arithmetic circuits 113, 114, 116 and 117, and the CSA 108 implement the E i operation in the exponential operation (see the above equation (2)).
  • step S8 loop end processing corresponding to step S3 is performed.
  • i imax
  • step S9 the arithmetic processing shifts to step S9 in FIG.
  • step S9 of FIG. 3 E i is output to the processing unit in the subsequent stage (for example, another arithmetic circuit or the like), and the processing ends.
  • step S1 of FIG. 3 if the operation type is logarithmic operation (see LOG route of step S1), the process proceeds to step S10 of FIG.
  • step S10 the registers 101 to 104 are initialized.
  • the initialization of the register is performed by the control unit 10, for example.
  • step S11 of FIG. 4 until the i reaches a predetermined maximum value (imax) in the logarithmic calculation of the processing target, the loop processing for repeatedly performing the control up to step S16 is started.
  • step S12 of FIG. 4 the determination circuit 105 determines n based on E i and outputs it to the Log Table circuit 109 and the arithmetic circuits 113, 114, 116, 117.
  • step S13 of FIG. 4 the Log Table circuit 109 outputs the value of log (1 + n ⁇ 2 ⁇ -2i).
  • step S14 in FIG. 4 CSA107 performs L i calculates (the equation (1) refer).
  • step S15 of FIG. 4 the right shift circuits 110 and 111, the arithmetic circuits 113, 114, 116 and 117, and the CSA 108 realize E i arithmetic in logarithmic arithmetic (see the above equation (2)).
  • step S16 the loop end process corresponding to step S11 is performed.
  • i imax
  • step S17 the arithmetic processing shifts to step S17 in FIG.
  • step S17 of FIG. 4 L i is output to the processing unit in the subsequent stage (for example, another arithmetic circuit or the like), and the process ends.
  • step S1 of FIG. 3 if the operation type is division (see DIV route of step S1), the process proceeds to step S18 of FIG.
  • step S18 the registers 101 to 104 are initialized.
  • the initialization of the register is performed by the control unit 10, for example.
  • step S19 in FIG. 5 until the i reaches a predetermined value (imax-1) in the division of the processing target, the loop processing for repeatedly executing the control up to step S24 is started.
  • step S20 of FIG. 5 the determination circuit 106 selects q i based on R i and D and outputs it.
  • step S24 loop end processing corresponding to step S19 is performed.
  • i imax-1
  • step S25 Q i is output to the processing unit in the subsequent stage (for example, another arithmetic circuit or the like), and the process ends.
  • step S1 of FIG. 3 As a result of checking the calculation type in step S1 of FIG. 3, if the calculation type is square root calculation (see SQRT route of step S1), the process proceeds to step S26 of FIG.
  • step S26 the registers 101 to 104 are initialized.
  • the initialization of the register is performed by the control unit 10, for example.
  • step S27 of FIG. 6 until the i reaches a predetermined value (imax-1) in the division of the processing target, the loop processing for repeatedly executing the control up to step S33 is started.
  • step S28 of FIG. 6 the determination circuit 106 selects q i based on R i and Q i and outputs it.
  • step S30 of FIG. 6 the arithmetic circuit 115 and the processing circuit 112 generate 2Q i ⁇ q i . Further, in step S31 of FIG. 6, the arithmetic circuit 118 generates R i -q i ⁇ 2.
  • step S33 loop end processing corresponding to step S27 is performed.
  • i imax-1
  • step S34 Q i is output to the processing unit in the subsequent stage (for example, another arithmetic circuit or the like), and the process ends.
  • the registers 101 to 104, the arithmetic circuit 116, and the CSA 108 are shared by the exponent / logarithmic arithmetic circuit and the division / square root arithmetic circuit.
  • the exponent / logarithmic arithmetic circuit and the division / square root arithmetic circuit can be configured as one arithmetic processing circuit 1a.
  • the CSA 108 can be effectively used by using all the inputs.
  • FIG. 7 is a diagram illustrating the configuration of the arithmetic processing circuit 1b as an example of the second embodiment.
  • the arithmetic processing circuit 1b of the second embodiment includes a processing circuit 212 instead of the processing circuit 112 of the arithmetic processing circuit 1a of the first embodiment, and a selector 221 instead of the selector 121. 222 and 223 are provided.
  • the other parts are configured similarly to the arithmetic processing circuit 1a of the first embodiment.
  • the output value of the register 102 and the output value of the arithmetic circuit 115 are input to the processing circuit 212 via the selector 120. Further, the processing circuit 212 is configured to be capable of four outputs (x0, x2, x0, x1) and outputs two outputs to the selector 221 and the selector 222, respectively.
  • the processing circuit 212 generates three signals of x0, x1, and x2. At the time of division, the selector 120 outputs the register value D.
  • the processing circuit 212 and the arithmetic circuits 116 and 117 multiply D by 0 times / ⁇ 1 times / ⁇ 2 times to generate the D ⁇ q i portion of the equation (3).
  • the arithmetic circuit 115 outputs twice the register value Q (2Q), and the selector 120 outputs 2Q.
  • the processing circuit 212 and the arithmetic circuits 116 and 117 multiplying 2Q by 0 times / ⁇ 1 times / ⁇ 2 times, the 2Q i ⁇ q i portion of Expression (5) is generated.
  • the processing circuit 212 generates and outputs a fixed value 0 ( ⁇ 0), a value obtained by through-outputting the input value ( ⁇ 1), and a value obtained by shifting the input value to the left by 1 bit ( ⁇ 2).
  • Two predetermined fixed values ( ⁇ 0) are set in the processing circuit 212. Then, one of these two fixed values ( ⁇ 0) is paired with the output value ⁇ 1 (through) and is input to the selector 222. The other one of the two fixed values ( ⁇ 0) is paired with the output value of the arithmetic circuit 115 ⁇ 2 (left shift) and input to the selector 221.
  • the selector 222 receives x0 or ⁇ 1 ( ⁇ 0 / ⁇ 1) from the processing circuit 212, and the selector 221 outputs x from the processing circuit 212. 0 or ⁇ 2 ( ⁇ 0 / ⁇ 2) is input.
  • the output of the selector 120 is input to the two two-selection selectors 221 and 222 of x0 / x2 and x0 / x1. ..
  • Each of the selectors 221 and 222 selects and outputs a selection target according to the value of q i selected by the determination circuit 106.
  • the two selectors 221 and 222 respectively select and output one output value from the plurality of output values of the processing circuit 212.
  • the output from the selector 221 and the output from the selector 222 are input to the CSA 108, and the input signal line of the CSA 108 can be used fully. That is, the CSA 108 can be used efficiently.
  • q i selected by the determination circuit 106 can be reproduced by combining the output values of the selectors 221 and 222.
  • FIG. 8 is a diagram showing a selection target of each selector with respect to the q i selection result of the arithmetic processing circuit 1b as an example of the second embodiment.
  • “ ⁇ 0 / ⁇ 1 selector” indicates the selector 222
  • “ ⁇ 0 / ⁇ 2 selector” indicates the selector 221.
  • the selection target shown in FIG. 8 indicates the output that the selectors 221 and 222 should select in order to reproduce q i selected by the determination circuit 106.
  • the selector 222 selects “ ⁇ 1 (through)” and The value is output, and the selector 221 ( ⁇ 0 / ⁇ 2 selector) selects “ ⁇ 0 (fixed value)” and outputs the value.
  • the control unit 10 may store the reference information illustrated in FIG. 8 in the memory 11 in advance, and refer to the reference information to control the switching of the selectors 221 and 222.
  • the output from the selector 221 is input to the selector 223.
  • the output of the arithmetic circuit 114 is also input to the selector 223.
  • the output selected by the selector 223 is input to the arithmetic circuit 117, the sign of which is inverted in the arithmetic circuit 117, and the input to the CSA 108.
  • the selector 223 selects and outputs the input from the selector 221 when performing division or square root calculation. On the other hand, the selector 223 selects and outputs the input from the arithmetic circuit 114 when performing exponential arithmetic or logarithmic arithmetic.
  • the outputs from the arithmetic circuits 116, 117, 118 and the output of the register 104 are input to the CSA 108.
  • q i is ⁇ 3 ⁇ 2. It is possible to choose from ⁇ -2i. That is, the choices of q i can be increased.
  • the decision logic in the decision circuit 106 can be simplified, the number of logic stages in the decision circuit 106 can be reduced, and thus the delay in the decision circuit 106 can be reduced.
  • FIG. 9 is a diagram illustrating a configuration of an arithmetic processing circuit 1c as an example of the third embodiment.
  • the arithmetic processing circuit 1c of the third embodiment includes a processing circuit 312 instead of the processing circuit 212 of the arithmetic processing circuit 1b of the second embodiment shown in FIG. 7, and the selectors 221 and 222 are provided. Instead, selectors 321 and 322 are provided.
  • the other parts are configured in the same manner as the arithmetic processing circuit 1b of the second embodiment.
  • the arithmetic circuit 116 may be represented as "+ or- (A)". Further, the arithmetic circuit 117 may be represented as “+ or- (B)”.
  • the output value of the register 102 and the output value of the arithmetic circuit 115 are input to the processing circuit 312 via the selector 120.
  • the processing circuit 312 is configured to be capable of 6 outputs (x0, x4, x8, x0, x1, x2), and outputs three outputs to each of the selector 321 and the selector 322. Do.
  • x0 fixed value
  • x4 left shift
  • x8 left shift
  • x0 fixed value
  • x1 through
  • x2 left shift
  • any one of ⁇ 0, ⁇ 4 and ⁇ 8 ( ⁇ 0 / ⁇ 4 / ⁇ 8) is input to the selector 321 from the processing circuit 312, and the selector 321 receives the selector.
  • Any one of ⁇ 0, ⁇ 1 and ⁇ 2 ( ⁇ 0 / ⁇ 1 / ⁇ 2) is input to the processing unit 322 from the processing circuit 312.
  • the output of the selector 120 is input to the two three-selection selectors 321 and 322 of ⁇ 0 / ⁇ 4 / ⁇ 8 and ⁇ 0 / ⁇ 1 / ⁇ 2. Is configured.
  • Each of the selectors 321 and 322 selects and outputs a selection target according to the value of q i selected by the determination circuit 106.
  • the two selectors 321 and 322 select and output one output value from the plurality of output values set in the processing circuit 312.
  • the output from the selector 321 and the output from the selector 322 are input to the CSA 108, and the input signal line of the CSA 108 can be fully used. That is, the CSA 108 can be used efficiently.
  • each operation of ⁇ 0, ⁇ 1, ⁇ 2, ⁇ 4, ⁇ 8 can be realized without the need of a circuit. That is, the x0 operation can be realized by outputting the fixed value 0, and the x1 operation can be realized by outputting the input value through. Moreover, x2, x4, and x8 can be realized by 1-bit left shift, 2-bit left shift, and 3-bit left shift, respectively. On the other hand, the operations of ⁇ 3, ⁇ 5, ⁇ 6, ⁇ 7, ⁇ 9, and ⁇ 10 require a multiplication circuit and increase the circuit scale and delay, so it is desirable not to use them.
  • FIG. 10 is a diagram showing selection targets and symbols of each selector with respect to the q i selection result of the arithmetic processing circuit 1c as an example of the third embodiment.
  • the “ ⁇ 0 / ⁇ 1 / ⁇ 2 selector” indicates the selector 322
  • the “ ⁇ 0 / ⁇ 4 / ⁇ 8 selector” indicates the selector 321.
  • “+ or ⁇ (A)” indicates the arithmetic circuit 116
  • “+ or ⁇ (B)” indicates the arithmetic circuit 117.
  • the selection targets and codes shown in FIG. 10 represent outputs that the selectors 321 and 322 should select and codes that the arithmetic circuits 116 and 117 should set in order to reproduce q i selected by the determination circuit 106. ..
  • the selector 322 selects “ ⁇ 1 (through)”. And outputs the value, and the arithmetic circuit 116 sets the sign “+”.
  • the selector 321 selects “ ⁇ 0 (fixed value)” and outputs the value, and the arithmetic circuit 117 sets the sign “+”.
  • the control unit 10 may store reference information as illustrated in FIG. 10 in the memory 11 in advance and perform switching control of the selectors 321 and 322 with reference to this reference information.
  • the arithmetic processing circuit 1c as an example of the third embodiment, it is possible to increase the choices of q i in the division or square root calculation as compared with the arithmetic processing circuit 1b of the second embodiment.
  • the decision logic in the decision circuit 106 can be simplified, the number of logic stages in the decision circuit 106 can be reduced, and thus the delay in the decision circuit 106 can be reduced.
  • FIG. 11 is a diagram illustrating a configuration example in which the arithmetic processing circuits 1a, 1b, and 1c as an example of the above-described embodiments are mounted on a processor for a purpose such as deep learning.
  • the processor illustrated in FIG. 11 includes an instruction unit, a plurality of register files # 1 to #m, and a plurality of execution units # 1 to #m.
  • Each execution unit includes a plurality (n) of arithmetic units # 1 to #n, and these arithmetic units are provided with arithmetic processing circuits 1a, 1b, 1c.
  • the processor system illustrated in FIG. 11 has a large occupation ratio of the arithmetic units to the whole, but by applying the present arithmetic processing circuits 1a, 1b, and 1c to such arithmetic units, the circuit of the arithmetic units can be obtained. The effect of scale reduction can be achieved.
  • Arithmetic processing circuit 10 Control unit 11 Memory 101-104 Register 105, 106 Judgment circuit 107, 108 CSA 109 Log Table circuit 110, 111 Right shift circuit 112, 212, 312 Processing circuit 113-119, 130, 131 Operation circuit 120-126, 221-223, 321, 322 Selector

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)
  • General Engineering & Computer Science (AREA)
  • Complex Calculations (AREA)

Abstract

指数演算および対数演算を処理する第1の処理部と、除算および開平演算を処理する第2の処理部とを有し、第1の処理部と第2の処理部とで共用される共用部を備えるように構成することにより、指数演算および対数演算と除算および開平演算とを共通の演算回路で実現できるようにする。

Description

演算処理装置
 本発明は、演算処理装置に関する。
 情報処理装置のプロセッサには、演算を実現する演算回路(演算器)が備えられている。演算回路としては、例えば、加算を行なう加算回路や、乗算を行なう乗算回路、開平演算を行なう開平演算回路、指数演算を行なう指数演算回路、対数演算を行なう対数演算回路等が知られている。
 また、指数演算および対数演算を共通の演算回路で実現することや、除算と開平演算とを共通の演算回路で実現することも知られている。複数種類の演算を共通の演算回路で実現することで、省スペース化や製造コストの低減等を実現することができる。
特開2005-92372号公報 特開2006-172035号公報
 このようなプロセッサにおいて、更なる演算回路の小型化が求められている。
 本発明は、このような課題に鑑み創案されたもので、指数演算および対数演算と、除算および開平演算とを共通の演算回路で実現できるようにすることを目的とする。
 上記の目的を達成するために、この演算処理装置は、指数演算および対数演算を処理する第1の処理部と、除算および開平演算を処理する第2の処理部とを有し、前記第1の処理部と前記第2の処理部とで共用される共用部を備える。
 開示の演算処理装置によれば、指数演算および対数演算と、除算および開平演算とを共通の演算回路で実現することができる。
第1実施形態の一例としての演算処理回路の構成を例示する図である。 第1実施形態の一例としての演算処理回路のCSAの構成を例示する図である。 第1実施形態の一例としての演算処理回路の処理を説明するためのフローチャートである。 第1実施形態の一例としての演算処理回路の処理を説明するためのフローチャートである。 第1実施形態の一例としての演算処理回路の処理を説明するためのフローチャートである。 第1実施形態の一例としての演算処理回路の処理を説明するためのフローチャートである。 第2実施形態の一例としての演算処理回路の構成を例示する図である。 第2実施形態の一例としての演算処理回路のqi選択結果に対する各セレクタのセレクト対象を示す図である。 第3実施形態の一例としての演算処理回路の構成を例示する図である。 第3実施形態の一例としての演算処理回路のqi選択結果に対する各セレクタのセレクト対象および符号を示す図である。 各実施形態の一例としての演算処理回路をディープラーニング等の用途のプロセッサに実装する構成例を示す図である。
 以下、図面を参照して本演算処理装置にかかる実施の形態を説明する。ただし、以下に示す実施形態はあくまでも例示に過ぎず、実施形態で明示しない種々の変形例や技術の適用を排除する意図はない。すなわち、本実施形態を、その趣旨を逸脱しない範囲で種々変形(実施形態および各変形例を組み合わせる等)して実施することができる。また、各図は、図中に示す構成要素のみを備えるという趣旨ではなく、他の機能等を含むことができる。
 (I)第1実施形態の説明
 図1は第1実施形態の一例としての演算処理回路1aの構成を例示する図である。
 演算処理回路(演算器)1aは、例えば情報処理装置のプロセッサ(演算処理装置)に備えられ、演算を実現する。図1に示す演算処理回路1aは、指数(EXP)演算、対数(LOG)演算、除算(DIV)演算および開平(SQRT)演算の4種類の演算を実現する演算処理回路である。すなわち、本演算処理回路1aは、指数演算、対数演算、除算演算および開平演算のいずれかを選択的に実現する。
[指数演算]
 演算処理回路1aにおいては、指数演算にradix-4のSTL(Sequential Table Lookup)法(第1のアルゴリズム)を用いる。
 指数演算において、xを入力とし、exp(x)を求める。
 Lはべき数の空間の変数であり、Eは指数の空間の変数である。また、iは演算の繰り返し回数である。
 初期値をL1 = x,E1 = exp(0) = 1とし、x = log(Ei) + Liを満たしつつ、演算を繰り返してLiを少しずつ0に近づけることで、Eiがexp(x)に近づく(Li=x→0、Ei =exp(0)→exp(x))。
 Liの算出(Li演算)には、以下の式(1)を用いる。
  Li+1= Li - log(1 + n × 2^-2i)   ・・・(1)
 また、Eiの算出(Ei演算)には、以下の式(2)を用いる。
  Ei+1= Ei × (1 + n × 2^-2i)
        = Ei + Ei × n × 2^-2i  ・・・(2)
 ただし、n = -2, -1, 0, +1, +2であり、Liと0との大小関係および差分を判定し、Liが0に一番近づくようにnを選ぶ。
[対数演算]
 本演算処理回路1aにおいては、対数演算にradix-4のSTL法を用いる。
 対数演算において、xを入力とし、log(x)を求める。
 Lは対数の空間の変数であり、Eは真数の空間の変数である。またiは繰り返し演算の回数である。
 初期値をL1 = log(1) = 0,E1 = xとし、x = Ei× exp(Li)を満たしつつ、演算を繰り返してEiを少しずつ1に近づけることで、Liがlog(x)に近づく(Ei =x→1、Li =log(1)→log(x))。
 対数演算におけるLiおよびEiの演算方法(Li演算,Ei演算)は概ね指数演算と同様であるが、nの選び方は異なる。すなわち、Eiと1との大小関係および差分を判定し、Eiが1に一番近づくようにnを選ぶ。
 上述の如く、本演算処理回路1aにおいては、指数演算および対数演算にSTL(Sequential Table Lookup)法(第1のアルゴリズム)を用いる。
[除算]
 本演算処理回路1aにおいては、除算に、演算1回で商2bitを求めるradix-4のSRT(Sweeney, Robertson, Tocher)法(第2のアルゴリズム)を用いる。
 除算において、x,yを入力とし、y/xを求める。
 Qは部分商(繰り返し演算中の途中までの商)であり、Dは除数である。Rは部分剰余であり、iは演算の繰り返し回数である。
 初期値をQ0= 0,R0 = y,D = x(Dは変化しない)とし、y = Qi× D + Ri を満たしつつ、演算を繰り返してRiを0に近づけることで、Qiがy/xに近づく(Ri=y→0、Qi×D=0→yつまりQ=0→y/x)。
 Riの算出(Ri演算)には以下の式(3)を用いる。
  Ri+1= Ri - D × qi  ・・・(3)
ただし、qi= (-2 or -1 or 0 or +1 or +2) × 2^-2iとする。
 また、Qiの算出(Qi演算)には以下の式(4)を用いる。
  Qi+1 = Qi + qi    ・・・(4)
 Riと0との大小関係および差分を判定し、Riが0に一番近づくようにqiを選ぶ。
 Rはsum+carryの形式で保持する。後述するレジスタ103のレジスタ値RSとレジスタ104のレジスタ値RCとが、sumとcarryとに相当する。
[開平演算]
 本演算処理回路1aにおいては、開平演算に、radix-4のSRT法(第2のアルゴリズム)を用いる。
 開平演算において、yを入力とし、sqrt(y)を求める。
 Qは部分商であり、Rは部分剰余であり、iは演算の繰り返し回数である。
 初期値をQ0= 0,R0 = yとし、y = Qi^2 + Riを満たしつつ、演算を繰り返してRiを0に近づけることで、Qiがsqrt(y)に近づく(Ri=y→0、Qi^2=0→yつまりQ=0→sqrt(y))。
 Riの算出(Ri演算)には以下の式(5)を用いる。
  Ri+1 = Ri-2Qi × qi-qi^2   ・・・(5)
ただしqi=(-2 or -1 or 0 or +1 or +2)×2^-2iとする。
 Qiの算出(Qi演算)には以下の式(6)を用いる。
  Qi+1= Qi+qi   ・・・(6)
 このように、開平演算においてRiおよびQiの演算方法は除算演算と概ね同様であるが、厳密にはRiの演算において相違がある。
 Riと0との大小関係および差分を判定し、Riが0に一番近づくようにqiを選ぶ。
 (A)構成
 本第1実施形態の演算処理回路1aは、図1に示すように、レジスタ101~104,判定回路105,106,CSA(Carry-Save Adder:桁上げ保存加算器)107,108,Log Table回路109,右シフト回路(RSFT)110,111,処理回路112,演算回路113~119,130,131およびセレクタ120~126を備える。
 以下、レジスタ101をレジスタLS/Qと表す場合がある。同様に、レジスタ102をレジスタLC/Dと表す場合があり、レジスタ103をレジスタES/RSと表す場合があり、レジスタ104をレジスタEC/RCと表す場合がある。
 レジスタ101は、判定回路105,106,演算回路115,119およびCSA107にそれぞれ接続されている。
 本演算処理回路1aが指数演算または対数演算を行なう場合には、このレジスタ101に後述するCSA107によるLi演算の結果(sum)がセレクタ124を介して格納される。
 また、本演算処理回路1aが指数演算または対数演算を行なう場合には、レジスタ101から読み出されたレジスタ値Liは、判定回路105およびCSA107にそれぞれ入力される。
 一方、本演算処理回路1aが除算または開平演算を行なう場合には、後述する演算回路119による(Q+q)の演算結果Qがセレクタ124により選択され、レジスタ101に格納される。
 本演算処理回路1aが除算または開平演算を行なう場合には、レジスタ101から読み出されたレジスタ値Qは判定回路106および演算回路115,119にそれぞれ入力される。
 レジスタ102は、判定回路105,106およびCSA107にそれぞれ接続されている。また、レジスタ102はセレクタ120を介して処理回路112にも接続されている。さらに、レジスタ102の出力はセレクタ123にも入力される。
 本演算処理回路1aが指数演算または対数演算を行なう場合には、レジスタ102にCSA107によるLi演算の結果(carry)がセレクタ123を介して格納される。
 また、本演算処理回路1aが指数演算または対数演算を行なう場合には、レジスタ102から読み出されたレジスタ値Liは、判定回路105およびCSA107にそれぞれ入力される。
 一方、本演算処理回路1aが除算を行なう場合には、レジスタ値Dがセレクタ123により選択され、レジスタ102に格納される。本演算処理回路1aが開平演算を行なう場合には、レジスタ102は使用しない。
 本演算処理回路1aが除算を行なう場合には、レジスタ102から読み出されたレジスタ値Dは、判定回路106に入力される。また、レジスタ102から読み出されたレジスタ値Dはセレクタ120を介して処理回路112にも入力される。
 本演算処理回路1aが指数演算または対数演算を行なう場合には、Log Table回路109およびCSA107が、指数演算または対数演算におけるLi演算を実現する。右シフト回路110,111,演算回路113,114,116,117およびCSA108が、指数演算または対数演算におけるEi演算を実現する。
 一方、本演算処理回路1aが除算を行なう場合には、処理回路112,演算回路116,117,130,131およびCSA108が、Ri演算を実現する。また、本演算処理回路1aが開平演算を行なう場合には、処理回路112,演算回路116~118,130,131およびCSA108が、Ri演算を実現する。ただし、上記式(3),(5)ではqiの桁がサイクルごとに2bitずつ小さくなるところを、式(3),(5)の両辺をサイクルごとに4倍することでqiの桁が一定になるようにする。また、除算および開平演算におけるQi演算は演算回路119によって実現される。
 判定回路105は、指数演算または対数演算に用いられる。判定回路105は、指数演算を行なう場合には、Liに基づき、nを選択する。例えば、判定回路105は、Liと0との大小関係および差分を判定し、Liが0に一番近づくnの値を選択する。また、対数演算を行なう場合には、判定回路105は、Eiと1との大小関係および差分を判定し、Eiが1に一番近づくnの値を選択する。なお、この判定回路105による処理は既知の手法を用いて実現してもよく、その詳細な説明は省略する。
 判定回路105によって決定されたnの値は、演算回路113,114,116,117およびLog Table回路109に入力される。
 Log Table回路109およびCSA107は、Liの演算を実施する。
 Log Table回路109は、指数演算または対数演算に用いられる。Log Table回路109は、log(1+n*2^-2i)を出力する。Log Table回路109には、予め変数i, nに対応するlog(1+n*2^-2i)の値が設定されており、判定回路105に入力されるnとiに応じたlog(1+n*2^-2i)の値を出力する。
 CSA107は、3入力-2出力(3 in - 2 out)の桁上げ保存加算器(全加算器)であり、レジスタ101,102およびLog Table回路109から各出力が入力される。また、このCSA107の出力(演算結果)のうち、部分和ビットの列は、セレクタ124に出力され、このセレクタ124を介してレジスタ101に入力される。一方、CSA107の出力(演算結果)のうち、桁上げビットの列は、セレクタ123に出力され、このセレクタ123を介してレジスタ102に入力される。
 CSA107は、指数演算または対数演算に用いられる。CSA107は、Li+1の演算を行なう。CSA107は、Log Table回路109から出力されたlog(1+n*2^-2i)の値を用いて、上記式(1)に基づきLiを算出する。
 CSA107により算出されたLi+1の値は、セレクタ124に入力される。
 判定回路106は、除算または開平演算に用いられる。判定回路106は、除算時はRiとDとに基づいてqiを選択し、開平演算時はRiとQiとに基づいてqiを選択する。具体的には、判定回路106は、Riと0との大小関係及び差分とDもしくはQiを判定し、Riが0に一番近づくようにqiを選択する。上記式(3),(5)に示すように、qi = (-2 or -1 or 0 or +1 or +2) × 2^-2iであり、radix-4であるので、判定回路106は2bitずつqiを選択する。
 演算回路119は、除算または開平演算に用いられる。演算回路119は、上記式(4),(6)に基づきQi演算を行なう。すなわち、演算回路119は、Qi+1 = Qi + qiを算出する。Qとqとは有効bitがほぼ重複しないので、演算回路119は簡易的な加算回路として構成されてよい。
 演算回路115は開平演算に用いられる。演算回路115は、入力された値を2倍して出力する2倍回路である。演算回路115は、レジスタ101から読み出されたレジスタ値Qiに対して2倍(×2)演算を行なう。なお、演算回路115は、入力されたレジスタ値をbit左シフトすることで2倍を実現する。この演算回路115による演算結果はセレクタ120を介して処理回路112に入力される。セレクタ120は開平演算時に演算回路115の出力を選択して出力する。また、セレクタ120は除算時にレジスタ102のレジスタ値Dを選択して出力する。
 レジスタ103は、判定回路105,106,右シフト回路110および演算回路118にそれぞれ接続されている。
 本演算処理回路1aが指数演算または対数演算を行なう場合には、このレジスタ103に後述するセレクタ125,126が出力するEi演算の結果(sum)が格納される。
 また、本演算処理回路1aが指数演算または対数演算を行なう場合には、レジスタ103から読み出されたレジスタ値Eiは、判定回路105および右シフト回路110にそれぞれ入力される。
 一方、本演算処理回路1aが除算または開平演算を行なう場合には、レジスタ103にセレクタ125,126が出力するRi演算の結果(sum)が格納される。
 本演算処理回路1aが除算または開平演算を行なう場合には、レジスタ103から読み出されたレジスタ値Riは、判定回路106および演算回路118にそれぞれ入力される。
 レジスタ104は、判定回路105,106,右シフト回路111およびCSA108にそれぞれ接続されている。
 本演算処理回路1aが指数演算または対数演算を行なう場合には、このレジスタ104にセレクタ125,126が出力するEi演算の結果(carry)が格納される。
 また、本演算処理回路1aが指数演算または対数演算を行なう場合には、レジスタ104から読み出されたレジスタ値Eiは、判定回路105および右シフト回路111にそれぞれ入力される。また、レジスタ104から読み出されたレジスタ値EiはCSA108にも入力される。
 一方、本演算処理回路1aが除算または開平演算を行なう場合には、レジスタ104にセレクタ125,126が出力するRi演算の結果(carry)が格納される。
 本演算処理回路1aが除算または開平演算を行なう場合には、レジスタ104から読み出されたレジスタ値Riは、判定回路106およびCSA108にそれぞれ入力される。
 CSA108は、4入力-2出力(4 in - 2 out)の桁上げ保存加算器(全加算器)であり、演算回路116,117,118およびレジスタ104からの各出力が入力される。また、このCSA108の出力(演算結果)のうち部分和ビットの列は、演算回路130およびセレクタ125に入力される。一方、CSA108の出力(演算結果)のうち桁上げビットの列は演算回路131およびセレクタ126に入力される。
 図2は第1実施形態の一例としての演算処理回路1aのCSA108の構成を例示する図である。
 CSA108は、2つの3入力-2出力(3 in -2 out)の全加算器を組み合わせた多段構成を有する。すなわち、一つの3入力-2出力の桁上げ保存加算器の出力(S,C)を、他の3入力-2出力の桁上げ保存加算器の入力とすることで、CSA108は4入力を実現している。
 また、このCSA108の出力(演算結果)のうち、部分和ビットの列は、演算回路130やセレクタ125を介してレジスタ103に入力される。一方、CSA108の出力(演算結果)のうち、桁上げビットの列は、演算回路131やセレクタ126を介してレジスタ104に入力される。
 演算回路130,131は、それぞれ入力された値に対して4倍演算(×4)演算を行なう。4倍演算は、入力された値を2bit左シフトすることで実現する。セレクタ125,126は、それぞれ本演算処理回路1aが指数演算または対数演算を行なう場合には、CSA108の出力を選択して出力する。一方、演算処理回路1aが除算または開平演算を行なう場合には、セレクタ125は演算回路130の出力を、また、セレクタ126は演算回路131の出力を、それぞれ選択して出力する。演算回路130,131によりqiの2^-2iの部分の辻褄合わせが行なわれる。
 処理回路112は、×0,×1,×2の3信号を生成する。除算時には、セレクタ120はレジスタ値Dを出力する。処理回路112と演算回路116とがDを0倍/±1倍/±2倍することにより、式(3)のD×qiの演算が実現される。
 一方、開平演算時には、演算回路115がレジスタ値Qの2倍(2Q)を出力し、セレクタ120が2Qを出力する。処理回路112と演算回路116とが2Qを0倍/±1倍/±2倍することにより、式(5)の2Qi×qiの部分が生成される。
 演算回路115は、レジスタ101の出力Qに対して、1bit左シフトすることで2倍算を実現する。演算回路115の出力はセレクタ120に入力される。
 セレクタ120にはレジスタ102の出力Dと演算回路115の出力とが入力される。除算を行なう場合には、セレクタ120はレジスタ102の出力Dを選択し、処理回路112に出力する。開平演算を行なう場合には、セレクタ120は演算回路115の出力を選択し、処理回路112に出力する。
 処理回路112は、固定値0(×0)と、入力値をスルー出力した値(×1)、入力値を1bit左シフトした値(×2)を生成し出力する。
 これにより、処理回路112は、×0,×1および×2の各値を出力可能に構成されている。処理回路112に設定されるこれらの値は、判定回路106により選択される選択肢に相当する。
 セレクタ121は、処理回路112から出力される×0,×1および×2のいずれかの出力値を選択してセレクタ122に出力する。セレクタ121は、処理回路112が出力する複数種類の選択肢(×0,×1,×2)の中から、判定回路106によって決定されたqiに対応する出力値を選択して出力する。
 なお、判定回路106により決定されたqiが負値である場合には、セレクタ121はqiの絶対値に相当する選択肢を選択する。なお、qiが負値である場合には、セレクタ121の出力値(正値)に対して演算回路116が符号反転を行なうことで負値にする。
 右シフト回路110,111は、それぞれレジスタ値ES,ECを2i bit右シフトすることで、式(2)のEi×2^-2iの部分を生成する。
 すなわち、右シフト回路110は、本演算処理回路1aが指数演算または対数演算を行なう場合に、レジスタ103のレジスタ出力ESに対して、2iビットの右シフト演算を行なうことで2^-2i倍算を実現する。右シフト回路110の出力は演算回路113に入力される。
 右シフト回路111は、本演算処理回路1aが指数演算または対数演算を行なう場合に、レジスタ104のレジスタ出力ECに対して、2iビットの右シフト演算を行なうことで2^-2i倍算を実現する。右シフト回路111の出力は演算回路114に入力される。
 なお、右シフト回路110,111の後段において演算回路113,116によりEi×n×2^-2iが生成される。
 演算回路113,114は、本演算処理回路1aが指数演算または対数演算を行なう場合に、入力された値に対して、1倍(×1)演算または2倍(×2)演算を行なう。なお、演算回路113,114は、入力された値をスルーすることで1倍(×1)演算を実現する。また、演算回路113,114は、入力されたレジスタ値を1bit左シフトすることで2倍演算を実現する。この演算回路115による演算結果はセレクタ120を介して処理回路112に入力される。
 セレクタ122は、セレクタ121からの出力(×0,×1,×2)と演算回路113からの出力とのいずれかを選択して、演算回路116に入力する。
 演算回路116,117は、入力された値をスルー(+)または符号反転(-)して出力する。演算回路116には、判定回路105からの出力と、判定回路106からの出力が入力される。演算回路116は、指数演算時または対数演算時はnの符号に応じた処理を行ない、除算または開平演算時はqiの符号に応じた処理を行なう。
 演算回路117は、指数演算時または対数演算時はnの符号に応じた処理を行なう。なお、除算時または開平演算時は演算回路117は使用されない。演算回路116には、セレクタ122によって選択された出力が入力される。
 演算回路118は、レジスタ値RSからqi^2を減算し、結果を出力する。演算回路118の出力はCSA108に入力される。
 本演算処理回路1aにおいて、レジスタ101~104,判定回路105,右シフト回路110,111,演算回路113,114,116,117,Log Table回路109およびCSA107,108が、指数演算および対数演算を処理する第1の処理部を構成する。
 また、レジスタ101~104,判定回路106,演算回路115,117,118,119,130,131,処理回路112,セレクタ120,121およびCSA108が、除算および開平演算を処理する第2の処理部を構成する。
 制御ユニット10は本演算処理回路1aにおける演算処理を制御する。制御ユニット10はプログラムからの指示で動作する。
 制御ユニット10は、命令デコーダとしての機能を備え、図示しない命令レジスタに読み込まれた命令の内容を解読し、本演算処理回路1aを制御する。
 メモリ11は、例えばRAM(Random Access Memory)である。メモリ11には、例えば、各レジスタ101~104の初期値が格納されている。初期値は演算処理の種類(指数演算,対数演算,除算および開平演算)に応じて、それぞれ備えられている。
 制御ユニット10は、本演算処理回路1aにおける演算処理の開始時に、各レジスタ101~104の初期化を行なう。制御ユニット10は本演算処理回路1aにおいて実行する演算種類に応じた初期値をメモリ11から読み出し、各レジスタ101~104に格納することで初期化を行なう。
 また、制御ユニット10は、演算処理の結果を格納するレジスタ101~104から演算結果を読み出し、出力させる。
 制御ユニット10は、判定回路105,106の選択も行なう。すなわち、実行を指示された演算種類に応じて、判定回路105,106を選択し、機能させる。
 制御ユニット10は、各セレクタ120~126の切り替え制御を行なってもよい。また、制御ユニット10は、本演算処理回路1aにおける演算処理の開始指示を行なってもよい。
 制御ユニット10は、本演算処理回路1aにおける演算の繰り返し(ループ)回数を示すiを管理してもよい。制御ユニット10は、iのカウントを行ない、このiの値と予め設定された閾値(imax)とを比較することでループが終わったという判断を行なってもよい。
 (B)動作
 上述の如く構成された第1実施形態の一例としての演算処理回路1aの処理を、図3~図6に示すフローチャート(ステップS1~S34)に従って説明する。なお、図3はステップS1~ステップS9の処理を、図4はステップS10~S17の処理を、図5はステップS18~S25の処理を、図6はステップS26~S34の処理を、それぞれ示す。
 演算処理の開始に際して、x,yが入力される。図3のステップS1において、制御ユニット10は演算種類の確認を行なう。演算種類が指数演算である場合には(ステップS1のEXPルート参照)、図3のステップS2に移行する。
 ステップS2において、レジスタ101~104の初期化が行なわれる。レジスタの初期化は、例えば、制御ユニット10によって行なわれる。例えば、レジスタ101~104に対して、L1=x,E1=1となるように初期化が行なわれる。なお、LS + LC = L1であり、例えば、LSとLCとのいずれか一方にxを設定し、他方に0を設定する。同様に、ES + EC =E1であり、ESとECとのいずれか一方に1を設定し、他方に0を設定する。
 図3のステップS3では、処理対象の指数演算においてiが予め規定された最大値(imax)に到達するまで、ステップS8までの制御を繰り返し実施するループ処理を開始する。
 図3のステップS4では、判定回路105が、Liに基づきnを決定しLog Table回路109および演算回路113,114,116,117に出力する。
 図3のステップS5において、Log Table回路109が、log(1+n×2^-2i)の値を出力する。図3のステップS6において、CSA107は、Li演算(上記式(1)参照)を行なう。
 また、図3のステップS7において、右シフト回路110,111,演算回路113,114,116,117およびCSA108が、指数演算におけるEi演算(上記式(2)参照)を実現する。
 その後、制御が図3のステップS8に進む。ステップS8では、ステップS3に対応するループ端処理が実施される。ここで、iがimaxに到達すると(i = imax)、図3のステップS9に演算処理が移行する。
 図3のステップS9において、Eiは後段の処理部(例えば、他の演算回路等)に出力され、処理を終了する。
 一方、図3のステップS1における演算種類の確認の結果、演算種類が対数演算である場合には(ステップS1のLOGルート参照)、図4のステップS10に移行する。
 ステップS10において、レジスタ101~104の初期化が行なわれる。レジスタの初期化は、例えば、制御ユニット10によって行なわれる。例えば、レジスタ101~104に対して、L1=0,E1=xとなるように初期化が行なわれる。
 図4のステップS11では、処理対象の対数演算においてiが予め規定された最大値(imax)に到達するまで、ステップS16までの制御を繰り返し実施するループ処理を開始する。
 図4のステップS12では、判定回路105が、Eiに基づきnを決定しLog Table回路109および演算回路113,114,116,117に出力する。
 図4のステップS13において、Log Table回路109が、log(1+n×2^-2i)の値を出力する。図4のステップS14において、CSA107は、Li演算(上記式(1)参照)を行なう。
 また、図4のステップS15において、右シフト回路110,111,演算回路113,114,116,117およびCSA108が、対数演算におけるEi演算(上記式(2)参照)を実現する。
 その後、制御が図4のステップS16に進む。ステップS16では、ステップS11に対応するループ端処理が実施される。ここで、iがimaxに到達すると(i = imax)、図4のステップS17に演算処理が移行する。
 図4のステップS17において、Liは後段の処理部(例えば、他の演算回路等)に出力され、処理を終了する。
 一方、図3のステップS1における演算種類の確認の結果、演算種類が除算である場合には(ステップS1のDIVルート参照)、図5のステップS18に移行する。
 ステップS18において、レジスタ101~104の初期化が行なわれる。レジスタの初期化は、例えば、制御ユニット10によって行なわれる。例えば、レジスタ101~104に対して、Q0=0,R0=y,D=xとなるように初期化が行なわれる。なお、RS + RC = R0である。
 図5のステップS19では、処理対象の除算においてiが予め規定された値(imax-1)に到達するまで、ステップS24までの制御を繰り返し実施するループ処理を開始する。
 図5のステップS20では、判定回路106が、RiおよびDに基づきqiを選択し出力する。図5のステップS21において、演算回路119が、Qi+1 = Q+ qiを演算し出力する。
 図5のステップS22において、処理回路112および演算回路116がD × qiを生成し出力する。また、図5のステップS23において、CSA108がRi+1= Ri -D × qiを算出する。
 その後、制御が図5のステップS24に進む。ステップS24では、ステップS19に対応するループ端処理が実施される。ここで、iがimax-1に到達すると(i = imax-1)、図5のステップS25に演算処理が移行する。
 ステップS25において、Qiは後段の処理部(例えば、他の演算回路等)に出力され、処理を終了する。
 図3のステップS1における演算種類の確認の結果、演算種類が開平演算である場合には(ステップS1のSQRTルート参照)、図6のステップS26に移行する。
 ステップS26において、レジスタ101~104の初期化が行なわれる。レジスタの初期化は、例えば、制御ユニット10によって行なわれる。例えば、レジスタ101~104に対して、Q0=0,R0=yとなるように初期化が行なわれる。
 図6のステップS27では、処理対象の除算においてiが予め規定された値(imax-1)に到達するまで、ステップS33までの制御を繰り返し実施するループ処理を開始する。
 図6のステップS28では、判定回路106が、RiおよびQiに基づきqiを選択し出力する。図6のステップS29において、演算回路119が、Qi+1 = Qi + qiを演算し出力する。
 図6のステップS30において、演算回路115および処理回路112が2Qi × qiを生成する。また、図6のステップS31において、演算回路118がRi - qi ^2を生成する。
 図6のステップS32において、CSA108が、上記式(5)に基づき、Ri+1 = Ri-2Qi × qi-qi^2を算出する。
 その後、制御が図6のステップS33に進む。ステップS33では、ステップS27に対応するループ端処理が実施される。ここで、iがimax-1に到達すると(i = imax-1)、図6のステップS34に演算処理が移行する。
 ステップS34において、Qiは後段の処理部(例えば、他の演算回路等)に出力され、処理を終了する。
(C)効果
 このように、第1実施形態の一例としての演算処理回路1aによれば、レジスタ101~104,演算回路116およびCSA108を、指数・対数演算回路と除算・開平演算回路とで共用することで、指数・対数演算回路と除算・開平演算回路とを一つの演算処理回路1aとして構成することができる。
 これにより、回路規模を削減し、回路サイズの小型化および製造コストの削減を実現することができる。
 (II)第2実施形態の説明
 図1に例示した第1実施形態の演算処理回路1aにおいては、4in-2outのCSA108を用いているが、除算および開平演算において、このCSA108の入力が1つ未使用となっている。
 本第2実施形態においては、CSA108の入力を全て使用することで有効に利用することができる。
 図7は第2実施形態の一例としての演算処理回路1bの構成を例示する図である。
 この図7に示すように、第2実施形態の演算処理回路1bは、第1実施形態の演算処理回路1aの処理回路112に代えて処理回路212を備えるとともに、セレクタ121に代えてセレクタ221,222,223を備える。そして、その他の部分は第1実施形態の演算処理回路1aと同様に構成されている。
 なお、図中、既述の符号と同一の符号は同様の部分を示しているので、その説明は省略する。また、図7においては、便宜上、制御ユニット10およびメモリ11の図示を省略している。
 処理回路212には、レジスタ102の出力値と、演算回路115からの出力値とがセレクタ120を介して入力される。また、処理回路212は4つの出力(×0,×2,×0,×1)を可能に構成されており、セレクタ221およびセレクタ222に対して、それぞれ2つの出力を行なう。
 処理回路212は、×0,×1,×2の3信号を生成する。除算時には、セレクタ120はレジスタ値Dを出力する。処理回路212と演算回路116,117とがDを0倍/±1倍/±2倍することにより、式(3)のD×qiの部分が生成される。
 一方、開平演算時には、演算回路115がレジスタ値Qの2倍(2Q)を出力し、セレクタ120が2Qを出力する。処理回路212と演算回路116,117とが2Qを0倍/±1倍/±2倍することにより、式(5)の2Qi×qiの部分が生成される。
 処理回路212は、固定値0(×0)と、入力値をスルー出力した値(×1)、入力値を1bit左シフトした値(×2)を生成し出力する。
 処理回路212に設定されるこれらの値は、判定回路106により選択される選択肢に相当する。
 処理回路212には予め規定された固定値(×0)が2つ設定されている。そして、これらの2つの固定値(×0)のうち一つは、出力値×1(スルー)とペアを成してセレクタ222に入力される。また、2つの固定値(×0)のうち他の一つは、演算回路115からの出力値×2(左シフト)とペアを成してセレクタ221に入力される。
 すなわち、本第2実施形態の演算処理回路1bにおいては、セレクタ222には、処理回路212から×0または×1(×0/×1)が入力され、セレクタ221には、処理回路212から×0または×2(×0/×2)が入力される。
 このように、本第2実施形態においては、セレクタ120の出力が、×0/×2と、×0/×1との2つの2択セレクタ221,222に入力されるように構成されている。
 各セレクタ221,222は、判定回路106によって選択されたqiの値に応じてセレクト対象を選択して出力する。
 本第2実施形態の演算処理回路1bにおいては、処理回路212の複数の出力値の中から、2つのセレクタ221,222がそれぞれ1つの出力値を選択して出力する。これにより、CSA108には、セレクタ221からの出力と、セレクタ222からの出力が入力され、CSA108の入力信号線を余さず使用することができる。すなわち、CSA108を効率的に使用することができる。
 なお、セレクタ221,222の各出力値を組み合わせることで、判定回路106により選択されたqiを再現することができる。
 図8は第2実施形態の一例としての演算処理回路1bのqi選択結果に対する各セレクタのセレクト対象を示す図である。なお、この図8において、“×0/×1セレクタ”はセレクタ222を示し、“×0/×2セレクタ”はセレクタ221を示す。
 この図8に示すセレクト対象は、判定回路106によって選択されたqiを再現するためにセレクタ221,222が選択すべき出力を示している。
 例えば、判定回路106によって選択されたqiが“-1×2^-2i”である場合には、セレクタ222(×0/×1セレクタ)は“×1(スルー)”を選択してその値を出力させ、セレクタ221(×0/×2セレクタ)は“×0(固定値)”を選択してその値を出力させる。
 制御ユニット10は、この図8に例示するような参照情報を予めメモリ11に記憶しておき、この参照情報を参照してセレクタ221,222の切り替え制御を行なってもよい。
 セレクタ221からの出力はセレクタ223に入力される。また、セレクタ223には、演算回路114の出力も入力される。セレクタ223によって選択された出力は演算回路117に入力され、この演算回路117において符号反転された後、CSA108に入力される。
 セレクタ223は、除算または開平演算を行なう場合にはセレクタ221からの入力を選択して出力させる。一方、セレクタ223は、指数演算または対数演算を行なう場合には演算回路114からの入力を選択して出力させる。
 CSA108には、演算回路116,117,118からの各出力およびレジスタ104の出力が入力される。
 本発明の第2実施形態としての演算処理回路1bによれば、上述した第1実施形態と同様の作用効果を得ることができる他、除算または開平演算を行なうに際して、qiを±3×2^-2iの中から選ぶことが可能となる。すなわち、qiの選択肢を増やすことができる。
 また、 qiの選択肢を増やすことにより、判定回路106における判定論理の簡略化が可能となり、判定回路106の論理段数を減らすことができ、これにより判定回路106におけるディレイを削減することができる。
 (III)第3実施形態の説明
 図9は第3実施形態の一例としての演算処理回路1cの構成を例示する図である。
 この図9示すように、第3実施形態の演算処理回路1cは、図7に示した第2実施形態の演算処理回路1bの処理回路212に代えて処理回路312を備えるとともに、セレクタ221,222に代えてセレクタ321,322を備える。そして、その他の部分は第2実施形態の演算処理回路1bと同様に構成されている。
 なお、図中、既述の符号と同一の符号は同様の部分を示しているので、その説明は省略する。また、図9においては、便宜上、制御ユニット10およびメモリ11の図示を省略している。
 また、本第3実施形態の演算処理回路1cにおいて、演算回路116を“+or-(A)”と表すことがある。また、演算回路117を“+or-(B)”と表すことがある。
 処理回路312には、レジスタ102の出力値と、演算回路115からの出力値とがセレクタ120を介して入力される。
 また、処理回路312は、6つの出力(×0,×4,×8,×0,×1,×2)を可能に構成されており、セレクタ321およびセレクタ322に対して、それぞれ3つの出力を行なう。
 すなわち、処理回路312において、6つの出力のうち、×0(固定値),×4(左シフト)および×8(左シフト)が、セレクタ321に入力される。また、6つの出力のうち、×0(固定値),×1(スルー)および×2(左シフト)が、セレクタ322に入力される。
 すなわち、本第3実施形態の演算処理回路1cにおいては、セレクタ321には、処理回路312から×0,×4および×8(×0/×4/×8)のいずれかが入力され、セレクタ322には、処理回路312から×0,×1および×2(×0/×1/×2)のいずれかが入力される。
 このように、本第3実施形態においては、セレクタ120の出力が、×0/×4/×8と、×0/×1/×2との2つの3択セレクタ321,322に入力されるように構成されている。
 これにより、qi=(-10 or -9 or -8 or -7 or -6 or -5 or -4 or -3 or -2 or -1 or 0 or +1 or +2 or +3 or +4 or +5 or +6 or +7 or +8 or +9 or +10 )×2^-2iとなる。
 各セレクタ321,322は、判定回路106によって選択されたqiの値に応じてセレクト対象を選択して出力する。
 本第3実施形態の演算処理回路1cにおいては、処理回路312に設定された複数の出力値の中から、2つのセレクタ321,322がそれぞれ1つの出力値を選択して出力する。これにより、CSA108には、セレクタ321からの出力と、セレクタ322からの出力が入力され、CSA108の入力信号線を余さず使用することができる。すなわち、CSA108を効率的に使用することができる。
 なお、×0,×1,×2,×4,×8の各演算は実質的には回路不要で実現できる。すなわち、×0演算は固定値0を出力することで実現可能であり、×1演算は入力値をスルー出力することで実現可能である。また、×2,×4,×8は、1bit左シフト,2bit左シフト,3bit左シフトでそれぞれ実現可能である。これに対して、×3,×5,×6,×7,×9, ×10の各演算は乗算回路が必要となり回路規模およびディレイが増大するため、使用しないことが望ましい。
 図10は第3実施形態の一例としての演算処理回路1cのqi選択結果に対する各セレクタのセレクト対象および符号を示す図である。なお、この図10において、“×0/×1/×2セレクタ”はセレクタ322を示し、“×0/×4/×8セレクタ”はセレクタ321を示す。また、“+or-(A)”は演算回路116を示し、“+or-(B)”は演算回路117を示す。
 この図10に示すセレクト対象および符号は、判定回路106によって選択されたqiを再現するために、セレクタ321,322が選択すべき出力および演算回路116,117が設定すべき符号を示している。
 例えば、判定回路106によって選択されたqiが“+1×2^-2i”である場合には、セレクタ322(×0/×1/×2セレクタ)は“×1(スルー)”を選択してその値を出力させ、演算回路116において符号“+”を設定させる。また、セレクタ321(×0/×4/×8セレクタ)は“×0(固定値)”を選択してその値を出力させ、演算回路117において符号“+”を設定させる。
 制御ユニット10は、この図10に例示するような参照情報を予めメモリ11に記憶しておき、この参照情報を参照してセレクタ321,322の切り替え制御を行なってもよい。
 このように、第3実施形態の一例としての演算処理回路1cによれば、除算または開平演算において、第2実施形態の演算処理回路1bに比べてqiの選択肢を増やすことができる。qiの選択肢が増えることで、判定回路106における判定論理の簡略化が可能となり、判定回路106の論理段数を減らすことができ、これにより判定回路106におけるディレイを削減することができる。
 また、繰り返し演算1回毎に求めるbit数を増加させる高radix化を実現することができる。
 (IV)その他
 図11は上述した各実施形態の一例としての演算処理回路1a,1b,1cを、例えば、ディープラーニング等の用途のプロセッサに実装する構成例を示す図である。
 図11に例示するプロセッサは、命令ユニットと、複数のレジスタファイル#1~#mと、複数の実行ユニット#1~#mを備える。
 各実行ユニットは複数(n個)の演算器#1~#nを備え、これらの演算器に演算処理回路1a,1b,1cが備えられる。
 この図11に例示するプロセッサシステムは、全体に対する演算器の占有率が大きいものであるが、このような各演算器に本演算処理回路1a,1b,1cを適用することで、演算器の回路規模削減の効果を奏することができる。
 そして、本発明は上述した実施形態に限定されるものではなく、本発明の趣旨を逸脱しない範囲で種々変形して実施することができる。
 また、上述した開示により本実施形態を当業者によって実施・製造することが可能である。
 1a,1b  演算処理回路
 10  制御ユニット
 11  メモリ
 101~104  レジスタ
 105,106  判定回路
 107,108  CSA
 109  Log Table回路
 110,111  右シフト回路
 112,212,312  処理回路
 113~119,130,131  演算回路
 120~126,221~223,321,322  セレクタ

Claims (5)

  1.  指数演算および対数演算を処理する第1の処理部と、
     除算および開平演算を処理する第2の処理部と
    を有し、
     前記第1の処理部と前記第2の処理部とで共用される共用部を備える
    ことを特徴とする、演算処理装置。
  2.  前記第1の処理部において、前記指数演算における指数変数または前記対数演算における真数変数の演算を実行する桁上げ保存加算器と、前記第2の処理部において、前記除算における部分剰余または前記開平演算における部分剰余の演算を実行する桁上げ保存加算器とが、前記共用部である
    ことを特徴とする、請求項1記載の演算処理装置。
  3.  前記第1の処理部および前記第2の処理部に対して演算を実行させる制御部を備え、
     前記制御部が、前記第1の処理部および前記第2の処理部に備えられた複数の回路の中から演算種類に応じた回路を選択して処理を実行させる
    ことを特徴とする、請求項1または2記載の演算処理装置。
  4.  前記指数演算,前記対数演算,前記除算および前記開平演算のいずれかの処理過程において生成される値を格納する格納部が、前記共用部であり、
     前記制御部が、演算種類に応じた初期値を前記格納部に設定する
    ことを特徴とする、請求項3記載の演算処理装置。
  5.  前記第2の処理部において、
     複数の出力値が設定される設定部と、
     前記設定部の中から第1の出力値を選択して出力する第1選択部と、
     前記設定部の中から第2の出力値を選択して出力する第2選択部と、
     前記第1選択部および前記第2選択部からの出力が入力される加算器と
    を備えることを特徴とする、請求項1~4のいずれか1項に記載の演算処理装置。
PCT/JP2018/040475 2018-10-31 2018-10-31 演算処理装置 WO2020090024A1 (ja)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP2020554660A JP7131627B2 (ja) 2018-10-31 2018-10-31 演算処理装置
PCT/JP2018/040475 WO2020090024A1 (ja) 2018-10-31 2018-10-31 演算処理装置

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP2018/040475 WO2020090024A1 (ja) 2018-10-31 2018-10-31 演算処理装置

Publications (1)

Publication Number Publication Date
WO2020090024A1 true WO2020090024A1 (ja) 2020-05-07

Family

ID=70463022

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2018/040475 WO2020090024A1 (ja) 2018-10-31 2018-10-31 演算処理装置

Country Status (2)

Country Link
JP (1) JP7131627B2 (ja)
WO (1) WO2020090024A1 (ja)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005092372A (ja) * 2003-09-12 2005-04-07 Tadahiro Omi 演算処理回路
JP2005275626A (ja) * 2004-03-23 2005-10-06 Fujitsu Ltd 演算種別と精度を選択可能な近似演算処理方法および近似演算処理装置
JP2006172035A (ja) * 2004-12-15 2006-06-29 Nec Computertechno Ltd 除算・開平演算器

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005092372A (ja) * 2003-09-12 2005-04-07 Tadahiro Omi 演算処理回路
JP2005275626A (ja) * 2004-03-23 2005-10-06 Fujitsu Ltd 演算種別と精度を選択可能な近似演算処理方法および近似演算処理装置
JP2006172035A (ja) * 2004-12-15 2006-06-29 Nec Computertechno Ltd 除算・開平演算器

Also Published As

Publication number Publication date
JPWO2020090024A1 (ja) 2021-09-02
JP7131627B2 (ja) 2022-09-06

Similar Documents

Publication Publication Date Title
CN114402289B (zh) 多模式运算电路
KR100714358B1 (ko) 연산을 수행하기 위한 방법, 시스템 및 장치
JP4870932B2 (ja) 多重精度を支援する拡張型モンゴメリモジュラ掛け算器
JP3479438B2 (ja) 乗算回路
KR19980041798A (ko) 영상처리를 위한 명령을 지원하는 모듈 계산구조
WO2004042599A1 (en) Method and a system for performing calculation operations and a device
CN109634558B (zh) 可编程的混合精度运算单元
US5528529A (en) Electronic multiplying and adding apparatus and method
US6728744B2 (en) Wide word multiplier using booth encoding
JP4601544B2 (ja) 入力値に逆数演算を実施して結果値を作り出すデータ処理装置および方法
CN113032723B (zh) 一种矩阵乘法器的实现方法及矩阵乘法器装置
JP2006228191A (ja) 逆数演算の結果値の初期推定値を求めるデータ処理装置および方法
WO2020090024A1 (ja) 演算処理装置
JPH04205026A (ja) 除算回路
KR100308726B1 (ko) 고속 산술 장치에서 올림수 예견가산기 스테이지의 수를 감소시키는 장치 및 방법
US7536429B2 (en) Multiplier with look up tables
JPH0234054B2 (ja)
JPH04355827A (ja) 開平演算装置
JP7006808B2 (ja) 演算処理装置および演算処理装置の制御方法
US20040133618A1 (en) Method and system for performing a multiplication operation and a device
KR100900790B1 (ko) 재구성형 프로세서 연산 방법 및 장치
JP3563043B2 (ja) 平方根の逆数計算方法、計算回路、及びプログラム
JP3982965B2 (ja) 繰り返し型乗算器とアレイ型乗算器
KR100951794B1 (ko) 다양한 정밀도를 갖는 적화(積和) 연산기 및 그 연산방법
JPH0368415B2 (ja)

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18938607

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2020554660

Country of ref document: JP

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18938607

Country of ref document: EP

Kind code of ref document: A1