WO2012077185A1 - 10進絶対値加算器 - Google Patents

10進絶対値加算器 Download PDF

Info

Publication number
WO2012077185A1
WO2012077185A1 PCT/JP2010/071923 JP2010071923W WO2012077185A1 WO 2012077185 A1 WO2012077185 A1 WO 2012077185A1 JP 2010071923 W JP2010071923 W JP 2010071923W WO 2012077185 A1 WO2012077185 A1 WO 2012077185A1
Authority
WO
WIPO (PCT)
Prior art keywords
circuit
result
adder
absolute value
carry
Prior art date
Application number
PCT/JP2010/071923
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 JP2012547619A priority Critical patent/JP5549743B2/ja
Priority to PCT/JP2010/071923 priority patent/WO2012077185A1/ja
Publication of WO2012077185A1 publication Critical patent/WO2012077185A1/ja
Priority to US13/873,517 priority patent/US20130238680A1/en

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/544Methods 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 for evaluating functions by calculation
    • 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/491Computations with decimal numbers radix 12 or 20.
    • G06F7/492Computations with decimal numbers radix 12 or 20. using a binary weighted representation within each denomination
    • G06F7/493Computations with decimal numbers radix 12 or 20. using a binary weighted representation within each denomination the representation being the natural binary coded representation, i.e. 8421-code
    • 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/50Adding; Subtracting

Definitions

  • the present invention relates to a decimal absolute value adder.
  • An adder with a decimal arithmetic correction function having the following configuration is known.
  • the addition result and the lower digit on the assumption that there is no carry signal from the lower digit based on the bit pattern of the addend and the addend for each decimal digit And the addition result when it is assumed that there is a carry signal from.
  • an addition result obtained by performing decimal arithmetic correction based on the presence / absence of a carry signal from a lower digit and the presence / absence of a carry signal from the digit is selectively extracted.
  • a decimal arithmetic circuit having the following configuration is known.
  • the decimal arithmetic circuit is provided with arithmetic means for performing the operation of the second operand-first operand in parallel during the main operation of the first operand-second operand. Then, when the result of the main calculation becomes negative, the calculation result value by the calculation means is selected and output instead of the result value of the main calculation. This eliminates the need for complement processing, eliminates delays in arithmetic processing during recomplementation, and improves processing performance.
  • a subtractor having the following configuration is known.
  • the subtracter inputs two operands having the same sign.
  • the first subtraction for subtracting the absolute value of the second operand from the absolute value of the first operand and the second subtraction for subtracting the absolute value of the first operand from the absolute value of the second operand are performed in parallel. Execute. Further, when an overflow occurs in the subtraction process in the subtraction circuit that performs the first subtraction, this is detected and a carry signal is generated. From the first subtraction result and the second subtraction result according to the carry signal. Choose the right one. As a result, a correct solution can always be obtained by one subtraction for any combination of operands, so that the efficiency of the subtracter can be increased.
  • JP-A-54-045442 JP 59-201144 A Japanese Unexamined Patent Publication No. 1-086238
  • decimal absolute value adder for each decimal digit, two operands are added to obtain a first operation result, and two operands and 10 are added to obtain a second operation result. Two operands and 6 are added to obtain a third operation result. Further, two operands and 1 are added to obtain a fourth operation result, two operands and 11 are added to obtain a fifth operation result, and two operands and 7 are added to obtain a sixth operation result. Get.
  • the operation for the two operands is addition of numbers with the same sign, or when the operation result is addition of numbers with different signs that are not negative, the following operation result is selected. That is, one of the first calculation result, the second calculation result, the fourth calculation result, and the fifth calculation result is selected.
  • the following operation result is selected. That is, a value obtained by taking the one's complement for any one of the first calculation result, the third calculation result, the fourth calculation result, and the sixth calculation result is selected.
  • the processing time for obtaining the decimal absolute value addition result can be effectively shortened by the decimal absolute value adder having the above configuration.
  • FIG. 3 is a diagram illustrating an example of a circuit configuration of a 9's complement circuit (9 ′s comp) illustrated in FIG. 2.
  • FIG. 4 is a block diagram showing another example of the configuration of the decimal absolute value adder body (decimal absolute adder) shown in FIG. 2 or FIG. 3. It is a figure which shows an example of the circuit structure of the BCD correction circuit (BCD
  • FIG. 10 is a circuit diagram illustrating an example of a circuit configuration of a 4-bit adder (A + B) illustrated in FIG. 9.
  • FIG. 10 is a circuit diagram illustrating an example of a circuit configuration of a 4-bit adder (A + B + 1) illustrated in FIG. 9.
  • FIG. 10 is a circuit diagram illustrating an example of a circuit configuration of a 4-bit adder (A + B + 6) illustrated in FIG. 9.
  • FIG. 14 is a diagram showing a breakdown of carry and borrow generated from each bit in the circuit example of FIG. 13.
  • FIG. 10 is a circuit diagram illustrating an example of a circuit configuration of a 4-bit adder (A + B + 7) illustrated in FIG. 9.
  • FIG. 17 is a diagram showing a breakdown of carry and borrow generated from each bit in the circuit example of FIG. 16.
  • FIG. 10 is a circuit diagram illustrating an example of a circuit configuration of a 4-bit adder (A + B + 10) illustrated in FIG. 9.
  • FIG. 19 is a diagram illustrating a breakdown of carry and borrow generated from each bit in the circuit example of FIG. 18.
  • FIG. 10 is a circuit diagram illustrating an example of a circuit configuration of a 4-bit adder (A + B + 11) illustrated in FIG. 9.
  • FIG. 21 is a diagram showing a breakdown of carry and borrow generated from each bit in the circuit example of FIG. 20. It is a block diagram which shows an example of each internal structure of the segment absolute value adder (In the case of Example 2, the absolute value adder for four decimal digits) in Example 2 of this invention. It is a block diagram which shows an example of an internal structure of the absolute value adder (digit
  • the binary absolute value adder is an arithmetic unit that performs the following operations. That is, the result obtained by taking 2's complement for the subtractive operand at the time of subtraction is added to the non-reduced operand. When the subtraction result is negative, the addition result is taken as a two's complement (recomplementation) to obtain the absolute value of the subtraction result.
  • the decimal absolute value adder is an arithmetic unit that performs the following operations. That is, the result obtained by taking 10's complement for the subtractive operand at the time of subtraction is added to the non-reduced operand. When the subtraction result is negative, the complement of the addition result is 10's complement (recomplementation) to obtain the absolute value of the subtraction result.
  • Embodiment 1 of the present invention has the following features. (1) A decimal absolute value adder that calculates a numerical value expressed by a BCD (Binary Coded Decimal) code. (2) By realizing a decimal adder using a high-speed binary adder, a high-speed decimal absolute value adder can be realized. (3) When realizing a high-speed decimal absolute value adder, A + B, A + B + 1, A + B + 6, A + B + 7, A are used for each digit of the binary adder. A circuit for obtaining a partial sum corresponding to + B + 10 and A + B + 11 is provided.
  • the digit means one decimal digit (that is, 4 bits in the BCD code), and A and B each indicate an operand in digit units.
  • the partial sum means a sum in digit units.
  • an operation result is obtained using A + B, A + B + 1, A + B + 10, and A + B + 11 according to a carry (that is, carry, hereinafter the same) condition.
  • the result is obtained using A + B, A + B + 1, A + B + 10, and A + B + 11 according to the carry condition.
  • the result is negative, the one's complement of each of A + B, A + B + 1, A + B + 6, and A + B + 7 is taken to be an absolute value according to the carry condition. That is, the absolute value of the negative subtraction result is obtained.
  • the partial sum corresponding to A + B + 6, A + B + 7, A + B + 10, and A + B + 11 is the same as that of a normal CLA (Carry Look Ahead) type 4-bit adder. Can be determined by scale and speed.
  • CLA Carry Look Ahead
  • Fig. 1 shows the correspondence between binary representations of BCD codes and decimal numbers.
  • a method for realizing a decimal adder using a high-speed binary adder is as follows.
  • +6 is applied in advance to each digit of one operand so that the carry can be propagated between the digits with a high-speed binary adder. That is, by mapping 9 (in binary notation, 1001) to 15 (binary notation, 1111), when 1 is added, the digit carry can be set to 1 by the binary adder.
  • the complement of 1 is taken for the reduction operand.
  • This operation is equivalent to performing +6 after taking the 9's complement for each digit of the reduction operand.
  • the lowest Cin (carry-in; equivalent to the carry from the lower order) input is set to 1, and the value obtained by taking the one's complement of the above-mentioned reduced operand for the reduced operand to add.
  • the reason why the lowest Cin input is set to 1 is to change the 9's complement to 10's complement.
  • the above +6 is extra.
  • BCD coding is performed by performing -6 on the resulting digit. That is, at the time of subtraction, the complement (10's complement) of the subtraction operand is created in advance, and the same operation as at the time of addition is performed.
  • FIG. 2 shows an example of the overall configuration of the decimal absolute value addition kit that uses a high-speed binary adder, including the pre-processing correction part.
  • FIG. 3 shows an example of the overall configuration in the case of taking 1's complement instead of taking +6 after taking 9's complement as described above.
  • the decimal absolute value adder shown in FIG. 2 includes an adder circuit 11 that performs +6 in digit units for the first operand op1, a 9's complement circuit 12 that takes 9's complement in digit units for the first operand op1, and It has an adder circuit 13 that performs +6 after taking the 9's complement. Further, a selector 14 and a decimal absolute value adder main body 15 for selecting an output from the adder circuit 11 and the adder circuit 13 are provided.
  • the complement circuit 12, the adder circuit 13, and the selector 14 of the adder circuits 11 and 9 are parts for correcting the preprocessing.
  • the selector 14 has a value of 1 when the operation is subtraction, and selects the output of the adder circuit 11 when the signal SUB having a value of 0 has 0 in the case of addition to select the decimal absolute value adder body. 15 is output.
  • the signal SUB has 1, the output of the adder circuit 13 is selected and output to the decimal absolute value adder main body 15.
  • the decimal absolute value adder body 15 adds a decimal absolute value between the output value of the selector 14 and the second operand op2, and outputs a decimal absolute value addition result result.
  • the decimal absolute value adder shown in FIG. 3 has the same configuration as the decimal absolute value adder shown in FIG. 2, and the same components are denoted by the same reference numerals, and redundant description is omitted.
  • the decimal absolute value adder shown in FIG. 3 replaces the 9's complement circuit 12 and the adder circuit 13 in the configuration shown in FIG. 2 with a 1's complement that takes 1's complement for the first operand op1.
  • a circuit 16 is included.
  • FIG. 4 shows an example of the configuration of the decimal absolute value adder main body 15 in the overall configuration of the decimal absolute value adder shown in FIG. 2 or FIG.
  • the decimal absolute value adder body includes a binary adder 21, a recomplementation detection circuit 22, a BCD correction circuit 23, a 9's complementation circuit 24, a BCD increment circuit 25, And a selector 26.
  • the input A has the following values, for example. That is, A is a result obtained by performing processing by the complement circuit 12 and the adder circuit 13 of the adder circuit 11 or 9 on the first operand op1 shown in FIG. 2 or FIG. This is a result obtained by performing processing by the complement circuit 16.
  • the other B is the second operand shown in FIG. 2 or FIG. Since A and B are equivalent values that can be logically exchanged, A and B may be mutually exchanged.
  • the recomplementation detection circuit 22 determines whether or not recomplementation is required for the addition result by the binary adder 21, and outputs 1 to the selector 26 when recomplementation is necessary, and selects 0 when not necessary. 26.
  • the recomplementation detection circuit 22 determines whether the carry output signal carry from the binary adder 21 is subtracted (ie, addition of numbers of different signs, and so on) for the first operand op1 and the second operand op2.
  • the signal SUB indicating is input. Regardless of the value of carry output signal carry, recomplementation detection circuit 22 outputs 0 when signal SUB indicates addition (that is, addition of numbers of the same sign, and so on).
  • the recomplementation detection circuit 22 sets 0 when the operation is addition, 0 when the operation is subtraction and the subtraction result is positive and no recomplementation is necessary, and subtraction result when the operation is subtraction. Is 1 and 1 is output when recomplementation is required.
  • the selector 26 selects the output value of the BCD correction circuit 23 when the operation is addition, when the operation is subtraction, the subtraction result is positive, and recomplementation is not required. Also output the output value of the BCD correction circuit 23, respectively.
  • the selector 26 outputs the output value of the BCD increment circuit 25 when the calculation is subtraction and the subtraction result is negative and recomplementation is required.
  • the decimal absolute value adder body shown in FIG. 4 performs the following processing when the operation for the first operand op1 and the second operand op2 is addition (that is, addition of numbers having the same sign). That is, the number A obtained by adding +6 to each digit of the number of BCD codes as the first operand op1 and the number B of BCD codes as the second operand op2 in the adding circuit 11 shown in FIG.
  • the binary adder 21 performs addition as a binary number.
  • the selector 26 selects and outputs the output of the BCD correction circuit 23 when the operation for the first operand op1 and the second operand op2 is addition (that is, addition of the numbers of the same sign).
  • the output value of the binary adder 21 is corrected in a digit unit by performing ⁇ 6 when +6 is redundant as described above, and the output value of the BCD correction circuit 23 is sent to the selector 26. Entered.
  • the decimal absolute value addition result from the BCD correction circuit 23 is output from the selector 26.
  • the input data A is a 9's complement for each digit of the BCD code which is the first operand op1 in the 9's complement circuit 12 and the adder circuit 13 or the 1's complement circuit 16 shown in FIG. This is the data obtained by taking +6 or taking the one's complement.
  • the input data B is a BCD code which is the second operand op2.
  • Input data A and B are added as binary numbers by the binary adder 21. In this case, in order to change the 9's complement to 10's complement as described above, the binary adder 21 performs addition with the lowest Cin input (not shown in FIG. 4) as 1.
  • the selector 26 selects and outputs the output of the BCD correction circuit 23 when the operation on the first operand op1 and the second operand op2 is subtraction and the result is not negative.
  • the output value of the binary adder 21 is corrected in a digit unit by performing ⁇ 6 when +6 is redundant as described above, and the output value of the BCD correction circuit 23 is sent to the selector 26. Entered.
  • the decimal absolute value addition result from the BCD correction circuit 23 is output from the selector 26.
  • the selector 26 subtracts the arithmetic operation for the first operand op1 and the second operand op2 and if the result is negative (recomplementation is necessary), the 9's complement circuit 24
  • the connected BCD increment circuit 25 is selected and output.
  • the 9's complement circuit 24 takes 9's complement for the output value of the BCD correction circuit 23, and the BCD increment circuit 25 adds 1 to the output value of the 9's complement circuit 24 for each digit. To obtain 10's complement.
  • the decimal absolute value addition result from the BCD increment circuit 25 is output from the selector 26.
  • FIG. 5 shows an example of the circuit configuration of the 9's complement circuits 12 and 24 described above.
  • 5 includes a NOR circuit (hereinafter simply referred to as NOR) circuit NOR1, an exclusive OR (hereinafter simply referred to as EXOR) circuit EXO1, a buffer BUF1, and a logical product (hereinafter simply referred to as AND).
  • NOR NOR circuit
  • EXOR exclusive OR
  • a circuit AND1, an inverter INV1, and an EXOR circuit EXO2 are included.
  • the first to fourth bits a3, a2, a1, a0 of one digit BCD code and the parity bit ap are input to the 9's complement circuit of FIG.
  • the 9's complement circuit outputs the first to fourth bits x3, x2, x1, x0 and the parity bit xp of the BCD code obtained by taking the 9's complement of the BCD code. That is, the NOR circuit NOR1 receives a3, a2, and a1 and outputs x3.
  • the EXOR circuit EXO1 receives a2 and a1 and outputs x2.
  • the buffer BUF1 receives a1 and outputs x1.
  • the inverter INV1 receives a0 and outputs x0.
  • the AND circuit AND1 receives a2 and a value obtained by inverting a1 by the inverter INV2.
  • the EXOR2 takes an exclusive OR with the result of AND1 and outputs xp.
  • FIG. 6 shows another example of the decimal absolute value adder body described above with reference to FIG.
  • the BCD increment circuit 25 in the example of FIG. 4 in consideration of the fact that the processing by the BCD increment circuit 25 in the example of FIG. 4 requires a longer time as the number of decimal digits handled by the decimal absolute value adder increases, the BCD increment circuit is not used. This is an example.
  • the binary adder 31, the BCD correction circuit 33, and the recomplementation detection circuit 22 are replaced with the binary adder 21, the BCD correction circuit 23, and the recomplementation in the example of FIG.
  • Each corresponds to the detection circuit 22 and has the same function. That is, the adder 11 in FIG. 2 or FIG. 3 adds +6 to each digit of the BCD code of the first operand op1 and the second operand op2, and the binary adder 31 converts the digit to a binary number. to add.
  • the BCD correction circuit 33 needs to perform -6 in digit units as described above, -6 is performed. Then, the decimal absolute value addition result result from the BCD correction circuit 33 is selectively output from the selector 26.
  • FIG. 7 shows an example of the circuit configuration of the BCD correction circuits 23, 33, and 34 for one digit.
  • the BCD correction circuit of FIG. 7 includes EXOR circuits EXO3, EXO4, a subtraction circuit SUB1, and a selector SEL1.
  • the EXOR circuit EXO3 takes one bit immediately above one digit of the input data A and B as A [4] and B [4], respectively, and takes the EXOR of them.
  • a [4] and B [4] are assumed to be 0 when the corresponding bit does not exist.
  • EXO4 one bit immediately above the digit of the output of EXO3 and the output D of the binary adder is set to D [4], and EXOR is performed on them.
  • the carry output of the adder outputting the D signal is used instead.
  • EXO4 outputs 0, and when there is a carry of the calculation result of A + B, EXO4 outputs a value of 1.
  • the selector SEL1 selectively outputs the output value of the subtraction circuit SUB1 (with correction of ⁇ 6) when there is no carry of the calculation result of A + B (0), and there is a carry of the calculation result of A + B (1) D is selectively output (no correction of -6).
  • the input data A is 9 for each digit of the number of BCD codes as the first operand op1 in the 9's complement circuit 12 and the adder circuit 13 or 1's complement circuit 16 shown in FIG. Data obtained by taking the complement and performing +6 or taking the one's complement.
  • the input data B is a BCD code that is the second operand op2.
  • the binary adder 31 adds the input data A and B as binary numbers. In this case, in order to change the 9's complement to the 10's complement as described above, the addition is performed by setting the Cin input (not shown in FIG. 4) to 1 at the lowest order of the binary adder 31.
  • the selector 26 selectively outputs the output of the BCD correction circuit 33.
  • the output value of the binary adder 31 is corrected by performing -6 in the digit unit when +6 is extra as described above, and the output value of the BCD correction circuit 33 is sent to the selector 26. Entered.
  • the decimal absolute value addition result result from the BCD correction circuit 23 is output from the selector 26.
  • the selector 26 performs the subtraction of the 9's complement circuit 24 when the operation on the first operand op1 and the second operand op2 is subtraction and the result is negative (when recomplementation is necessary). Select and output the output value.
  • the 9's complement circuit 24 receives a value obtained by passing the output value of the binary adder 32 through the BCD correction circuit 34. In this case, in the binary adder 32, the lowest Cin input is set to 0, binary addition is performed, and the addition result is input to the BCD correction circuit 34.
  • the 9's complement circuit 24 takes the 9's complement from the output value of the BCD correction circuit 34, and the decimal absolute value addition result result thus obtained is output from the selector 26.
  • the +1 processing by the BCD increment circuit is performed. Is no longer necessary.
  • the BCD increment circuit is unnecessary.
  • the binary adders 31 and 32 perform addition processing in parallel
  • the BCD correction circuits 33 and 34 also perform correction processing in parallel. As a result, the processing time can be shortened.
  • Patent Document 1 an example described in Patent Document 1 will be described as a configuration example of a decimal adder in digit units.
  • two signal lines that depend only on the carry Cout of the digit itself and four signal lines that depend on both the carry Cin from the outside and the Cout are provided in parallel. Then, the AND logic of the conditions of these six signal lines and the Cin or Cout condition is taken, and the OR logic of each AND logic result is taken to speed up the BCD correction process.
  • the result of A + B + Cin and the result of decimal correction (processing of ⁇ 6) are used as the carry signal (Cin) from the outside and the carry signal of the digit itself ( Cout).
  • the Cin signal and Cout signal are generated by a known carry look ahead circuit.
  • this Cout signal must be equivalent to the Cin signal for the upper digits. For this reason, both the Cin signal and the Cout signal drive two digits. Further, AND logic of the Cin signal and the Cout signal is taken at the final stage by modifying the logical expression. By utilizing the fact that wired OR logic can be used, high-speed processing is achieved by taking OR logic for a large number of signals at once.
  • processing by the BCD increment circuit 25 is also required at the time of subtraction, and the arithmetic unit having a larger number of digits requires more time for subtraction processing.
  • the binary adder is a general-purpose functional circuit, so a high-speed binary adder is installed.
  • IP core Intelligent Property Core
  • the configuration described below is provided as a digit computing unit in a digit unit adder using a binary adder. That is, as shown in FIG. 9 described later, the operations of A + B, A + B + 10, A + B + 6, A + B + 1, A + B + 11, and A + B + 7 are performed in parallel.
  • Adders ADD1, ADD2, ADD3, ADD4, ADD5 and ADD6 to be executed are provided. Of these adders ADD1, ADD2, ADD3, ADD4, ADD5, and ADD6, the adders ADD1, ADD2, and ADD3 that perform A + B, A + B + 10, and A + B + 6, respectively, carry from the lower order. Generates the operation result when there is no.
  • adders ADD4, ADD5, and ADD6 that perform A + B + 1, A + B + 11, and A + B + 7, respectively, generate a calculation result when there is a carry from the lower order.
  • the calculation result is calculated by the A + B adder ADD1 and the A + B + 10 adder ADD2 when there is no need for recomplementation and no carry from the lower order.
  • the BCD correction means, for example, correction performed by ⁇ 6 performed by the BCD correction circuits 23, 33, and 34 described above with reference to FIGS.
  • the BCD correction is not required, the calculation result of the A + B adder ADD1 is used (s0), and when BCD correction is required, the calculation result of the A + B + 10 adder ADD2 is used. (S0).
  • a + B + 10 is equivalent to A + B-6 in the calculation closed to 4 bits. Therefore, when BCD correction ( ⁇ 6) is required, an adder ADD2 of A + B + 10 is used.
  • the calculation result takes into account the carry +1, and the adder ADD4 and A + of A + B + 1 that adds 1 to A + B Calculation is performed with an adder ADD5 of A + B + 11 that adds 1 to B + 10.
  • the necessity of BCD correction is determined based on the carry output signal digit ⁇ carry out of the A + B + 1 adder ADD4.
  • whether or not the BCD correction is necessary is completed within the digit, and can be performed with the delay time required to execute the carry look-ahead for 4 bits. Is possible.
  • the complementing process for recomplementation needs to take 9's complement for decimal operation with BCD code.
  • An example of the 9's complement circuit is shown in FIG. 5 described above, but in the example of FIG. 5, the 3-input NOR circuit NOR1 that generates x3 and the EXOR circuit EXO1 that generates x2 have a relatively long operation time. It is a gate that requires.
  • the inverter INV2 as a configuration for predicting the digit parity accompanying complementation, the inverter INV2, the AND circuit AND1, and the EXOR circuit EXO2 are required, and three stages of gates are required.
  • the operation result before recomplementation when recomplementation is required is assumed to be r (0 ⁇ r ⁇ 9) in the BCD code.
  • each of the adders ADD6, ADD2, and ADD5 that performs the calculation of A + B + 7, A + B + 10, and A + B + 11 is emphasized with respect to the high speed of the arithmetic processing.
  • the arithmetic processing can be performed in a time equivalent to the time required for the arithmetic processing of 4-bit CLA (see FIGS. 18 and 20).
  • the operation result when the recomplementation at the time of subtraction is required and there is no carry from the lower order is added to the adders ADD1 and A + B + 6 of A + B. Obtained by the adder ADD3.
  • the necessity of BCD correction is determined. Note that the BCD correction here is different from the BCD correction in the case of the above addition. That is, in this case, as described above, when the calculation result is subtracted from 15 at the time of recomplementation, an extra 6 is not included. That is, an adder ADD2 of A + B + 6 that adds 6 to A + B in advance is used so that 15 ⁇ (r + 6) is obtained when the calculation result is subtracted from 15.
  • the inverter INV5 outputs 1 to the output of the A + B adder ADD1. Takes the complement of to get rs0.
  • BCD correction is necessary, the output of the adder ADD3 of A + B + 6 is complemented with 1 by the inverter INV5 to obtain rs0.
  • the calculation result in the case where there is a carry from the lower order because recomplementation is required at the time of subtraction is obtained by the adder ADD4 of A + B + 1 and the adder ADD6 of A + B + 7.
  • BCD correction is necessary.
  • the digit unit of A + B, A + B + 10, A + B + 6, A + B + 1, A + B + 11, A + B + 7 are executed in parallel by ADD1 to ADD6 by respective adders.
  • processing such as the BCD correction processing by the BCD correction circuit 23, 33 or 34 of FIG. 4 or FIG. 6 becomes unnecessary.
  • the 9's complement processing by the 9's complement circuit 24 of FIG. 4 or 6 can be replaced by bit inversion by inverters INV5 and INV6 that perform 1's complement.
  • a + B, A + B + 10, A + B + 6, A + B + 1, A + B + 11, and A + B + 7 are performed in a block carry propagation circuit BCP1 described later with reference to FIG. It is executed concurrently with the execution of carry propagation logic in the well-known binary adder. As a result, a high-speed decimal absolute value addition operation can be realized.
  • FIG. 8 shows the overall configuration of the decimal absolute value adder body according to the first embodiment of the present invention.
  • each of the m + 1 segment absolute value adders DAD0, DAD1,..., DADm for example, the segment absolute value adder DAB1
  • the decimal absolute value adder body of the first embodiment is applied to a decimal absolute value adder for m + 1 decimal numbers. Therefore, in the first embodiment, the m + 1 segment absolute value adders DAD0, DAD1,..., DADm output a decimal absolute value addition result SUM having a maximum of m + 1 digits.
  • the block carry propagation circuit BCP1 in FIG. 8 is applicable to a carry propagation circuit in a binary adder, and can be a high-speed carry propagation circuit to which a known carry look-ahead method or the like is applied.
  • the block carry propagation circuit BCP1 regards each of the segment absolute value adders DAD0, DAD1,..., DADm as each block, and executes carry propagation logic between the blocks.
  • the block carry propagation circuit BCP1 has a carry (BCin for recomp) at the time of recomplementation (also simply referred to as recomp or r) and a carry (BCin for non at the time of non-recomplementation (also simply referred to as non-recomp or nr)).
  • the case of recomplementation that is, the case of performing recomplementation
  • the case of recomplementation is a case where the decimal operation is subtraction and the operation result is negative, and the case where recomplementation is necessary.
  • non-recomplementation that is, when recomplementation is not performed, when the decimal operation is addition or when the decimal operation is subtraction and the operation result is not negative, recomplementation is unnecessary. It means a case.
  • BmCr means carry at the time of recomplementation for the mth block (segment absolute value adder) DADm
  • BmCnr denotes carry at the time of non-recomplementation to the mth block DADm. means.
  • the block carry propagation circuit BCP1 can have the same configuration as the carry propagation circuit in a known binary adder. That is, in order to realize the +1 arithmetic processing in the complementation of the subtractive operand at the time of subtraction (processing to convert 9's complement to 10's complement), the signal SUB is connected to the carry input terminal nrCin at the time of non-complementation, In the subtraction operation in which SUB becomes 1, carry nrCin (the lowest Cin) at the time of non-complement is set to 1.
  • the signal RECOMP is input to each segment absolute value adder DAD0, DAD1,..., DADm, and each segment absolute value adder DAD0, DAD1,. That is, in FIG.
  • the inverter INV5 is output to any one of the adders ADD1, ADD3, ADD4, and ADD6 of A + B, A + B + 6, A + B + 1, and A + B + 7.
  • IVN6 takes 1's complement to obtain the operation result.
  • FIG. 10 is a block diagram for explaining a case where the block carry propagation circuit BCP1 shown in FIG. 8 is formed by two binary carry look ahead circuits BCLA1 and BCLA2.
  • the two binary carry look-ahead circuits BCLA1 and BCLA2 a well-known binary carry look-ahead circuit (carry look-ahead circuit in a binary computing unit) can be applied.
  • Each of the two binary carry look ahead circuits BCLA1 and BCLA2 performs binary absolute value addition of the binary data A and B based on the input binary data A and B (not shown in FIG. 10).
  • the carry for each block (4 bits in the case of the first embodiment) is generated and output.
  • the binary carry look-ahead circuit BCLA1 generates and outputs a carry at the time of non-recomplementation.
  • the binary carry look-ahead circuit BCLA2 generates and outputs a carry at the time of recomplementation, that is, B0Cr (Block 0 carry for recomp), B1Cr (Block 1 carry for recomp), ..., Bm-1Cr (Block m-1 carry for recomp) and BmCr (Block m carry for recomp) are generated and output.
  • the block carry propagation circuit BCP1 of FIG. 8 implements +1 arithmetic processing (processing for converting 9's complement to 10's complement) in the complement operation of the subtractive operand at the time of subtraction.
  • Signal SUB is connected as carry nrCin at the time of conversion.
  • the carry nrCin becomes 1 in the subtraction operation in which the signal SUB becomes 1.
  • 0 is input as the (lowest) carry Cin of the binary carry look-ahead circuit BCLA2 that generates a carry at the time of recomplementation. Therefore, the carry Cin (lowest order) of the binary carry look ahead circuit BCLA2 becomes 0 at the time of recomplementation.
  • the carry Cin of the binary carry look ahead circuit BCLA1 that generates the carry at the time of non-recomplementation the carry nrCin at the time of non-recomplementation, to which the signal SUB is connected as described above, is connected.
  • the carry Cin (the lowest order) of the binary carry look ahead circuit BCLA1 that generates the carry at the time of non-recomplementation becomes 1.
  • the (lowest) carry Cin of the binary carry look-ahead circuit BCLA1 that generates a carry at the time of non-recomplementation becomes 0.
  • +1 (a process for converting 9's complement to 10's complement) is performed in the complementation of the subtraction operand at the time of non-recomplementation at the time of subtraction.
  • +1 (a process for converting 9's complement to 10's complement) is unnecessary. That is, at the time of addition, +1 is unnecessary because the operands are not complemented in the first place.
  • 9's complement is obtained by performing bit inversion by the inverters INV5 and INV6 in FIG. 9 as described above. Further, in the complementation in the preprocessing, for example, the 9's complement is obtained by the 9's complementation circuit 12 in FIG. Then, at the time of recomplementation, the bit is inverted by the inverter as described above to obtain 9's complement.
  • the former method is adopted in the 10's complementation in the preprocessing
  • the latter method is adopted in the 10's complementation for the recomplementation of the result, thereby adding +1 in the two 10's complementation processing.
  • the operation and -1 operation are offset.
  • the +1 operation and the ⁇ 1 operation are not performed in the respective processes of the complementation in the preprocessing and the recomplementation, so that the 9's complement is performed in each process.
  • the processing of correction value 1, which is the processing of making 10's complement can be canceled and omitted.
  • the decimal absolute value adder body of FIG. 8 further includes the AND circuit AND-RECOMP.
  • the AND circuit AND-RECOMP receives a signal SUB having a value of 1 at the time of subtraction and a carry output signal COUT of the block carry propagation circuit BCP1 and has 1 after recomplementation and 0 after non-recomplementation.
  • the signal RECOMP is supplied to each segment absolute value adder DAD0, DAD1,..., DADm.
  • the digit absolute value adder (segment absolute value adder) shown in FIG. 9 will be described in detail.
  • the digit absolute value adder according to the first embodiment of the present invention shown in FIG. 9 has the six 4-bit adders ADD1 to ADD6 (also simply referred to as adders ADD1 to ADD6).
  • the adder ADD1 adds A + B to the input data A and B having 4 bits each representing one decimal digit.
  • the adder ADD2 adds A + B + 10 to the input data A and B.
  • the adder ADD3 adds A + B + 6 to the input data A and B.
  • the adder ADD4 adds A + B + 1 to the input data A and B.
  • the adder ADD5 adds A + B + 11 to the input data A and B.
  • the adder ADD6 adds A + B + 7 to the input data A and B.
  • the six adders ADD1 to ADD6 can execute respective addition operations in parallel with each other.
  • the digit absolute value adder of FIG. 9 further includes selectors SEL11 to SEL17.
  • the outputs of the adders ADD1 and ADD2 are input to the selector SEL11.
  • the selector SEL11 selectively outputs the output of the adder ADD1 when the carry output signal digit carry out of the adder ADD1 is 1, and when the carry output signal digit carry out of the adder ADD1 is 0, the selector SEL11 Select and output the output.
  • the outputs of the adders ADD1 and ADD3 are input to the selector SEL12.
  • the selector SEL12 selectively outputs the output of the adder ADD1 when the carry output signal digit carry out of the adder ADD1 is 0, and the adder ADD3 outputs when the carry output signal digit carry out of the adder ADD1 is 1. Select and output the output.
  • the outputs of the adders ADD4 and ADD5 are input to the selector SEL13.
  • the selector SEL13 selectively outputs the output of the adder ADD4 when the carry output signal digit carry out of the adder ADD4 is 1, and when the carry output signal digit ⁇ carry out of the adder ADD4 is 0, the selector SEL13 Select and output the output.
  • the outputs of the adders ADD4 and ADD6 are input to the selector SEL14.
  • the selector SEL14 selectively outputs the output of the adder ADD4 when the carry output signal digit carry out of the adder ADD4 is 0, and when the carry output signal digit carry out of the adder ADD4 is 1, the selector SEL14 Select and output the output.
  • the outputs of the selectors SEL11 and SEL13 are input to the selector SEL15.
  • the selector SEL15 performs a selection operation based on the carry BCin for non-recomp at the time of non-recomplementation, that is, carry B0Cnr, B1Cnr, ..., Bm-1Cnr, BmCnr described in FIGS. That is, when the carry at the time of non-recomplementation is 0, the selector SEL15 selects and outputs the output s0 of the selector SEL11. When the carry at the time of non-recomplementation is 1, the selector SEL15 selects and outputs the output s1 of the selector SEL13. To do.
  • the inverters INV5 and INV6 invert the outputs of the selectors SEL12 and SEL14 in bit units, and output the inversion results rs0 and rs1, respectively.
  • the outputs rs0 and ⁇ rs1 of the inverters INV5 and INV6 are input to the selector SEL16.
  • the selector SEL15 performs a selection operation based on the carry BCin for recomp at the time of recomplementation, that is, carry B0Cr, B1Cr, ..., Bm-1Cr, BmCr described in FIGS. That is, when the carry at the time of recomplementation is 0, the selector SEL16 selectively outputs the output rs0 of the inverter INV5, and when the carry at the time of recomplementation is 1, the selector SEL16 selectively outputs the output rs1 of the inverter INV6.
  • the outputs r and ⁇ rs of the selectors SEL15 and SEL16 are input to the selector SEL17, respectively.
  • the selector 17 selectively outputs (result) the output s of the selector SEL15 when the value of the signal RECOMP shown in FIG. 8 is 0 (when not recomplementing), and when the value of the signal RECOMP is 1 (when recomplementing) ),
  • the output rs of the selector SEL16 is selected and output (result).
  • the adder circuit 13 described above with reference to FIG. 2 performs +6 on one operand op1 in digit units. That is, an offset of +6 is added.
  • the carry propagation of the decimal operation is appropriately performed by the carry propagation logic in the well-known binary arithmetic unit included in the block carry propagation circuit BCP1.
  • the calculation result when there is no carry from the lower order is generated using the adders ADD1, ADD2, and ADD3 of A + B, A + B + 10, and A + B + 6. If there is no carry from the lower order, the signals BCin for non-recomp and BCin for recomp are 0. As a result, the selectors SEL15 and SEL16 select and output the calculation results of the adders ADD1, ADD2 and ADD3 or the result of bit inversion of the calculation results.
  • the calculation result when the offset of +6 is not added using the digit carry out signal of the adder ADD1 of A + B It can be determined whether or not is over 9.
  • the operation result of the A + B adder ADD1 is the result of operation when the operation result of A + B exceeds 9 when the offset of +6 is not added.
  • BCD code The calculation result of the adder ADD2 of A + B + 10 is the BCD code of the calculation result when the calculation result when the offset of +6 is not added does not exceed 9.
  • the bit inversion by the inverter INV5 is the BCD correction (that is, 1's complement) processing (recomplementation) as described above.
  • the operation result when there is a carry from the lower order in the configuration of FIG. 9 is generated using the adders ADD4, ADD5, and ADD6 of A + B + 1, A + B + 11, and A + B + 7, respectively.
  • each of the signals BCin for non-recomp and BCin for recomp becomes 1.
  • the selectors SEL15 and SEL16 selectively output the calculation results of the adders ADD4, ADD5 and ADD6 or the result of bit-inversion of the calculation results.
  • the calculation result of the adder ADD4 of A + B + 11 is the BCD code of the calculation result when the calculation result when the offset of +6 is not added does not exceed 9.
  • the calculation result of the A + B + 7 adder ADD6 is selectively output by the selector SEL14, and the bit is inverted by the inverter INV6 (rs1 ).
  • the operation result of the A + B + 1 adder ADD4 is selected and output, and the bit is inverted by the inverter INV6 (rs1).
  • the bit inversion by the inverter INV6 is the BCD correction (that is, 1's complement) processing (recomplementation) as described above.
  • the carry at the time of non-recomplementation (BCin ⁇ ⁇ for non-recomp) and the carry at the time of recomplementation (BCin for recomp) are determined by the carry propagation logic in the binary arithmetic unit included in the block carry propagation circuit BCP1 shown in FIG. ) And are supplied.
  • the selector SEL15 selects the value s0, and when it is 1, the s1 is selected and s is output.
  • the selector 16 selects rs0 when the carry is 0, selects rs1 when the carry is 1, and outputs rs.
  • RECOMP 1
  • the output rs is selected and the result “result” is output.
  • FIG. 11 is a circuit diagram showing an example of the circuit configuration of the A + B adder ADD1.
  • the four bits a0, a1, a2, a3 and b0, b1, b2, and b3 of the input data A and B and the even parity bits ap and bp of the input data A and B are input.
  • 4 bits s0, s1, s2, s3 of the calculation result of A + B and the parity bit sp are output.
  • the example of FIG. 11 includes NAND circuits NAND11, a0, b0 that receive input bits a0, b0 and an EXOR circuit EXO10, which outputs h0, and an inverter INV10 that inverts the output of NAND11 and outputs g0.
  • the example of FIG. 11 further includes a buffer BUF20 that buffers h0 and outputs an output bit s0.
  • the example in FIG. 11 further includes an EXOR circuit EXO11 which inputs NAND circuits NAND12, a1, b1 which input NAND circuits NAND12, a1, b1 which input input bits a1, b1 and which outputs h1.
  • EXOR circuit EXO11 which inputs NAND circuits NAND12, a1, b1 which input NAND circuits NAND12, a1, b1 which input input bits a1, b1 and which outputs h1.
  • FIG. 11 includes NAND circuits NAND11, a0
  • 11 further includes inverters INV11 and INV12 that invert the outputs of NAND12 and NOR11 and output p1 and g1, respectively, and an EXOR circuit EXO21 that inputs h1 and g0 and outputs an output bit s1.
  • the example of FIG. 11 further includes an NAND circuit NAND13, which inputs the input bits a2, b2, and an EXOR circuit EXO12 which inputs NOR circuits NOR12, a2, b2 which input the input bits a2, b2 and outputs h2.
  • the example of FIG. 11 further includes inverters INV13 and INV14 that invert the outputs of the NAND 13 and NOR 12 and output p2 and g2, respectively.
  • An EXOR circuit EXO22 that outputs the bit s2 is included.
  • the example of FIG. 11 further includes an NAND circuit EXO13 which inputs input bits a3 and b3 and outputs h3, inputs NAND28 EX0, g0, p1 and gp2, NAND circuit NAND29 which inputs p2, and an inverter INV22 which inverts g2.
  • the example of FIG. 11 further includes NAND circuits NAND30, NAND3, which outputs the outputs of NAND28, NAND29, INV22 and outputs c3, and an EXOR circuit EXO23 which outputs output bit s3.
  • the example of FIG. 11 further includes an EXOR circuit EXO30 that inputs the input parity bits ap and bp, and NAND circuits NAND21, NAND22, NAND23, and NAND24 that receive the values generated when the output bits s0 to s3 are generated.
  • EXOR circuit EXO30 that inputs the input parity bits ap and bp
  • NAND circuits NAND21, NAND22, NAND23, and NAND24 that receive the values generated when the output bits s0 to s3 are generated.
  • the example of FIG. 11 further includes a NAND circuit NAND25 that inputs the outputs of NAND21, NAND22, NAND23, and NAND24 and outputs pc, and an EXOR circuit EXO31 that inputs the output of pc and EXO30 and outputs the output parity bit sp.
  • EXOR circuit EXO30 that inputs the input parity bits ap and bp
  • each bit s0, s1, s2, and s3 of the operation result is generated in consideration of the carry (carry) generated from the operation result of the lower bits.
  • FIG. 12 is a circuit diagram showing an example of the circuit configuration of the A + B + 1 adder ADD4.
  • 4 bits a0, a1, a2, a3 and b0, b1, b2, b3 of input data A and B, and even parity bits ap and bp of input data A and B, respectively, are input.
  • the example of FIG. 12 outputs 4 bits s0, s1, s2, s3 of the calculation result of A + B + 1 and its parity bit sp.
  • the example of FIG. 12 includes the NOR circuits NOR110, a0, b0 that input the input bits a0, b0, the EXOR circuit EXO110, which outputs h0, and the inverter INV110 that inverts the output of the NOR110 and outputs p0.
  • the example of FIG. 12 further includes an inverter INV120 that inverts h0 and outputs an output bit s0.
  • the example of FIG. 12 further includes an NAND circuit NAND112 that inputs the input bits a1 and b1, a NOR circuit NOR111 that receives the a1 and b1, and an EXOR circuit EXO111 that inputs a1 and b1 and outputs h1.
  • FIG. 12 includes the NOR circuits NOR110, a0, b0 that input the input bits a0, b0, the EXOR circuit EXO110, which outputs h0, and the inverter INV110 that inverts the
  • inverters INV111 and INV112 that invert the outputs of NAND 112 and NOR 111 and output p1 and g1, respectively, and an EXOR circuit EXO121 that inputs h1 and p0 and outputs an output bit s1.
  • the example of FIG. 12 further includes NAND circuits NAND113, 113 for inputting input bits a2, b2, NOR circuits NOR112 for inputting a2, b2, and EXOR circuit EXO112 for inputting a2, b2, and outputting h2.
  • the example of FIG. 12 further includes inverters INV113 and INV114 that invert the outputs of the NAND 113 and NOR 112 and output p2 and pg2, respectively.
  • FIG. 12 further includes inverters INV113 and INV114 that invert the outputs of the NAND 113 and NOR 112 and output p2 and pg2, respectively.
  • NAND126 NAND126
  • NAND126 which inverts NAND circuits NAND126, NAND126, and inverter 121 that invert p1 and p0 and outputs c2 and inputs NAND circuits NAND127, h2, and c2 that output c2.
  • An EXOR circuit EXO122 that outputs the bit s2 is included.
  • the example of FIG. 12 further includes EXOR circuits EXO113, p0, p1, and p2 that receive input bits a3 and b3 and outputs h3, NAND128 that receives p2, NAND circuits NAND129 that inputs p2, and an inverter INV122 that inverts g2. Have.
  • the example of FIG. 12 further includes NAND circuits NAND130 that input the outputs of NAND128, NAND129, and INV122, output c3, and an EXOR circuit EXO123 that inputs h3 and c3 and outputs an output bit s3.
  • the example of FIG. 12 further includes an EXOR circuit EXO130 that inputs the input parity bits ap and bp, and NAND circuits NAND121, NAND122, NAND123, and NAND124 that receive the values generated when the output bits s0 to s3 are generated.
  • EXOR circuit EXO130 that inputs the input parity bits ap and bp
  • NAND circuits NAND121, NAND122, NAND123, and NAND124 that receive the values generated when the output bits s0 to s3 are generated.
  • the example of FIG. 12 further includes an NAND circuit NAND125 that inputs the outputs of NAND121, NAND122, NAND123, and NAND124 and outputs pc, and an EXOR circuit EXO131 that inputs the output of pc and EXO130 and outputs the output parity bit sp.
  • EXOR circuit EXO130 that inputs the input parity bits ap and bp
  • the bits s0, s1, s2, and s3 of the operation result are generated in consideration of the carry generated from the operation result of the lower bits.
  • the A + B + 6 adder ADD3 will be described with reference to FIGS.
  • the 4 bits a0, a1, a2, a3 and b0, b1, b2, b3 of the input data A and B and the even parity bits ap and bp of the input data A and B are input.
  • the example of FIG. 13 outputs 4 bits s0, s1, s2, s3, and the parity bit sp of A + B + 6 (actually, A + B-10 as will be described later).
  • the example of FIG. 13 includes NAND circuits NAND211, 211 that input input bits a0, b0, EXOR circuit EXO210 that inputs h0 and outputs h0, and an inverter INV210 that inverts the output of NAND211 and outputs g0.
  • the example of FIG. 13 further includes a buffer BUF 220 that buffers h0 and outputs an output bit s0.
  • the example of FIG. 13 further includes NAND circuits NAND212, 212, which receive input bits a1, b1, NOR circuits NOR211, which receive input a1, b1, and EXOR circuit EXO211 which outputs h1.
  • FIG. 13 includes NAND circuits NAND211, 211 that input input bits a0, b0, EXOR circuit EXO210 that inputs h0 and outputs h0.
  • inverters INV211 and INV212 that invert the outputs of the NAND 212 and the NOR 211 to output p1 and g1, respectively, and an EXNOR circuit EXNO221 that inputs the h1 and g0 and outputs the output bit s1.
  • the example of FIG. 13 further includes an NAND circuit NAND213, a2, b2 to which the input bits a2, b2 are inputted, an NOR circuit NOR212, a2, 2b2 to which the EXOR circuit EXO212 is inputted.
  • the example of FIG. 13 further includes inverters INV213 and INV214 that invert the outputs of the NAND 213 and the NOR 212 and output p2 and g2, respectively.
  • the example of FIG. 13 further includes EXOR circuits EXO222 that input h2 and c2 and output output bit s2, and NAND circuits NAND248 and NAND249 that input respective outputs to NAND circuits NAND250 and NAND250 that output c2.
  • FIG. 13 further includes an EXOR circuit EXNO223 that inputs the EXOR circuits EXO213, h3, and c3 that input the input bits a3 and b3 and outputs h3, and outputs the output bit s3.
  • the example of FIG. 13 further includes NAND circuits NAND251, NAND252, NAND253, and NAND254 that input respective outputs to the NAND circuits NAND255 and NAND255 that output c3.
  • the example of FIG. 13 further includes an EXOR circuit EXO230 that inputs the input parity bits ap and bp, and NAND circuits NAND241, NAND242, NAND243, and NAND244 that receive the values generated when the output bits s0 to s3 are generated. , NAND245.
  • the example of FIG. 13 further includes NAND 246 and NAND 247 for inputting the outputs of NAND 241, NAND 242, NAND 243, NAND 244, and NAND 245, respectively.
  • EXOR circuit EXO230 that inputs the input parity bits ap and bp
  • NAND circuits NAND241, NAND242, NAND243, and NAND244 that receive the values generated when the output bits s0 to s3 are generated.
  • the example of FIG. 13 further includes NAND 246 and NAND 247 for inputting the outputs of NAND 241, NAND 242, NAND 243, NAND 244, and NAND 245, respectively.
  • 13 further includes an OR circuit OR211 that inputs the outputs of NAND247 and NAND248 and outputs pc, and an EXOR circuit EXO231 that inputs the output of pc and EXO230 and outputs the output parity bit sp.
  • the bits s0, s1, s2, and s3 of the operation result are generated in consideration of the carry and borrow generated from the operation result of the lower bits.
  • FIG. 13 shows that the result pattern of the lower 4 bits is the same when D + 6 and D-10 are performed for the numerical value D that can be expressed in 4 bits.
  • FIG. 15 shows a breakdown of carry and borrow generated from each bit.
  • bit indicates a bit number (number part of a2 to a0, b2 to b0), generate indicates a carry generated by the bit itself, and propagation of generate indicates propagation of a carry generated by a lower bit.
  • borrow indicates a borrow generated by the bit itself, and propagation of borrow indicates propagation of a borrow generated by a lower bit.
  • Equation 4 The following is a logical expression that summarizes the operation results s0, s1, s2, s3, the even parity sp of the operation result, the data inversion condition c0, c1, c2, c3 by carry or borrow, and the condition inversion condition pc. (Equation 4). Note that in the logical expression of Equation 4, the operator shown in Equation 1
  • the A + B + 7 adder ADD6 will be described with reference to FIGS.
  • the four bits a0, a1, a2, a3 and b0, b1, b2, b3 of the input data A and B and the even parity bits ap and bp of the input data A and B are input.
  • the example of FIG. 16 outputs 4 bits s0, s1, s2, s3 of the operation result of A + B + 7 (actually A + B-9 as described later) and its parity bit sp.
  • the example of FIG. 16 includes the NOR circuits NOR310, 310, a0, b0 that receive the input bits a0, b0, and the EXOR circuit EXO310, which outputs h0, and the inverter INV310 that inverts the output of the NOR310 and outputs p0.
  • the example of FIG. 16 further includes an inverter INV320 that inverts h0 and outputs an output bit s0.
  • the example of FIG. 16 further includes an EXOR circuit EXO311 which inputs NAND circuits NAND312, a1 and b1 to which input bits a1 and b1 are input, inputs NOR circuits NOR311, a1 and b1 to input h1.
  • the example of FIG. 16 further includes inverters INV311 and INV312 that invert the outputs of the NAND 312 and NOR 311 and output p1 and g1, respectively, and an EXOR circuit EXO321 that output
  • FIG. 16 further includes NAND circuits NAND313, a12, b2, and NOR circuits NOR312, a2 and b2, which receive input bits a2 and b2, and an EXOR circuit EXO312 which outputs h2.
  • the example of FIG. 16 further includes inverters INV313 and INV314 that invert the outputs of the NAND 313 and the NOR 312 and output p2 and g2, respectively.
  • the example of FIG. 16 further includes an EXOR circuit EXO322 that inputs h2 and c2 and outputs an output bit s2, and NAND circuits NAND366 and NAND367 that input respective outputs to NAND circuits NAND368 and NAND368 that output c2.
  • FIG. 16 further includes an EXOR circuit EXNO323 that inputs the input bits a3 and b3 and outputs h3, inputs the EXOR circuits EXO313, h3, and c3 and outputs the output bit s3.
  • the example of FIG. 16 further includes NAND circuits NAND369, NAND370, NAND371, and NAND372 that input the respective outputs to the NAND circuits NAND373 and NAND373 that output c3.
  • the example of FIG. 16 further includes an EXOR circuit EXO330 that inputs the input parity bits ap and bp, and NAND circuits NAND361, NAND362, NAND363, and NAND364 that receive the values generated when the output bits s0 to s3 are generated.
  • EXOR circuit EXO330 that inputs the input parity bits ap and bp
  • NAND circuits NAND361, NAND362, NAND363, and NAND364 that receive the values generated when the output bits s0 to s3 are generated.
  • the example of FIG. 16 further includes a NAND 365 that inputs the outputs of the NAND 361, NAND 362, NAND 363, and NAND 364, respectively.
  • the example of FIG. 16 further includes an EXOR circuit EXO331 that inputs the output pc of the NAND 365 and the output of the EXO 330 and outputs the output parity bit sp.
  • each bit s0, s1, s2, and s3 of the operation result is generated in consideration of the carry and borrow generated from the operation result of the lower bits.
  • FIG. 16 shows a breakdown of carry and borrow generated from each bit.
  • the A + B + 10 adder ADD2 will be described with reference to FIGS.
  • the four bits a0, a1, a2, a3 and b0, b1, b2, b3 of the input data A and B and the even parity bits ap and bp of the input data A and B are input.
  • the example of FIG. 18 outputs 4 bits s0, s1, s2, s3 of the calculation result of A + B + 10 (actually A + B-6 as described later) and its parity bit sp.
  • the example of FIG. 18 includes an NAND circuit NAND411, a0, b0 that inputs input bits a0, b0, an EXOR circuit EXO410 that outputs h0, and an inverter INV410 that inverts the output of NAND 411 and outputs g0.
  • the example of FIG. 18 further includes a buffer BUF 420 that buffers h0 and outputs an output bit s0.
  • the example of FIG. 18 further includes an EXOR circuit EXO411 that inputs NOR circuits NOR411, a1, and b1 that input NAND circuits NAND412 and a1 and b1 that input input bits a1 and b1 and outputs h1.
  • the example of FIG. 18 further includes inverters INV411 and INV412 that invert the outputs of NAND412 and NOR411 and output p1 and g1, respectively, and an EXNOR circuit EXNO421 that outputs an output bit s1.
  • FIG. 18 further includes an EXOR circuit EXO412 which inputs NAND circuits NAND413, a2 and b2 which input NAND circuits NAND413, a2 and ⁇ ⁇ b2 which input input bits a2 and b2 and which outputs h2.
  • the example of FIG. 18 further includes inverters INV413 and INV414 that invert the outputs of the NAND 413 and the NOR 412 and output p2 and g2, respectively.
  • FIG. 18 further includes an EXOR circuit EXO412 which inputs NAND circuits NAND413, a2 and b2 which input NAND circuits NAND413, a2 and ⁇ ⁇ b2 which input input bits a2 and b2 and which outputs h2.
  • the example of FIG. 18 further includes inverters INV413 and INV414 that invert the outputs of the NAND 413 and the NOR 412 and output p2 and g2, respectively.
  • EXNOR circuit EXNO422 that inputs h2 and c2 and outputs an output bit s2
  • NAND circuits NAND488 and NAND488 that input respective outputs to NAND circuits NAND488 and NAND488 that output c2.
  • FIG. 18 further includes an EXOR circuit EXO423 that inputs the EXOR circuits EXO413, h3, and c3 that input the input bits a3 and b3 and outputs h3, and outputs the output bit s3.
  • the example of FIG. 18 further includes NAND circuits NAND489, NAND490, NAND491, and NAND422 that input the respective outputs to NAND circuits NAND493 and NAND493 that output c3.
  • the example of FIG. 18 further includes an EXOR circuit EXO430 that inputs input parity bits ap and ⁇ bp, and NAND circuits NAND481, NAND482, NAND483, and NAND484 that receive values generated when generating the output bits s0 to s3 described above.
  • the example of FIG. 18 further includes a NAND 485 that inputs the outputs of the NAND 481, NAND 482, NAND 483, and NAND 484, respectively.
  • the example of FIG. 18 further includes an EXOR circuit EXO 431 that inputs the output pc of the NAND 485 and the output of the EXO 430 and outputs the output parity bit sp.
  • each bit s0, s1, s2, and s3 of the operation result is generated in consideration of the carry and borrow generated from the operation result of the lower bits.
  • a + B + 10 is obtained as it is, it becomes complicated to consider the case where double carry occurs. Therefore, in the example of FIG. 18, A + B-6 is calculated instead. .
  • a circuit is formed so that propagation of carry and borrow becomes exclusive, so that only one propagation path is required.
  • 6 is a 16's complement to 10, so in a 4-bit operation, the resulting bit pattern in 4 bits is the same for A + B + 10 and A + B-6.
  • FIG. 19 shows a breakdown of carry and borrow generated from each bit.
  • the A + B + 11 adder ADD5 will be described with reference to FIGS.
  • the four bits a0, a1, a2, a3 and b0, b1, b2, b3 of the input data A and B and the even parity bits ap and bp of the input data A and B are input.
  • the example of FIG. 20 outputs 4 bits s0, s1, s2, s3 of the calculation result of A + B + 11 (actually A + B-5 as described later) and its parity bit sp.
  • the example of FIG. 20 includes NOR circuits NOR510, NOR0, b0 that receive input bits a0, b0, and EXOR circuit EXO510, which outputs h0 and inverter INV510 that inverts the output of NOR510 and outputs p0.
  • the example of FIG. 20 further includes an inverter INV520 that inverts h0 and outputs an output bit s0.
  • the example of FIG. 20 further includes an EXOR circuit EXO511 that inputs NOR circuits NOR511, a1, and b1 that input NAND circuits NAND512, a1, and b1 that input input bits a1 and b1 and outputs h1.
  • the example of FIG. 20 further includes inverters INV511 and INV512 that invert the outputs of NAND 512 and NOR 511 and output p1 and g1, respectively, and an EXOR circuit EXO521 that outputs an output bit s1.
  • the example of FIG. 20 further includes an EXOR circuit EXO512 that inputs NAND circuits NAND513, a2, and b2 that input NAND circuits NAND513, a2, and b2 that input input bits a2 and b2, and that outputs h2.
  • the example of FIG. 20 further includes inverters INV513 and INV514 that invert the outputs of NAND 513 and NOR 512 and output p2 and g2, respectively.
  • the example of FIG. 20 further includes an EXNOR circuit EXNO522 that inputs h2 and c2 and outputs an output bit s2, and NAND circuits NAND5110 and NAND5109 that input respective outputs to NAND circuits NAND5110 and NAND5110 that output c2.
  • FIG. 20 further includes an EXOR circuit EXO523 that inputs the EXOR circuits EXO513, h3, and c3 that input the input bits a3 and b3 and outputs h3, and outputs the output bit s3.
  • the example of FIG. 20 further includes NAND circuits NAND5111, NAND5112, NAND5113, and NAND5114 that input respective outputs to NAND circuits NAND5115 and NAND5115 that output c3.
  • the example of FIG. 20 further includes an EXOR circuit EXO530 that inputs the input parity bits ap and bp, and NAND circuits NAND5101, NAND5102, NAND5103, and NAND5104 that receive the respective values generated when the output bits s0 to s3 are generated. , NAND5105.
  • the example of FIG. 20 further includes NAND 5106 and NAND 5107 that respectively input outputs of NAND 5101, NAND 5102, NAND 5103, NAND 5104, and NAND 5105.
  • EXOR circuit EXO530 that inputs the input parity bits ap and bp
  • NAND circuits NAND5101, NAND5102, NAND5103, and NAND5104 that receive the respective values generated when the output bits s0 to s3 are generated.
  • the example of FIG. 20 further includes NAND 5106 and NAND 5107 that respectively input outputs of NAND 5101, NAND 5102, NAND 5103, NAND 5104, and NAND 5
  • 20 further includes an OR circuit OR511 for inputting the outputs of NAND 5106 and NAND 5107, an output of pc and the output of EXO 530, and an EXOR circuit EXO 531 for outputting the output parity bit sp.
  • each bit s0, s1, s2, and s3 of the operation result is generated in consideration of the carry and borrow generated from the operation result of the lower bits.
  • FIG. 20 shows a breakdown of carry and borrow generated from each bit.
  • each of the segment absolute value adders DAD0, DAD1,..., DADm shown in FIG. 8 in the first embodiment is not a digit unit but a plurality of digit units. That is, in the case of the second embodiment, each of the segment absolute value adders DAD0, DAD1,..., DADm, for example, the segment absolute value adder DAD1 has a plurality (as shown in FIG. ) Digit adder blocks DAB1 to DAB4.
  • the segment absolute value adder shown in FIG. 22 has a local carry look ahead circuit LCLA1.
  • the local carry look-ahead circuit LCLA1 performs carry propagation logic within a 4-digit unit, ie, four digit adder blocks DAB1-DAB4. Therefore, in the case of the second embodiment, the block carry propagation circuit BCP1 shown in FIG. 8 generates a carry in units of 4 digits and supplies it to the segment absolute value adders DAD0, DAD1,.
  • carry propagation logic is divided into the internal (local carry look ahead circuit LCLA1) and the external (block carry propagation) of each of the 4-digit unit absolute value adders DAD0, DAD1,.
  • the circuit BCP1) is hierarchized. As a result, carry propagation logic can be executed in parallel (parallel processing) in each of the segment absolute value adders DAB1 to DAB4 (local carry look ahead circuit LCLA1) and outside (block carry propagation circuit BCP1). it can.
  • FIG. 23 shows an example of the configuration of each of the digit adder blocks DAB1 to DAB4 shown in FIG. 22, for example, the digit adder block DAB3.
  • the digit adder block according to the second embodiment shown in FIG. 23 has the same configuration as that of the segment absolute value adder shown in FIG. 9, and the corresponding components are denoted by the same reference numerals, and redundant description is given. Omitted.
  • the digit adder block shown in FIG. 23 is different from the segment absolute value adder shown in FIG. 9 in that selectors SEL21, SEL22, SEL23, and SEL24 are provided.
  • the local carry look ahead circuit LCLA1 shown in FIG. 22 performs the following operation. That is, the local carry look-ahead circuit LCLA1 has a 4-digit unit input data A and B and a 4-digit unit carry BCin (BCin for recomp or BCin for non-recomp) supplied from the block carry propagation circuit BCP1 as 0. The following operation is performed so that any one of the above can be supported. In accordance with the carry propagation logic in a well-known binary arithmetic unit included in the local carry look-ahead circuit LCLA1, a carry in units of digits is generated.
  • the selectors SEL15 and SEL16 perform a selection output operation in accordance with the 4-digit unit signal BCin for non-recomp or BCin for recomp supplied from the block carry propagation circuit BCP1, respectively.
  • the selector SEL17 also performs a selective output operation according to the signal RECOMP shown in FIG.
  • FIG. 24 shows an example of the configuration of the digit unit segment absolute value adder according to the third embodiment.
  • a gate for taking the logic of the BINARY_MODE signal is added to the part that controls the operation of the selectors SEL11, SEL12, SEL13, and SEL14 by the digit carry out signal.
  • the gates to be added are an OR circuit OR51, an AND circuit AND51, an OR circuit OR52, and an AND circuit AND52.
  • a digit carry out signal and a BINARY_MODE signal are input to the OR circuit OR51, AND circuit AND51, OR circuit OR52, and AND circuit AND52.
  • the BINARY_MODE signal is 0 when a decimal operation is selected, and 1 when a binary operation is selected.
  • the OR circuit OR51 passes the digit carry out signal from the adder ADD1 as it is.
  • the configuration is the same as in the case of FIG. 9, and a decimal arithmetic operation equivalent to the case of FIG. 9 is executed for s0.
  • the selector SEL11 always selects the operation result of the adder ADD1.
  • the AND 51 that controls the operation of the selector SEL12 that outputs rs0 via the inverter INV5 executes AND logic of the inverted value of the BINARY_MODE signal and the digit carry out signal. For this reason, when the BINARY_MODE signal is 0, the selector 12 is controlled by the digit carry out signal, and the decimal arithmetic operation equivalent to the case of FIG. 9 is executed with respect to the signal rs0. On the other hand, when the BINARY_MODE signal is 1, the AND 51 always outputs 0, and as a result, the selector 12 always selects the operation result of the adder ADD1.
  • the control of the selector SEL13 that outputs s1 and the selector SEL14 that outputs rs1 via the inverter INV6 is the same as in the case of s0 and rs0 described above. That is, when the BINARY_MODE signal is 0, the circuit of FIG. 24 performs a decimal operation equivalent to the circuit of FIG. On the other hand, when the BINARY_MODE signal is 1, s0 is always the operation result (A + B) of the adder ADD1, and rs0 is the 2's complement of the operation result (A + B) of the always adder ADD1. When the BINARY_MODE signal is 1, s1 is always the calculation result (A + B + 1) of the adder ADD4, and rs1 is the two's complement of the calculation result (A + B + 1) of the constant adder ADD4.
  • the circuit of FIG. 24 performs an operation equivalent to that of a 4-bit wide binary absolute value adder.
  • the block carry propagation circuit BCP1 (see FIG. 8) which generates the signal BCin for non-recomp and the signal BCin for recomp has the carry propagation logic in the binary arithmetic unit as described above. Therefore, the condition for creating the signal RECOMP by the block carry propagation circuit BCP1 also follows the carry propagation logic in the binary arithmetic unit. Therefore, in the third embodiment, the circuit configuration of the segment absolute value adder shown in FIG. 9 of the first embodiment in the configuration of the decimal absolute value adder main body of FIG. 8 is replaced with the circuit configuration of FIG.
  • the decimal absolute value adder shown in FIG. 2 includes a binary absolute value adder including a decimal absolute value adder body in which the segment absolute value adder is replaced with the circuit configuration of FIG. Can be used as well.
  • a decimal absolute value adder body in which the segment absolute value adder is replaced with the circuit configuration of FIG. 24 is referred to as an absolute value adder body 15X.
  • the part that is preliminarily performed +6 so as to operate as a decimal arithmetic unit that is, for example, the adder circuit 11 in FIG.
  • the example of the overall configuration of the decimal absolute value adder shown in FIG. 3 is changed as shown in FIG. 25 in the third embodiment. That is, the selector 17 is inserted, and the selector 17 supplies the operand op1 as it is to the selector 14 when the BINARY_MODE signal is 1, that is, at the time of binary calculation.
  • the BINARY_MODE signal is 0, that is, at the time of a decimal operation, as described above, +6 is added to the operand op1 in digit units by the adder circuit 11, and then supplied to the selector 14.
  • a 1's complement for the operand op1 is taken by the 1's complement circuit 12 and supplied to the absolute value adder body 15X.
  • the value obtained by performing +6 on each digit of the operand op1 is the absolute value adder body 15X.
  • the 1's complement circuit 12 supplies a value equivalent to the value obtained by taking 9's complement for each digit of the operand op1 and performing +6 to the absolute value adder body 15X.
  • the BINARY_MODE signal makes it possible to operate the decimal absolute value adder as a binary absolute value adder or as a decimal absolute value adder.

Landscapes

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

Abstract

 2つのオペランドを加算して第1の演算結果を得、2つのオペランド及び10を加算して第2の演算結果を得、2つのオペランド及び6を加算して第3の演算結果を得、2つのオペランド及び1を加算して第4の演算結果を得、2つのオペランド及び11を加算して第5の演算結果を得、2つのオペランド及び7を加算して第6の演算結果を得、演算が同符号の数同士の加算である場合、又は結果が負にならない異符号の数同士の加算である場合、第1、第2、第4及び第5の演算結果のうちの何れかの演算結果を選択し、演算が、結果が負となる異符号の数同士の加算である場合、第1、第3、第4及び第6の演算結果のうちの何れかの1の補数を選択して10進絶対値加算結果を出力する。

Description

10進絶対値加算器
 本発明は、10進絶対値加算器に関する。
 以下の構成を有する10進演算訂正機能付加算器が知られている。10進演算訂正機能付加算器では、10進数の各桁毎に加数と被加数とのビットパターンに基づいて、下位桁からの桁上げ信号がないと仮定したときの加算結果と下位桁からの桁上げ信号が有ると仮定した場合の加算結果とを抽出する。そして、下位桁からの桁上げ信号の有無と当該桁からの桁上げ信号の有無とにより10進演算訂正を行った加算結果を選択的に抽出する。
 又、以下の構成を有する10進演算回路が知られている。10進演算回路では、第1のオペランド-第2のオペランドの主演算時に、並行して第2のオペランド-第1のオペランドの演算を行う演算手段を設ける。そして上記主演算の結果が負となった際に、主演算の結果値に代えて、上記演算手段による演算結果値を選択して出力する。これにより、補数処理を不要とし、リコンプリメント(再補数化)時における演算処理の遅れを無くし処理性能を向上する。
 又、以下の構成を有する減算器が知られている。減算器では、互いに符号が等しい2つのオペランドを入力する。そして、第1のオペランドの絶対値から第2のオペランドの絶対値を減じる1番目の減算と、第2のオペランドの絶対値から第1のオペランドの絶対値を減じる2番目の減算とを並列に実行する。又1番目の減算を行う減算回路に減算の過程でオーバーフローが発生した場合はこれを検出してキャリー信号を生成し、キャリー信号によって、1番目の減算結果と2番目の減算結果との中から正しいものを選択する。これによって、どのようなオペランドの組み合わせに対しても常に1回の減算により正しい解を得ることができるので、減算器の効率を高めることができる。
特開昭54-054542号公報 特開昭59-201144号公報 特開平1-086238号公報
 処理時間を効果的に短縮可能な構成の10進絶対値加算器を提供することが課題である。
 実施例の10進絶対値加算器では、10進数の一桁につき、2つのオペランドを加算して第1の演算結果を得、2つのオペランド及び10を加算して第2の演算結果を得、2つのオペランド及び6を加算して第3の演算結果を得る。更に、2つのオペランド及び1を加算して第4の演算結果を得、2つのオペランド及び11を加算して第5の演算結果を得、2つのオペランド及び7を加算して第6の演算結果を得る。そして、2つのオペランドに対する演算が同符号の数同士の加算である場合、或いは演算結果が負とはならない異符号の数同士の加算である場合、以下の演算結果を選択する。すなわち、第1の演算結果、第2の演算結果、第4の演算結果及び第5の演算結果のうちの何れかの演算結果を選択する。又、2つのオペランドに対する演算が、演算結果が負となる異符号の数同士の加算である場合、以下の演算結果を選択する。すなわち、第1の演算結果、第3の演算結果、第4の演算結果及び第6の演算結果のうちの何れかの演算結果に対し1の補数をとった値を選択する。
 上記構成の10進絶対値加算器により、10進絶対値加算結果を得るための処理時間を効果的に短縮することができる。
BCD(Binary Coded Decimal)コードと10進数との対応関係を示す図である。 本発明の実施例1又は2として適用可能な10進絶対値加算器の全体構成の一例を示すブロック図である。 本発明の実施例1又は2に適用可能な10進絶対値加算器の全体構成の他の例を示すブロック図である。 図2或いは図3に示す10進絶対値加算器本体(decimal absolute adder)の構成の一例を示すブロック図である。 図2に示す9の補数化回路(9's comp)の回路構成の一例を示す図である。 図2或いは図3に示す10進絶対値加算器本体(decimal absolute adder)の構成の他の例を示すブロック図である。 図4或いは図6に示すBCD補正回路(BCD adjust)の回路構成の一例を示す図である。 本発明の実施例1の10進絶対値加算器本体の構成を示すブロック図である。 図8に示すセグメント絶対値加算器(10進数の一桁分の絶対値加算器)の各々の内部構成の一例を示すブロック図である。 図8に示すブロックキャリー伝播回路(Block carry propagate)を、図9に示す再補数化時のブロックキャリーイン信号(BCin for recomp)及び非再補数化時のブロックキャリーイン信号(BCin for non-recomp)を夫々生成する2つの2進キャリールックアヘッド回路で形成する場合のブロックキャリー伝播回路の構成の一例を示すブロック図である。 図9に示す4ビット加算器(A+B)の回路構成の一例を示す回路図である。 図9に示す4ビット加算器(A+B+1)の回路構成の一例を示す回路図である。 図9に示す4ビット加算器(A+B+6)の回路構成の一例を示す回路図である。 4ビットで表現される数に対し、6を加算した場合(D+6)及び10を減算した場合(D-10)の、下位4ビット演算結果のビットパターンを比較して示す図である。 図13の回路例において、各ビットから生成されるキャリー及びボローの内訳を示す図である。 図9に示す4ビット加算器(A+B+7)の回路構成の一例を示す回路図である。 図16の回路例において、各ビットから生成されるキャリー及びボローの内訳を示す図である。 図9に示す4ビット加算器(A+B+10)の回路構成の一例を示す回路図である。 図18の回路例において、各ビットから生成されるキャリー及びボローの内訳を示す図である。 図9に示す4ビット加算器(A+B+11)の回路構成の一例を示す回路図である。 図20の回路例において、各ビットから生成されるキャリー及びボローの内訳を示す図である。 本発明の実施例2におけるセグメント絶対値加算器(実施例2の場合、10進数の4桁分の絶対値加算器)の各々の内部構成の一例を示すブロック図である。 図22に示す10進数の一桁分の絶対値加算器(digit adder block)の内部構成の一例を示すブロック図である。 本発明の実施例3における10進数の一桁分の絶対値加算器(digit adder block、図8中、セグメント絶対値加算器)の内部構成の一例を示すブロック図である。 本発明の実施例3における10進絶対値加算器の全体構成の一例を示すブロック図である。
 以下に本発明の実施例につき詳細に説明する。
 最初に絶対値加算器について説明する。2進絶対値加算器とは以下の動作を行う演算器である。すなわち、減算時に減数オペランドに対し2の補数をとって得た結果を非減数オペランドに加算する。そして減算結果が負となる場合には加算結果に対し2の補数をとる(再補数化)ことで減算結果の絶対値を得る。
 10進絶対値加算器とは以下の動作を行う演算器である。すなわち、減算時に減数オペランドに対し10の補数をとって得た結果を非減数オペランドに加算する。そして減算結果が負となる場合には加算結果に対し10の補数をとる(再補数化)ことで減算結果の絶対値を得る。
 本発明の実施例1は以下の特徴を有する。
(1)BCD(Binary Coded Decimal: 2進化10進数)コードで表現された数値を演算する10進絶対値加算器である。
(2)高速2進加算器を使って10進加算器を実現することにより、高速な10進絶対値加算器を実現することができる。
(3)高速10進絶対値加算器を実現するにあたって、2進加算器のディジット(digit)単位に、A+B、A+B+1、A+B+6、A+B+7、A+B+10、A+B+11に相当する部分和を求める回路を設ける。ここでディジットとは10進数の一桁(すなわちBCDコードにおいて4ビット分)を意味し、A,Bは夫々ディジット単位のオペランドを示す。したがって部分和とはディジット単位の和を意味する。
(4)加算時には、キャリー(すなわち桁上がり、以下同様)条件によって、A+B、A+B+1、A+B+10、A+B+11を用いて演算結果を求める。
(5)減算時に、結果が正になるときは、キャリー条件によって、A+B、A+B+1、A+B+10、A+B+11を用いて結果を求める。他方、結果が負になるときは、キャリー条件によって、A+B、A+B+1、A+B+6、A+B+7の夫々の1の補数をとって絶対値化する。すなわち、負の減算結果の絶対値を得る。
(6)上記A+B+6、A+B+7、A+B+10、A+B+11に相当する部分和を、通常のCLA(Carry Look Ahead)型4ビット加算器と同程度の規模と速度で求めることができる。
 参考のために図1にBCDコードの2進数による表現と10進数との対応関係を示す。
 本発明の実施例1における、高速2進加算器をつかった10進加算器を実現する方式は以下の通りである。
 加算(すなわち同符号の数同士の加算)時には、片方のオペランドの各ディジットに対し、あらかじめ+6を行うことで、高速2進加算器でディジット間でキャリーが伝播できるようにする。すなわち9(2進数による表現で、1001)を15(2進数による表現で、1111)にマッピングしておくことにより、1を加えたときに、2進加算器でディジットのキャリーを1にできる。
 この方式では、ディジットから桁上がりがない場合、上記+6の分が除去されないため、演算結果は+6の分が余分となっている。このため、ディジットからの桁上がりがない場合には、演算結果のディジットに対して-6を行なうことでBCDコード化する。
 減算(すなわち異符号の数同士の加算)時には、減数オペランドに対し1の補数をとる。この操作は、減数オペランドの各ディジットに対し、9の補数をとった上で+6を行う操作と等価である。そして、高速2進加算器において最下位のCin(キャリーイン;下位からの桁上がりに相当)入力を1にして、被減数オペランドに対し、上記減数オペランドに対し1の補数をとって得た値を加算する。最下位のCin入力を1にするのは上記9の補数を10の補数にするためである。上記した加算時同様、ディジットから桁上がりがない場合には、上記+6の分が余分となっている。このため、ディジットからの桁上がりがない場合には、結果のディジットに対して-6を行なうことでBCDコード化する。つまり、減算時は、減数オペランドの補数(10の補数)をあらかじめ作成した上で、加算時と同様の演算を行う。
 図2に、高速2進加算器を使う方式による10進絶対値加算噐の、前処理の補正を行う部分を含めた全体構成の一例を示す。また、上記の如く9の補数をとってから+6を行う代りに1の補数をとる場合の全体構成の一例を図3に示す。
 図2に示す10進絶対値加算器は、第1オペランドop1に対しディジット単位で+6を行う加算回路11、第1オペランドop1に対しディジット単位で9の補数をとる9の補数化回路12及び9の補数をとった後に+6を行う加算回路13を有する。更に、加算回路11及び加算回路13のうちのいずれかの出力を選択するセレクタ14及び10進絶対値加算器本体15を有する。加算回路11、9の補数化回路12,加算回路13及びセレクタ14が、上記前処理の補正を行う部分である。セレクタ14は、演算が減算の場合に1の値を有し、加算の場合に0の値を有する信号SUBが0を有する場合に加算回路11の出力を選択して10進絶対値加算器本体15に出力する。又、信号SUBが1を有する場合に加算回路13の出力を選択して10進絶対値加算器本体15に出力する。10進絶対値加算器本体15は、セレクタ14の出力値と第2オペランドop2との10進絶対値加算を行い、10進絶対値加算結果resultを出力する。
 図3に示す10進絶対値加算器は図2に示す10進絶対値加算器と同様の構成を有し、同様の構成要素には同一の符号を付し、重複する説明を省略する。図3に示す10進絶対値加算器は、図2に示す構成における9の補数化回路12及び加算回路13の代わりに、第1オペランドop1に対しディジット単位で1の補数をとる1の補数化回路16を有する。
 図2或いは図3に示す10進絶対値加算器の全体構成のうち、加算時に+6を行う加算回路11や減算時に9の補数をとって+6操作する9の補数化回路12及び加算回路13(或いは1の補数化回路16)には周知技術を適用することができる。
 図4に、図2或いは図3に示す10進絶対値加算器の全体構成のうち、10進絶対値加算器本体15の構成の一例を示す。
 図4に示す例による10進絶対値加算器本体は、2進加算器21と、再補数化検出回路22と、BCD補正回路23と、9の補数化回路24と、BCDインクリメント回路25と、セレクタ26とを有する。図4における2つの入力A、Bのうち、入力Aは、例えば以下の値である。すなわち、Aは、例えば図2或いは図3に示す第1オペランドop1に対し、加算回路11或いは9の補数化回路12及び加算回路13による処理を行って得た結果、或いは加算回路11或いは1の補数化回路16による処理を行って得た結果である。他方Bは、図2或いは図3に示す第2オペランドである。尚、AとBとは論理的に交換可能な等価な値であるため、AとBとを相互に交換してもよい。
 再補数化検出回路22は、2進加算器21による加算結果に対する再補数化が必要か否かを判定し、再補数化が必要な場合1をセレクタ26に出力し、不要な場合0をセレクタ26に出力する。再補数化検出回路22には2進加算器21からのキャリー出力信号carryと、第1オペランドop1及び第2オペランドop2に対する演算が減算(すなわち異符号の数同士の加算、以下同様)か否かを示す信号SUBとが入力される。再補数化検出回路22は、キャリー出力信号carryの値に関わらず、信号SUBが加算(すなわち同符号の数同士の加算、以下同様)を示す場合0を出力する。他方、信号SUBが減算を示す場合、キャリー出力信号carryが1の場合(減算結果が正で再補数化不要時)0を出力し、キャリー出力信号carryが0の場合(減算結果が負で再補数化必要時)1を出力する。
 したがって再補数化検出回路22は、演算が加算の場合0を、演算が減算の場合であって減算結果が正で再補数化が不要の場合0を、演算が減算の場合であって減算結果が負で再補数化が必要な場合1を、夫々出力する。再補数化検出回路22の出力信号に応じ、セレクタ26は、演算が加算の場合BCD補正回路23の出力値を、演算が減算の場合であって減算結果が正で再補数化が不要の場合もBCD補正回路23の出力値を夫々出力する。又、セレクタ26は、演算が減算の場合であって減算結果が負で再補数化が必要な場合BCDインクリメント回路25の出力値を出力する。
 図4に示す10進絶対値加算器本体では、第1オペランドop1及び第2オペランドop2に対する演算が加算(すなわち同符号の数同士の加算)の場合には、以下の処理を行う。すなわち、図2或いは図3に示す加算回路11にて第1オペランドop1であるBCDコードの数の各ディジットに+6を行った数Aと、第2オペランドop2であるBCDコードの数Bとを、2進加算器21で2進数として加算する。
 ここでセレクタ26は、前述の如く、第1オペランドop1及び第2オペランドop2に対する演算が加算(すなわち同符号の数同士の加算)の場合、BCD補正回路23の出力を選択して出力する。BCD補正回路23では、2進加算器21の出力値に対し、ディジット単位で、上記の如く+6が余分な場合に-6を行う補正を行い、BCD補正回路23の出力値がセレクタ26に入力される。BCD補正回路23からの10進絶対値加算結果resultがセレクタ26から出力される。
 他方、演算が減算(すなわち異符号の数同士の加算)の場合、入力データA,Bに対し、以下の処理がなされる。ここで入力データAは、図2或いは図3に示す9の補数化回路12及び加算回路13或いは1の補数化回路16にて第1オペランドop1であるBCDコードの各ディジットに対し9の補数をとった上で+6を行い或いは1の補数をとって得たデータである。又、入力データBは、第2オペランドop2であるBCDコードである。入力データA,Bは、2進加算器21で2進数として加算される。なお、この場合、上記の如く上記9の補数を10の補数にするため、2進加算器21において最下位のCin入力(図4では図示を省略)を1として加算を行う。
 ここでセレクタ26は、前述の如く、第1オペランドop1及び第2オペランドop2に対する演算が減算であって、結果が負でない場合、BCD補正回路23の出力を選択して出力する。BCD補正回路23では、2進加算器21の出力値に対し、ディジット単位で、上記の如く+6が余分な場合に-6を行う補正を行い、BCD補正回路23の出力値がセレクタ26に入力される。BCD補正回路23からの10進絶対値加算結果resultがセレクタ26から出力される。
 他方、セレクタ26は、前述の如く、第1オペランドop1及び第2オペランドop2に対する演算が減算であって、結果が負である場合(再補数化が必要な場合)、9の補数化回路24に接続されたBCDインクリメント回路25を選択して出力する。この場合、9の補数化回路24はBCD補正回路23の出力値に対しディジット単位で9の補数をとり、更にBCDインクリメント回路25がディジット単位で9の補数化回路24の出力値に1を加えて10の補数を得る。BCDインクリメント回路25からの10進絶対値加算結果resultがセレクタ26から出力される。
 図5は上記9の補数化回路12、24の回路構成の一例を示す。図5の9の補数化回路は、否定論理和回路(以下単にNORと称する)回路NOR1,排他的論理和(以下単にEXORと称する)回路EXO1,バッファBUF1,論理積(以下単にANDと称する)回路AND1,インバータINV1及びEXOR回路EXO2を含む。
 図5の9の補数化回路には、1ディジット分のBCDコードの第1乃至第4ビットa3, a2, a1, a0及びパリティビットapが入力される。9の補数化回路は、BCDコードに対し9の補数をとって得たBCDコードの第1乃至第4ビットx3, x2, x1, x0及びパリティビットxpを出力する。すなわち、NOR回路NOR1はa3, a2, a1が入力されx3を出力する。EXOR回路EXO1はa2, a1が入力されx2を出力する。バッファBUF1はa1が入力されx1を出力する。インバータINV1はa0が入力されx0を出力する。AND回路AND1はa2と、a1がインバータINV2で反転された値とが入力され、EXO2でAND1の結果とapと排他的論理和をとって、xpを出力する。
 図6は、図4と共に上述した10進絶対値加算器本体の他の例を示す。図6の例は、図4の例におけるBCDインクリメント回路25による処理が、10進絶対値加算器が扱う10進数の桁数が多いほど長い時間を要することに鑑み、BCDインクリメント回路を使わないようにした例である。
 図6の例では、演算が加算の場合、2進加算器31、BCD補正回路33及び再補数化検出回路22が、図4の例における2進加算器21、BCD補正回路23及び再補数化検出回路22に夫々対応し、夫々同様の機能を奏する。すなわち、図2又は図3における加算器11が第1オペランドop1のBCDコードの各ディジットに+6を行って得た数Aと、第2オペランドop2とを、2進加算器31が2進数として加算する。そしてBCD補正回路33が、上記の如く、ディジット単位で-6を行う必要がある場合には、-6を行う。そしてBCD補正回路33からの10進絶対値加算結果resultがセレクタ26から選択出力される。
 ここで図7に、1ディジット分のBCD補正回路23,33,34の回路構成の一例を示す。図7のBCD補正回路は、EXOR回路EXO3,EXO4,減算回路SUB1及びセレクタSEL1を含む。EXOR回路EXO3は、上記入力データA,Bの1ディジットの直上の1ビットをそれぞれA[4]、B[4]とし、それらのEXORをとる。A[4]、B[4]は該当するビットが存在しないときは0であるとする。EXO4は、EXO3の出力と2進加算器の出力Dの当該ディジットの直上の1ビットをD[4]とし、それらに対しEXORをとる。D[4]に該当するビットが存在しないときは、D信号を出力している加算器のキャリー出力を代わりとして使用する。その結果、A+Bの演算結果の桁上がりが無い場合には、EXO4は0を出力し、A+Bの演算結果の桁上がりが有る場合には、EXO4は1の値を出力する。セレクタSEL1は、A+Bの演算結果の桁上がりが無い場合(0)には減算回路SUB1の出力値を選択出力し(-6の補正有り)、A+Bの演算結果の桁上がりが有る場合(1)にはDを選択出力する(-6の補正無し)。
 図6の例の説明に戻り、演算が減算時には、入力データA,Bに対し、以下の処理がなされる。ここで入力データAは、図2或いは図3に示す9の補数化回路12及び加算回路13或いは1の補数化回路16にて第1オペランドop1であるBCDコードの数の各ディジットに対し9の補数をとった上で+6を行い或いは1の補数をとって得たデータである。入力データBは、第2オペランドop2であるBCDコードである。入力データA,Bを2進加算器31が2進数として加算する。なおこの場合、上記の如く上記9の補数を10の補数にするため、2進加算器31の最下位においてCin入力(図4では図示を省略)を1として加算を行う。
 ここでセレクタ26は、前述の如く、第1オペランドop1及び第2オペランドop2に対する演算が減算であって、結果が負でない場合、BCD補正回路33の出力を選択出力する。BCD補正回路33では、2進加算器31の出力値に対し、ディジット単位で、上記の如く+6が余分な場合に-6を行う補正を行い、BCD補正回路33の出力値がセレクタ26に入力される。BCD補正回路23からの10進絶対値加算結果resultがセレクタ26から出力される。
 他方、セレクタ26は、前述の如く、第1オペランドop1及び第2オペランドop2に対する演算が減算であって、結果が負である場合(再補数化が必要な場合)、9の補数化回路24の出力値を選択出力する。ここで9の補数化回路24には図6に示すように、2進加算器32の出力値がBCD補正回路34を経た値が入力される。この場合、2進加算器32では、最下位のCin入力が0とされて2進数の加算が行われ、加算結果がBCD補正回路34に入力される。そして9の補数化回路24はBCD補正回路34の出力値に対し9の補数をとり、このようにして得られた10進絶対値加算結果resultがセレクタ26から出力される。この場合、上記の如く、2進加算器32において最下位のCin入力が0とされて2進数の加算がなされるため、図4の例の場合とは異なり、BCDインクリメント回路による+1の処理は不要となる。その結果、図6の例の場合、BCDインクリメント回路は不要となる。又、図6の例において演算が減算の場合、2進加算器31,32は加算処理を並行して行い、BCD補正回路33,34も補正処理を並行して行う。その結果、処理時間を短縮できる。
 ここで、ディジット単位の10進加算器の構成例として、特許文献1に記載された例について説明する。この例では、ディジット自身の桁上がりCoutにのみ依存する信号線2本と、外部からの桁上がりCinと上記Coutとの両方に依存する信号線4本とを並列に設ける。そしてこれら計6本の信号線による条件と、上記Cin又はCoutの条件とのAND論理を夫々とり、夫々のAND論理の結果のOR論理をとることでBCD 補正処理の高速化を図る。特許文献1の構成例では、A+B+Cinの結果と、それを10進補正(-6の処理)した結果とを、外部からの桁上がり信号(Cin)とディジット自身の桁上がり信号(Cout)によって選択する。また、このCin信号とCout信号は公知のキャリールックアヘッド回路により作成する。しかもこのCout信号は、上位ディジットに対するCin信号と等価でなければならない。このため、Cin信号とCout信号とは共に2つのディジットを駆動することになる。又、論理式の変形により、Cin信号及びCout信号とのAND論理を最終段でとるようにしている。そして、ワイヤードOR論理が使用できることを利用して、多数の信号に対し、一度にまとめてOR論理をとることで処理の高速化を図っている。
 又、10進減算時に結果を絶対値にする方法として、特許文献2及び特許文献3に開示された技術などがあるが、いずれの技術においても、加算器もしくは減算器を2セット使い、夫々によってA-BとB-Aとの演算を並行して行う。特許文献2の構成では、上記2つの演算結果をレジスタに格納後に選択をする。
 ここで図4及び図6とともに上述した夫々の構成によれば、2進加算器で加算した結果に対してBCD化補正を行うため、演算処理に時間を要する点が考えられる。又、減算時には、さらに、9の補数を作成する処理時間が必要とされる。
 更に図4の例では、減算時にBCDインクリメント回路25による処理も必要とされ、桁数の多い演算器ほど減算処理に時間を要する。
 又、2進加算器による加算処理、BCD補正回路による補正処理及び再補数化処理をシーケンシャルに実行する構成の場合、2進加算器は汎用的な機能回路であるために高速2進加算器を半導体メーカーがIPコア(Intellectual Property Core)として用意している場合があり、それが使用可能となるメリットがある。しかしながら10進補正や、再補数化により処理時間が増加する点が考えられる。
 又、特許文献1に開示された方法では、Cin信号とCout信号とを両方とも外部のキャリールックアヘッド回路から得ることにより、本来Cinのみて済むクリティカルパス数がCinとCoutとの2つに増加する。しかもこのCout信号は、上位ディジットに対するCin信号と等価でなければならないため、Cin信号とCout信号とで共に2つのディジットを駆動することになり、負荷が増加する。その結果、生成に時間を要するキャリー伝播信号としてのCin信号及びCout信号の生成に要する時間が更に増加する可能性がある。また、本来4つの演算結果で済むところをあえて6つに増やすことで、各信号の作成に要する段数を減らした上で、ワイヤードOR論理に頼って高速化する。このため、スタティックCMOS等のワイヤードOR論理が使用できないデバイスでは、多数の信号のOR論理を取るのに時間がかかる。その結果、かえって外部からのCin/Cout信号との論理をとる処理に要する時間が増加する可能性がある。また、一旦演算結果を得たあとで10進補正を行うという方法では、10進補正を行うパスの処理の方が時間を要する可能性がある。
 又、特許文献2及び特許文献3に示された構成のように、減算のために加算器を2セット使う方法では回路規模が大きくなる可能性がある。又、特許文献2の構成の場合、レジスタの物量も2倍となる。
 本発明の実施例1によれば、上述の状況に鑑み、演算処理に要する時間を効果的に短縮し得る10進絶対値加算器を提供することができる。
 本発明の実施例1では、2進加算器を使用するディジット単位の加算器内のディジット演算器として以下に述べる構成を設ける。すなわち、後述する図9に示す如く、A+B, A+B+10, A+B+6, A+B+1, A+B+11, A+B+7の夫々の演算を並列に実行する加算器ADD1,ADD2,ADD3,ADD4,ADD5,ADD6を設ける。これらの加算器ADD1,ADD2,ADD3,ADD4,ADD5,ADD6のうち、A+B, A+B+10, A+B+6を夫々行う加算器ADD1,ADD2,ADD3は、下位からの桁上がりがない場合の演算結果を生成する。他方、A+B+1, A+B+11, A+B+7を夫々行う加算器ADD4,ADD5,ADD6は、下位からの桁上がりがある場合の演算結果を生成する。
 そして演算結果に対し再補数化の必要がなく下位からの桁上がりがない場合の演算結果は、A+Bの加算器ADD1とA+B+10の加算器ADD2とで計算する。そして、A+Bの加算器ADD1のキャリー出力信号digit carry outに基づいてBCD化補正の要否を判定する。ここでBCD化補正とは、例えば図4、6、7等とともに上述したBCD補正回路23,33,34によって行う、-6を行う補正を意味する。BCD化補正が不要な場合にはA+Bの加算器ADD1の演算結果を使用し(s0)、BCD化補正が必要な場合にはA+B+10の加算器ADD2の演算結果を使用する(s0)。ここで10は6に対する16の補数であることから、4ビットに閉じた計算ではA+B+10はA+B-6と等価である。このため、BCD化補正(-6)が必要な場合、A+B+10の加算器ADD2を使用する。
 又、再補数化の必要がなく下位からの桁上がりがある場合の演算結果は、桁上がりの+1を考慮し、A+Bに1を加えるA+B+1の加算器ADD4とA+B+10に1を加えるA+B+11の加算器ADD5とで計算する。この場合も上記下位からの桁上がりがない場合同様、A+B+1の加算器ADD4のキャリー出力信号digit carry outに基づいてBCD化補正の要否を判定する。BCD化補正が不要な場合にはA+B+1の加算器ADD4結果を使用し(s1)、BCD化補正が必要な場合にはA+B+11の加算器ADD5の結果を使用する(s1)。
 このように実施例1による方法では、BCD化補正の要否の判定はディジット内で完結し、たかだか4ビット分のキャリールックアヘッドの実行に要される遅延時間で行うことができるため、高速化が可能である。
 又、再補数化のための補数化処理は、BCDコードによる10進演算のため9の補数をとる必要がある。9の補数化回路の一例は上述した図5に示すものであるが、図5の例の場合、x3を作成する3入力NOR回路NOR1や、x2を作成するEXOR回路EXO1は、比較的動作時間を要するゲートである。又図5の例では、補数化に伴うディジットのパリティの予測を行う構成として、インバータINV2,AND回路AND1,EXOR回路EXO2を要し、ゲート3段を要する。
 これに対し図9に示す実施例1の構成では、図5のような比較的時間を要する回路を使用する代わりに、1の補数化回路として、演算結果rs0やrs1を作成するインバータ1段(INV5,INV6)を使用することにより、高速化を図る。1の補数をとることによってディジットに対するパリティは変化しないので、パリティの変化を求めるために演算結果を加工する必要がなく、演算の高速化が図れる。
 ここで、再補数化が必要な場合の再補数化前の演算結果をBCDコードでr(0≦r≦9)とする。尚、上記した前処理において、(例えば図2中、加算回路13により)予め+6がなされている。このため、A+Bの加算器ADD1の演算結果は、ディジットのキャリー出力信号digit carry out(COUT)の値がCOUT=0のときは(r+6)であり(+6が余分)、COUT=1のときはrである。又、ディジットで1の補数をとる演算は、15からその数を引く演算と等価である。したがってA+Bの演算結果に対し1の補数をとると、COUT=0のときには15-(r+6)=(9-r)となる。他方、COUT=1のときは、15-r=(9-r)+6となる。したがってCOUT=0のときは、A+Bの演算結果に対し1の補数をとることにより、9の補数をとった場合と等価の演算結果(9-r)が得られる。他方COUT=1のときは、A+Bの演算結果に対し1の補数をとると、求めたい9の補数(9-r)に対して6が余分な(9-r)+6が得られる。したがってこの場合、15から演算結果を引いた場合に余分な6が含まれないようにすればよい、すなわち15から演算結果を引いた場合に15-(r+6)となるよう、予めA+Bに6を加えるA+B+6の加算器ADD3を使用する。
 ここでA+B+6のような3値の足し算を行う場合、加算器を2段直列にして計算するか、CSA(Carry Save Adder: 桁上げ保存加算器)と加算器とを直列にして計算する方法を用いることができる。しかしこのような方法ではA+Bの演算に対して処理時間が余分に掛かる。このため実施例1では、上記の如くの3値の足し算においてオペランドの1つ(A+B+6の場合、"6")が固定の値であることを利用し、A+B+6の加算器ADD3として、図13に具体的な回路を示す如くの4ビットCLA(Carry Look Ahead)加算器の構成を適用する。このようにして実施例1では、A+Bを演算処理に要する時間と同等の処理時間でA+B+6の演算を行うことができる。
 又、図9の構成において、外部からのキャリー入力が1となる場合には、A+Bの加算器ADD1の代わりにA+B+1の加算器ADD4を用いる。同様にA+B+6の加算器ADD3の代わりに、A+B+6の加算器ADD3と同様に高速なA+B+7=(A+B+1)+6の加算器(図16参照)を用いる。
 このように実施例1によれば、演算処理の高速性を重視し、A+B+7, A+B+10, A+B+11の演算を行う夫々の加算器ADD6,ADD2,ADD5についても、上記したA+B+6の加算器ADD3と同様に、4ビットCLAの演算処理に要する時間と同等の時間で演算処理ができるようにした(図18,図20参照)。
 このように図9に示す実施例1の構成では、減算時の再補数化が必要で下位からの桁上がりがない場合の演算結果を、A+Bの加算器ADD1とA+B+6の加算器ADD3とで求める。そして、A+Bの加算器ADD1のキャリー出力信号digit carry outに基づき、BCD化補正の要否を判定する。尚、ここでのBCD化補正は、上記加算の場合のBCD化補正とは異なる。すなわちこの場合、上記の如く、再補数化時に15から演算結果を引いた場合に余分な6が含まれないようにする。すなわち15から演算結果を引いた場合に15-(r+6)となるように、予めA+Bに6を加えるA+B+6の加算器ADD2を使用する。
 具体的には、A+Bの加算器ADD1のキャリー出力信号digit carry out COUT=0であって、BCD化補正が不要な場合にはA+Bの加算器ADD1の出力に対しインバータINV5で1の補数をとってrs0を得る。BCD化補正が必要な場合にはA+B+6の加算器ADD3の出力に対しインバータINV5で1の補数をとり、rs0を得る。又、減算時の再補数化の必要で下位からの桁上がりがある場合の演算結果は、A+B+1の加算器ADD4とA+B+7の加算器ADD6とで求める。そしてA+B+1の加算器ADD4のキャリー出力信号digit carry outに基づき、BCD化補正の要否を判定し、BCD化補正が不要な場合(COUT=0)にはインバータINV6でA+B+1の加算器ADD4の演算結果に対し1の補数をとり、rs1を得る。BCD化補正が必要な場合(COUT=1)にはインバータINV6でA+B+7の加算器ADD6の演算結果に対し1の補数をとり、rs1を得る。
 このように図9に示す実施例1によれば、A+B, A+B+10, A+B+6, A+B+1, A+B+11, A+B+7のディジット単位の各演算を夫々の加算器によってADD1~ADD6にて並列に実行する。その結果、図4或いは図6のBCD補正回路23,33或いは34によるBCD化補正処理の如くの処理が不要となる。又、図4或いは図6の9の補数化回路24による9の補数化処理を、1の補数化を行うインバータINV5,INV6によるビット反転で置き換えることができる。更に、A+B, A+B+10, A+B+6, A+B+1, A+B+11, A+B+7の各演算は、図8と共に後述するブロックキャリー伝播回路BCP1による周知の2進加算器におけるキャリー伝播論理の実行と同時並行で実行される。その結果、高速な10進絶対値加算動作を実現できる。
 図8に、本発明の実施例1による10進絶対値加算器本体の全体構成を示す。図8中、m+1個のセグメント絶対値加算器DAD0,DAD1,...,DADmの各々、例えばセグメント絶対値加算器DAB1は、実施例1の場合、図9に記載された構成、すなわち10進数一桁の単位毎のディジット絶対値加算器の構成を有する。すなわち実施例1の10進絶対値加算器本体は、m+1桁の10進数を対象とした10進絶対値加算器に適用される。したがって実施例1では、上記m+1個のセグメント絶対値加算器DAD0,DAD1,...,DADmが最大m+1桁の10進絶対値加算結果SUMを出力する。
 図8中 ブロックキャリー伝播回路BCP1は、2進加算器におけるキャリー伝播回路を適用可能であり、周知のキャリールックアヘッド方式などを適用した高速なキャリー伝播回路とすることができる。ブロックキャリー伝播回路BCP1は、セグメント絶対値加算器DAD0,DAD1,...,DADmの夫々を夫々のブロックと見なし、ブロック間のキャリー伝播論理を実行する。又、ブロックキャリー伝播回路BCP1は、再補数化(単にrecomp或いはrとも称する)時のキャリー(BCin for recomp)と非再補数化時(単にnon-recomp或いはnrとも称する)のキャリー(BCin for non-recomp)との両方を生成する。ここで再補数化時、すなわち再補数化を行う場合とは、10進演算が減算であり演算結果が負となる場合であり、再補数化が必要な場合を意味する。他方、非再補数化時、すなわち再補数化を行わない場合とは、10進演算が加算の場合、或いは10進演算が減算であり演算結果が負とならない場合であり、再補数化が不要な場合を意味する。尚、図8中、例えばBmCrは、m番目のブロック(セグメント絶対値加算器)DADmに対する再補数化時のキャリーを意味し、BmCnrは、m番目のブロックDADmに対する非再補数化時のキャリーを意味する。
 ブロックキャリー伝播回路BCP1は、周知の2進加算器におけるキャリー伝播回路と同様の構成を有することができる。すなわち、減算時の減数オペランドの補数化における+1の演算処理(9の補数を10の補数にする処理)を実現するため、非補数化時のキャリー入力端子nrCinに信号SUBを接続し、信号SUBが1となる減算動作の場合に、非補数化時のキャリーnrCin(最下位のCin)を1にする。
 又、図8の例において、減算時の再補数化の要否の判定は、以下の通りになされる。すなわち、減算時(SUB=1)にブロックキャリー伝播回路BCP1のキャリー出力信号COUTが0である場合、後述するアンド回路AND-RECOMPにより、再補数化時を示す信号RECOMPを1とする。信号RECOMPは各セグメント絶対値加算器DAD0,DAD1,...,DADmに入力され、各セグメント絶対値加算器DAD0,DAD1,...,DADmでは再補数化を行う。すなわち図9において、A+B, A+B+6, A+B+1, A+B+7の夫々の加算器ADD1,ADD3,ADD4,ADD6のうちの何れかの出力に対し、インバータINV5又はIVN6で1の補数をとって演算結果を得る。
 図10は、図8に記載されたブロックキャリー伝播回路BCP1を2つの2進キャリールックアヘッド回路BCLA1,BCLA2で形成した場合について説明するためのブロック図である。2つの2進キャリールックアヘッド回路BCLA1,BCLA2として、夫々周知の2進キャリールックアヘッド回路(2進演算器におけるキャリールックアヘッド回路)を適用することができる。
 2つの2進キャリールックアヘッド回路BCLA1,BCLA2の各々は、入力された2進数のデータA,B(図10では省略)に基づき、当該2進数のデータA,Bの2進絶対値加算を行う際の、上記ブロックごと(実施例1の場合4ビット)のキャリーを生成して出力する。ここで、2進キャリールックアヘッド回路BCLA1は、非再補数化時のキャリーを生成して出力する。すなわち、B0Cnr(Block 0 carry for non-recomp, B1Cnr(Block 1 carry for non-recomp), ..., Bm-1Cr(Block m-1 carry for non-recomp), BmCr(Block m carry for non-recomp)を生成して出力する。他方、2進キャリールックアヘッド回路BCLA2は、再補数化時のキャリーを生成して出力する。すなわち、B0Cr(Block 0 carry for recomp), B1Cr(Block 1 carry for recomp), ..., Bm-1Cr(Block m-1 carry for recomp), BmCr(Block m carry for recomp)を生成して出力する。
 又、上記の如く、図8のブロックキャリー伝播回路BCP1では、減算時の減数オペランドの補数化における+1の演算処理(9の補数を10の補数にする処理)を実現するため、非再補数化時のキャリーnrCinとして信号SUBを接続する。その結果、信号SUBが1となる減算動作の場合にキャリーnrCinが1となる。図10の構成例の場合、再補数化時のキャリーを生成する2進キャリールックアヘッド回路BCLA2の(最下位の)キャリーCinとして0が入力される。よって再補数化時には2進キャリールックアヘッド回路BCLA2の(最下位の)キャリーCinが0となる。
 他方、非再補数化時のキャリーを生成する2進キャリールックアヘッド回路BCLA1のキャリーCinとして、上記の如く信号SUBが接続された、非再補数化時のキャリーnrCinが接続される。その結果、信号SUBが1となる減算時、非再補数化時のキャリーを生成する2進キャリールックアヘッド回路BCLA1の(最下位の)キャリーCinが1になる。他方、信号SUBが0となる加算時、非再補数化時のキャリーを生成する2進キャリールックアヘッド回路BCLA1の(最下位の)キャリーCinが0になる。
 尚、上記の如く、減算時の非再補数化時、減数オペランドの補数化において+1(9の補数を10の補数にする処理)を行う。他方、加算時及び減算時の再補数化時の夫々の場合には、+1(9の補数を10の補数にする処理)は不要である。すなわち、加算時にはそもそもオペランドの補数化を行わないため、+1は不要である。
 又、減算時の再補数化時には、上記の如く、図9のインバータINV5,INV6によるビットの反転を行うことにより、9の補数を得る。又、前処理における補数化において、例えば図2の9の補数化回路12により9の補数をとる。そして再補数化時、上記の如く、インバータによるビットの反転を行って9の補数を得る。10の補数をとる方法としては、9の補数化をしてから+1する方法と、-1した上で9の補数化をする方法との2通りがある。本発明においては、前処理における10の補数化では前者の方法を採用し、結果の再補数化のための10の補数化では後者の方法を採用することで2つの10の補数化処理における+1操作と-1操作を相殺させている。このように、再補数化時には、前処理における補数化の際と、再補数化の際との夫々の処理において+1操作と-1操作とを行わないことで、夫々の処理において9の補数を10の補数にする処理である補正値1の処理を相殺し省略することができる。
 図8の説明に戻り、図8の10進絶対値加算器本体は更に、上記AND回路AND-RECOMPを有する。アンド回路AND-RECOMPには減算時の1,加算時の0の値を有する信号SUB及びブロックキャリー伝播回路BCP1のキャリー出力信号COUTが入力され、再補数時に1、非再補数時に0後を有する信号RECOMPを出力する。信号RECOMPは各セグメント絶対値加算器DAD0,DAD1,...,DADmに供給される。アンド回路AND-RECOMPは、減算時(SUB=1)で且つ、ブロックキャリー伝播回路BCP1のキャリー出力信号COUTが0の場合(減算結果が負となる場合)、信号RECOMP=1を出力する。すなわち、再補数化を行うものとする。他方、それ以外の場合、すなわち、加算時(SUB=0)は信号RECOMP=0を出力する。すなわち、再補数化を行わないものとする。又、減算時(SUB=1)で且つ、ブロックキャリー伝播回路BCP1のキャリー出力信号COUTが1の場合(減算結果が負でない場合)、信号RECOMP=0を出力する。すなわち、再補数化を行わないものとする。
 次に、図9に示すディジット絶対値加算器(セグメント絶対値加算器)について詳細に説明する。図9に示す本発明の実施例1によるディジット絶対値加算器は、上記6個の4ビット加算器ADD1~ADD6(単に加算器ADD1~ADD6とも称する)を有する。加算器ADD1は、夫々が10進数の1桁を表す4ビットを有する入力データA,Bに対し、A+Bの加算を行う。加算器ADD2は、入力データA,Bに対しA+B+10の加算を行う。加算器ADD3は、入力データA,Bに対しA+B+6の加算を行う。加算器ADD4は、入力データA,Bに対しA+B+1の加算を行う。加算器ADD5は、入力データA,Bに対しA+B+11の加算を行う。加算器ADD6は、入力データA,Bに対しA+B+7の加算を行う。尚、6個の加算器ADD1~ADD6は、夫々の加算演算を相互の並列に実行することができる。
 図9のディジット絶対値加算器は更に、セレクタSEL11~SEL17を有する。セレクタSEL11には加算器ADD1,ADD2の出力が夫々入力される。セレクタSEL11は、加算器ADD1のキャリー出力信号digit carry outが1の場合には加算器ADD1の出力を選択出力し、加算器ADD1のキャリー出力信号digit carry outが0の場合には加算器ADD2の出力を選択出力する。 
 セレクタSEL12には加算器ADD1,ADD3の出力が夫々入力される。セレクタSEL12は、加算器ADD1のキャリー出力信号digit carry outが0の場合には加算器ADD1の出力を選択出力し、加算器ADD1のキャリー出力信号digit carry outが1の場合には加算器ADD3の出力を選択出力する。
 セレクタSEL13には加算器ADD4,ADD5の出力が夫々入力される。セレクタSEL13は、加算器ADD4のキャリー出力信号digit carry outが1の場合には加算器ADD4の出力を選択出力し、加算器ADD4のキャリー出力信号digit carry outが0の場合には加算器ADD5の出力を選択出力する。
 セレクタSEL14には加算器ADD4,ADD6の出力が夫々入力される。セレクタSEL14は、加算器ADD4のキャリー出力信号digit carry outが0の場合には加算器ADD4の出力を選択出力し、加算器ADD4のキャリー出力信号digit carry outが1の場合には加算器ADD6の出力を選択出力する。
 セレクタSEL15にはセレクタSEL11,SEL13の出力が夫々入力される。セレクタSEL15は、上記非再補数化時のキャリーBCin for non-recomp、すなわち図8,図10に記載されたキャリーB0Cnr, B1Cnr, ..., Bm-1Cnr, BmCnrに基づき選択動作を行う。すなわち、非再補数化時のキャリーが0の場合、セレクタSEL15はセレクタSEL11の出力s0を選択出力し、非再補数化時のキャリーが1の場合、セレクタSEL15はセレクタSEL13の出力s1を選択出力する。
 又、インバータINV5,INV6は、夫々セレクタSEL12,SEL14の出力をビット単位で反転し、夫々反転結果rs0, rs1を出力する。
 セレクタSEL16にはインバータINV5,INV6の出力rs0, rs1が夫々入力される。
 セレクタSEL15は、上記再補数化時のキャリーBCin for recomp、すなわち図8,図10に記載されたキャリーB0Cr, B1Cr, ..., Bm-1Cr, BmCrに基づき選択動作を行う。すなわち、再補数化時のキャリーが0の場合、セレクタSEL16はインバータINV5の出力rs0を選択出力し、再補数化時のキャリーが1の場合、セレクタSEL16はインバータINV6の出力rs1を選択出力する。
 セレクタSEL17にはセレクタSEL15,SEL16の出力r, rsが夫々入力される。セレクタ17は、図8に示す信号RECOMPの値が0の場合(非再補数化時)、セレクタSEL15の出力sを選択出力(result)し、信号RECOMPの値が1の場合(再補数化時)、セレクタSEL16の出力rsを選択出力(result)する。
 尚、図8に示す本発明の実施例1の10進絶対値加算器本体の入力データA,Bは、演算に先立つ上記前処理を受けている。すなわち図2とともに上記した加算回路13により、片方のオペランドop1に対し、ディジット単位で+6を行う。すなわち+6のオフセットが加算される。その結果上記のブロックキャリー伝播回路BCP1が有する周知の2進演算器におけるキャリー伝播論理によって適切に10進演算のキャリー伝播が実施される。
 図9の構成では下位からの桁上がりがないときの演算結果をA+B、A+B+10、A+B+6の夫々の加算器ADD1,ADD2,ADD3を使って生成する。尚、下位からの桁上がりがない場合は上記BCin for non-recomp, BCin for recompの夫々の信号が0となる。その結果、セレクタSEL15,SEL16により、上記夫々の加算器ADD1,ADD2,ADD3の演算結果或いは演算結果がビット反転された結果が選択出力される。
 ここで上記の如く既に各ディジットに対して +6のオフセットが加算されているため、A+Bの加算器ADD1のdigit carry out信号を用いて上記+6のオフセットの加算がない場合の演算結果が9を超えたか否かを判定できる。加算時或いは再補数化が不要な減算時には、A+Bの加算器ADD1の演算結果が、上記+6のオフセットの加算がない場合のA+Bの演算結果が9を越える場合の演算結果のBCDコードである。又、A+B+10の加算器ADD2の演算結果が、上記+6のオフセットの加算がない場合の演算結果が9を越えない場合の演算結果のBCDコードである。セレクタSEL11により、A+Bの加算器ADD1のdigit carry out信号が1の時には、A+Bの加算器ADD1の演算結果が選択出力される(s0)。又、A+Bの加算器ADD1のdigit carry out信号が0の時には、A+B+10の加算器ADD2の演算結果が選択出力(s0)される。
 他方、図9において、下位からの桁上がりがないときの減算時、再補数化が必要な場合、A+B+6の加算器ADD3の演算結果をインバータINV5で反転して得た値が、上記+6のオフセットの加算がない場合の演算結果が9を越える場合の演算結果のBCDコードである。又、A+Bの加算器ADD1の演算結果をインバータINV5で反転して得た値が、上記+6のオフセットの加算がない場合の演算結果が9を越えない場合の演算結果のBCDコードである。セレクタSEL12により、A+Bの加算器ADD1のdigit carry out信号が1の時には、A+B+6の加算器ADD3の演算結果が選択出力され、インバータINV5によってビットが反転される(rs0)。又、A+Bの加算器ADD1のdigit carry out信号が0の時には、A+Bの加算器ADD1の演算結果が選択出力され、インバータINV5によってビットが反転される(rs0)。尚、インバータINV5によるビットの反転は上記の如くBCD化補正(すなわち1の補数をとる)処理(再補数化)である。
 他方、図9の構成で下位からの桁上がりが有るときの演算結果をA+B+1、A+B+11、A+B+7の夫々の加算器ADD4,ADD5,ADD6を使って生成する。尚、下位からの桁上がりが有る場合は上記BCin for non-recomp, BCin for recompの夫々の信号が1となる。その結果、セレクタSEL15,SEL16により、上記夫々の加算器ADD4,ADD5,ADD6演算結果或いは演算結果がビット反転された結果が選択出力される。
 この場合も上記の如く既に各ディジットに対して +6のオフセットが加算されているため、A+B+1の加算器ADD4のdigit carry out信号を用いて上記+6のオフセットの加算がない場合の演算結果が9を超えたか否かを判定できる。加算時或いは再補数化が不要な減算時には、A+B+1の加算器ADD4の演算結果が、上記+6のオフセットの加算がない場合の演算結果が9を越える場合の演算結果のBCDコードである。又、A+B+11の加算器ADD4の演算結果が、上記+6のオフセットの加算がない場合の演算結果が9を越えない場合の演算結果のBCDコードである。セレクタSEL13により、A+B+1の加算器ADD4のdigit carry out信号が1の時には、A+B+1の加算器ADD4の演算結果が選択出力される(s1)。又、A+B+1の加算器ADD4のdigit carry out信号が0の時には、A+B+11の加算器ADD5の演算結果が選択出力(s1)される。
 又、図9において、下位からの桁上がりが有るとき、減算時、再補数化が必要な場合、A+B+7の加算器ADD6の演算結果をインバータINV6で反転して得た値が、上記+6のオフセットの加算がない場合の演算結果が9を越える場合の演算結果のBCDコードである。又、A+B+1の加算器ADD4の演算結果をインバータINV6で反転して得た値が、上記+6のオフセットの加算がない場合の演算結果が9を越えない場合の演算結果のBCDコードである。セレクタSEL14により、A+B+1の加算器ADD4のdigit carry out信号が1の時には、A+B+7の加算器ADD6の演算結果が選択出力され、インバータINV6によってビットが反転される(rs1)。又、A+B+1の加算器ADD4のdigit carry out信号が0の時には、A+B+1の加算器ADD4の演算結果が選択出力され、インバータINV6によってビットが反転される(rs1)。尚、インバータINV6によるビットの反転は上記の如くBCD化補正(すなわち1の補数をとる)処理(再補数化)である。
 上記の如く、図8に示すブロックキャリー伝播回路BCP1が有する2進演算器におけるキャリー伝播論理により、非再補数化時のキャリー(BCin for non-recomp)と再補数化時のキャリー(BCin for recomp)とが供給される。非再補数化時のキャリー(BCin for non-recomp)に基づき、キャリーが0の場合にはセレクタSEL15が上記値s0を選択し、1の場合にはs1を選択し、sを出力する。又、再補数化時のキャリー(BCin for recomp)に基づき、セレクタ16が、キャリーが0の場合にはrs0を選択し、1の場合にはrs1を選択し、rsを出力する。
 更に、図8に示すアンド回路AND-RECOMPによって供給される再補数化の要否を示す信号RECOMPに基づき、セレクタSEL17は、非再補数化時(RECOMP=0)には、出力sを選択し、再補数化時(RECOMP=1)は、出力rsを選択して結果resultを出力する。
 次に、図9に記載された加算器ADD1~ADD6の夫々の内部回路構成の一例につき、図とともに説明する。
 図11はA+Bの加算器ADD1の回路構成の一例を示す回路図である。図11の例は、入力データA及びBの夫々の4ビットa0, a1, a2, a3及びb0, b1, b2, b3並びに入力データA及びBの夫々の偶数パリティビットap及びbpが入力される。そして図11の例は、A+Bの演算結果の4ビットs0, s1, s2, s3並びにそのパリティビットspを出力する。
 図11の例は、入力ビットa0, b0を入力するNAND回路NAND11,a0, b0を入力してh0を出力するEXOR回路EXO10,NAND11の出力を反転してg0を出力するインバータINV10を有する。図11の例は更に、h0をバッファリングして出力ビットs0を出力するバッファBUF20を有する。
  図11の例は更に、入力ビットa1, b1を入力するNAND回路NAND12,a1, b1を入力するNOR回路NOR11,a1, b1を入力してh1を出力するEXOR回路EXO11を有する。図11の例は更に、NAND12及びNOR11の出力を夫々反転してp1, g1を夫々出力するインバータINV11,INV12、並びにh1及びg0を入力して出力ビットs1を出力するEXOR回路EXO21を有する。
 図11の例は更に、入力ビットa2, b2を入力するNAND回路NAND13,a2, b2を入力するNOR回路NOR12,a2, b2を入力しh2を出力するEXOR回路EXO12を有する。図11の例は更に、NAND13及びNOR12の出力を夫々反転してp2, g2を夫々出力するインバータINV13,INV14を有する。図11の例は更に、p1及びg0を入力するNAND回路NAND26,g1を反転するインバータINV21,NAND26及びインバータ21の夫々の出力を入力しc2を出力するNAND回路NAND27、h2及びc2を入力し出力ビットs2を出力するEXOR回路EXO22を有する。
 図11の例は更に、入力ビットa3, b3を入力しh3を出力するEXOR回路EXO13,g0, p1, p2を入力するNAND28,g1, p2を入力するNAND回路NAND29、g2を反転するインバータINV22を有する。図11の例は更に、NAND28,NAND29,INV22の夫々の出力を入力し、c3を出力するNAND回路NAND30、h3, c3を入力し出力ビットs3を出力するEXOR回路EXO23を有する。
 図11の例は更に、入力パリティビットap, bpを入力するEXOR回路EXO30,上記した出力ビットs0~s3を生成する際に生成される夫々の値を入力するNAND回路NAND21,NAND22,NAND23,NAND24を有する。図11の例は更に、NAND21,NAND22,NAND23,NAND24の夫々の出力を入力しpcを出力するNAND回路NAND25、pcとEXO30の出力とを入力し、出力パリティビットspを出力するEXOR回路EXO31を有する。
 図11の例では上記した構成により、下位ビットの演算結果から生成されるキャリー(桁上げ)を考慮した上で演算結果の夫々のビットs0, s1, s2, s3を生成する。
 図12はA+B+1の加算器ADD4の回路構成の一例を示す回路図である。図12の例は、入力データA及びBの夫々の4ビットa0, a1, a2, a3及びb0, b1, b2, b3並びに入力データA及びBの夫々の偶数パリティビットap及びbpが入力される。そして図12の例は、A+B+1の演算結果の4ビットs0, s1, s2, s3並びにそのパリティビットspを出力する。
 図12の例は、入力ビットa0, b0を入力するNOR回路NOR110,a0, b0を入力してh0を出力するEXOR回路EXO110,NOR110の出力を反転してp0を出力するインバータINV110を有する。図12の例は更に、h0を反転して出力ビットs0を出力するインバータINV120を有する。
  図12の例は更に、入力ビットa1, b1を入力するNAND回路NAND112,a1, b1を入力するNOR回路NOR111,a1, b1を入力してh1を出力するEXOR回路EXO111を有する。図12の例は更に、NAND112及びNOR111の出力を夫々反転してp1, g1を夫々出力するインバータINV111,INV112、並びにh1及びp0を入力して出力ビットs1を出力するEXOR回路EXO121を有する。
 図12の例は更に、入力ビットa2, b2を入力するNAND回路NAND113,a2, b2を入力するNOR回路NOR112,a2, b2を入力しh2を出力するEXOR回路EXO112を有する。図12の例は更に、NAND113及びNOR112の出力を夫々反転してp2, g2を夫々出力するインバータINV113,INV114を有する。図12の例は更に、p1及びp0を入力するNAND回路NAND126,g1を反転するインバータINV121,NAND126及びインバータ121の夫々の出力を入力しc2を出力するNAND回路NAND127、h2及びc2を入力し出力ビットs2を出力するEXOR回路EXO122を有する。
 図12の例は更に、入力ビットa3, b3を入力しh3を出力するEXOR回路EXO113,p0, p1, p2を入力するNAND128,g1, p2を入力するNAND回路NAND129、g2を反転するインバータINV122を有する。図12の例は更に、NAND128,NAND129,INV122の夫々の出力を入力し、c3を出力するNAND回路NAND130、h3, c3を入力し出力ビットs3を出力するEXOR回路EXO123を有する。
 図12の例は更に、入力パリティビットap, bpを入力するEXOR回路EXO130,上記した出力ビットs0~s3を生成する際に生成される夫々の値を入力するNAND回路NAND121,NAND122,NAND123,NAND124を有する。図12の例は更に、NAND121,NAND122,NAND123,NAND124の夫々の出力を入力しpcを出力するNAND回路NAND125、pcとEXO130の出力とを入力し、出力パリティビットspを出力するEXOR回路EXO131を有する。
 図12の例では上記した構成により、下位ビットの演算結果から生成されるキャリーを考慮した上で演算結果の夫々のビットs0, s1, s2, s3を生成する。
 次に図13,図14,図15とともに、A+B+6の加算器ADD3について説明する。図13の例は、入力データA及びBの夫々の4ビットa0, a1, a2, a3及びb0, b1, b2, b3並びに入力データA及びBの夫々の偶数パリティビットap及びbpが入力される。そして図13の例は、A+B+6(実際には後述のようにA+B-10)の演算結果の4ビットs0, s1, s2, s3並びにそのパリティビットspを出力する。
 図13の例は、入力ビットa0, b0を入力するNAND回路NAND211,a0, b0を入力してh0を出力するEXOR回路EXO210,NAND211の出力を反転してg0を出力するインバータINV210を有する。図13の例は更に、h0をバッファリングして出力ビットs0を出力するバッファBUF220を有する。
  図13の例は更に、入力ビットa1, b1を入力するNAND回路NAND212,a1, b1を入力するNOR回路NOR211,a1, b1を入力してh1を出力するEXOR回路EXO211を有する。図13の例は更に、NAND212及びNOR211の出力を夫々反転してp1, g1を夫々出力するインバータINV211,INV212、並びにh1及びg0を入力して出力ビットs1を出力するEXNOR回路EXNO221を有する。
 図13の例は更に、入力ビットa2, b2を入力するNAND回路NAND213,a2, b2を入力するNOR回路NOR212,a2, b2を入力しh2を出力するEXOR回路EXO212を有する。図13の例は更に、NAND213及びNOR212の出力を夫々反転してp2, g2を夫々出力するインバータINV213,INV214を有する。図13の例は更に、h2及びc2を入力し出力ビットs2を出力するEXOR回路EXO222、c2を出力するNAND回路NAND250,NAND250に夫々の出力を入力するNAND回路NAND248,NAND249を有する。
 図13の例は更に、入力ビットa3, b3を入力しh3を出力するEXOR回路EXO213,h3及びc3を入力し出力ビットs3を出力するEXNOR回路EXNO223を有する。図13の例は更に、c3を出力するNAND回路NAND255,NAND255に夫々の出力を入力するNAND回路NAND251,NAND252,NAND253,NAND254を有する。
 図13の例は更に、入力パリティビットap, bpを入力するEXOR回路EXO230,上記した出力ビットs0~s3を生成する際に生成される夫々の値を入力するNAND回路NAND241,NAND242,NAND243,NAND244、NAND245を有する。図13の例は更に、NAND241,NAND242,NAND243,NAND244、NAND245の夫々の出力を夫々入力するNAND246,NAND247を有する。図13の例は更に、NAND247,NAND248の夫々の出力を入力しpcを出力するOR回路OR211、pcとEXO230の出力とを入力し、出力パリティビットspを出力するEXOR回路EXO231を有する。
 図13の例では上記した構成により、下位ビットの演算結果から生成されるキャリー及びボローを考慮した上で演算結果の各ビットs0, s1, s2, s3を生成する。
 ここで図13の例に関し、A+B+6をそのまま求めると、キャリーが二重に発生する場合の考慮が複雑になるため、図13の例は、代りにA+B-10を計算する。図13の例ではキャリーとボローの伝播が排他になるように回路を形成することで、伝播経路を1つで済ませる。ここで10は6に対する16の補数になるので、4ビットの演算では、4ビット内の演算結果のビットのパターンは、A+B+6とA+B-10とで同じになる。参考のために図14に、4ビットで表現できる数値Dに対し、D+6、D-10を夫々行った場合の下位4ビットの結果のパターンが同じになることを示す。図14では、4ビットのデータDに対し、演算結果の符号等の判定がつくように、2進数の表現として上位に2ビット追加し、6ビットに拡張している。尚、図14中、括弧()内に、夫々対応する符号付の10進表現を示す。図14から、D+6とD-10とで、下位4ビットの2進数のビットパターンが同じになることが明らかである。
 演算結果の出力ビットs3~s0を求めるには、入力ビットa2~a0、b2~b0から生成されるキャリーとボローとが必要である。図15に各ビットから生成されるキャリーとボローの内訳を示す。図15中、bitはビット番号(a2~a0、b2~b0の数字部分)を示し、generateは、ビット自体が生成するキャリーを示し、generateの伝播は、下位ビットが生成したキャリーの伝播を示す。又、borrowは、ビット自体が生成するボローを示し、borrowの伝播は、下位ビットが生成したボローの伝播を示す。
 以下に、演算結果 s0, s1, s2, s3 、演算結果の偶数パリティ sp とキャリーもしくはボローによるデータの反転条件 c0, c1, c2, c3 および、パリティの反転する条件 pc をまとめた論理式を示す(数4)。尚、数4の論理式において、数1に示す演算子
Figure JPOXMLDOC01-appb-M000001

は、EXOR論理演算を実行する演算子を示し、数2に示す演算子
Figure JPOXMLDOC01-appb-M000002

は、AND論理演算を実行する演算子を示し、数3に示す演算子
Figure JPOXMLDOC01-appb-M000003

は、OR論理演算を実行する演算子を示す。
Figure JPOXMLDOC01-appb-M000004

 次に図16,図17とともに、A+B+7の加算器ADD6について説明する。図16の例は、入力データA及びBの夫々の4ビットa0, a1, a2, a3及びb0, b1, b2, b3並びに入力データA及びBの夫々の偶数パリティビットap及びbpが入力される。そして図16の例は、A+B+7(実際には後述のようにA+B-9)の演算結果の4ビットs0, s1, s2, s3並びにそのパリティビットspを出力する。
 図16の例は、入力ビットa0, b0を入力するNOR回路NOR310,a0, b0を入力してh0を出力するEXOR回路EXO310,NOR310の出力を反転してp0を出力するインバータINV310を有する。図16の例は更に、h0を反転して出力ビットs0を出力するインバータINV320を有する。
  図16の例は更に、入力ビットa1, b1を入力するNAND回路NAND312,a1, b1を入力するNOR回路NOR311,a1, b1を入力してh1を出力するEXOR回路EXO311を有する。図16の例は更に、NAND312及びNOR311の出力を夫々反転してp1, g1を夫々出力するインバータINV311,INV312、並びに出力ビットs1を出力するEXOR回路EXO321を有する。
 図16の例は更に、入力ビットa2, b2を入力するNAND回路NAND313,a2, b2を入力するNOR回路NOR312,a2, b2を入力しh2を出力するEXOR回路EXO312を有する。図16の例は更に、NAND313及びNOR312の出力を夫々反転してp2, g2を夫々出力するインバータINV313,INV314を有する。図16の例は更に、h2及びc2を入力し出力ビットs2を出力するEXOR回路EXO322、c2を出力するNAND回路NAND368,NAND368に夫々の出力を入力するNAND回路NAND366,NAND367を有する。
 図16の例は更に、入力ビットa3, b3を入力しh3を出力するEXOR回路EXO313,h3及びc3を入力し出力ビットs3を出力するEXNOR回路EXNO323を有する。図16の例は更に、c3を出力するNAND回路NAND373,NAND373に夫々の出力を入力するNAND回路NAND369,NAND370,NAND371,NAND372を有する。
 図16の例は更に、入力パリティビットap, bpを入力するEXOR回路EXO330,上記した出力ビットs0~s3を生成する際に生成される夫々の値を入力するNAND回路NAND361,NAND362,NAND363,NAND364を有する。図16の例は更に、NAND361,NAND362,NAND363,NAND364の夫々の出力を夫々入力するNAND365を有する。図16の例は更に、NAND365の出力pcとEXO330の出力とを入力し、出力パリティビットspを出力するEXOR回路EXO331を有する。
 図16の例では上記した構成により、下位ビットの演算結果から生成されるキャリー及びボローを考慮した上で演算結果の各ビットs0, s1, s2, s3を生成する。
 ここで図16の例に関し、A+B+7をそのまま求めると、キャリーが二重に発生する場合の考慮が複雑になるため、図16の例では、代りにA+B-9を計算する。図16の例ではキャリーとボローの伝播が排他になるように回路を形成することで、伝播経路を1つで済ませる。ここで9は7に対する16の補数になるので、4ビットの演算では、4ビット内の結果のビットのパターンは、A+B+7とA+B-9とで同じになる。又、図17に各ビットから生成されるキャリーとボローの内訳を示す。
 以下に、演算結果 s0, s1, s2, s3 、演算結果の偶数パリティ sp とキャリーもしくはボローによるデータの反転条件 c0, c1, c2, c3 および、パリティの反転する条件 pc をまとめた論理式を示す(数5)。
Figure JPOXMLDOC01-appb-M000005
  
 次に図18,図19とともに、A+B+10の加算器ADD2について説明する。図18の例は、入力データA及びBの夫々の4ビットa0, a1, a2, a3及びb0, b1, b2, b3並びに入力データA及びBの夫々の偶数パリティビットap及びbpが入力される。そして図18の例は、A+B+10(実際には後述のようにA+B-6)の演算結果の4ビットs0, s1, s2, s3並びにそのパリティビットspを出力する。
 図18の例は、入力ビットa0, b0を入力するNAND回路NAND411,a0, b0を入力してh0を出力するEXOR回路EXO410,NAND411の出力を反転してg0を出力するインバータINV410を有する。図18の例は更に、h0をバッファリングして出力ビットs0を出力するバッファBUF420を有する。
  図18の例は更に、入力ビットa1, b1を入力するNAND回路NAND412,a1, b1を入力するNOR回路NOR411,a1, b1を入力してh1を出力するEXOR回路EXO411を有する。図18の例は更に、NAND412及びNOR411の出力を夫々反転してp1, g1を夫々出力するインバータINV411,INV412、並びに出力ビットs1を出力するEXNOR回路EXNO421を有する。
 図18の例は更に、入力ビットa2, b2を入力するNAND回路NAND413,a2, b2を入力するNOR回路NOR412,a2, b2を入力しh2を出力するEXOR回路EXO412を有する。図18の例は更に、NAND413及びNOR412の出力を夫々反転してp2, g2を夫々出力するインバータINV413,INV414を有する。図18の例は更に、h2及びc2を入力し出力ビットs2を出力するEXNOR回路EXNO422、c2を出力するNAND回路NAND488,NAND488に夫々の出力を入力するNAND回路NAND486,NAND487を有する。
 図18の例は更に、入力ビットa3, b3を入力しh3を出力するEXOR回路EXO413,h3及びc3を入力し出力ビットs3を出力するEXOR回路EXO423を有する。図18の例は更に、c3を出力するNAND回路NAND493,NAND493に夫々の出力を入力するNAND回路NAND489,NAND490,NAND491,NAND422を有する。
 図18の例は更に、入力パリティビットap, bpを入力するEXOR回路EXO430,上記した出力ビットs0~s3を生成する際に生成される夫々の値を入力するNAND回路NAND481,NAND482,NAND483,NAND484を有する。図18の例は更に、NAND481,NAND482,NAND483,NAND484の夫々の出力を夫々入力するNAND485を有する。図18の例は更に、NAND485の出力pcとEXO430の出力とを入力し、出力パリティビットspを出力するEXOR回路EXO431を有する。
 図18の例では上記した構成により、下位ビットの演算結果から生成されるキャリー及びボローを考慮した上で演算結果の各ビットs0, s1, s2, s3を生成する。
 ここで図18の例に関し、A+B+10をそのまま求めると、キャリーが二重に発生する場合の考慮が複雑になるため、図18の例では、代りにA+B-6を計算する。図18の例ではキャリーとボローの伝播が排他になるように回路を形成することで、伝播経路を1つで済ませる。ここで6は10に対する16の補数になるので、4ビットの演算では、4ビット内の結果のビットのパターンは、A+B+10とA+B-6とで同じになる。又、図19に各ビットから生成されるキャリーとボローの内訳を示す。
 以下に、演算結果 s0, s1, s2, s3 、演算結果の偶数パリティ sp とキャリーもしくはボローによるデータの反転条件 c0, c1, c2, c3 および、パリティの反転する条件 pc をまとめた論理式を示す(数6)。
Figure JPOXMLDOC01-appb-M000006

 次に図20,図21とともに、A+B+11の加算器ADD5について説明する。図20の例は、入力データA及びBの夫々の4ビットa0, a1, a2, a3及びb0, b1, b2, b3並びに入力データA及びBの夫々の偶数パリティビットap及びbpが入力される。そして図20の例は、A+B+11(実際には後述のようにA+B-5)の演算結果の4ビットs0, s1, s2, s3並びにそのパリティビットspを出力する。
 図20の例は、入力ビットa0, b0を入力するNOR回路NOR510,a0, b0を入力してh0を出力するEXOR回路EXO510,NOR510の出力を反転してp0を出力するインバータINV510を有する。図20の例は更に、h0を反転して出力ビットs0を出力するインバータINV520を有する。
  図20の例は更に、入力ビットa1, b1を入力するNAND回路NAND512,a1, b1を入力するNOR回路NOR511,a1, b1を入力してh1を出力するEXOR回路EXO511を有する。図20の例は更に、NAND512及びNOR511の出力を夫々反転してp1, g1を夫々出力するインバータINV511,INV512、並びに出力ビットs1を出力するEXOR回路EXO521を有する。
 図20の例は更に、入力ビットa2, b2を入力するNAND回路NAND513,a2, b2を入力するNOR回路NOR512,a2, b2を入力しh2を出力するEXOR回路EXO512を有する。図20の例は更に、NAND513及びNOR512の出力を夫々反転してp2, g2を夫々出力するインバータINV513,INV514を有する。図20の例は更に、h2及びc2を入力し出力ビットs2を出力するEXNOR回路EXNO522、c2を出力するNAND回路NAND5110,NAND5110に夫々の出力を入力するNAND回路NAND5108,NAND5109を有する。
 図20の例は更に、入力ビットa3, b3を入力しh3を出力するEXOR回路EXO513,h3及びc3を入力し出力ビットs3を出力するEXOR回路EXO523を有する。図20の例は更に、c3を出力するNAND回路NAND5115,NAND5115に夫々の出力を入力するNAND回路NAND5111,NAND5112,NAND5113,NAND5114を有する。
 図20の例は更に、入力パリティビットap, bpを入力するEXOR回路EXO530,上記した出力ビットs0~s3を生成する際に生成される夫々の値を入力するNAND回路NAND5101,NAND5102,NAND5103,NAND5104、NAND5105を有する。図20の例は更に、NAND5101,NAND5102,NAND5103,NAND5104,NAND5105の夫々の出力を夫々入力するNAND5106,NAND5107を有する。図20の例は更に、NAND5106,NAND5107の夫々の出力を入力し、pcを出力するOR回路OR511、pcとEXO530の出力とを入力し、出力パリティビットspを出力するEXOR回路EXO531を有する。
 図20の例では上記した構成により、下位ビットの演算結果から生成されるキャリー及びボローを考慮した上で演算結果の各ビットs0, s1, s2, s3を生成する。
 ここで図20の例に関し、A+B+11をそのまま求めると、キャリーが二重に発生する場合の考慮が複雑になるため、図20の例では、代りにA+B-5を計算する。図20の例ではキャリーとボローの伝播が排他になるように回路を形成することで、伝播経路を1つで済ませる。ここで5は11に対する16の補数になるので、4ビットの演算では、4ビット内の結果のビットのパターンは、A+B+11とA+B-5とで同じになる。又、図21に各ビットから生成されるキャリーとボローの内訳を示す。
 以下に、演算結果 s0, s1, s2, s3 、演算結果の偶数パリティ sp とキャリーもしくはボローによるデータの反転条件 c0, c1, c2, c3 および、パリティの反転する条件 pc をまとめた論理式を示す(数7)。
Figure JPOXMLDOC01-appb-M000007

 以下に本発明の実施例2について説明する。実施例2では、上述した実施例1において、図8に示すセグメント絶対値加算器DAD0,DAD1,...,DADmの各々を、ディジット単位ではなく、複数のディジット単位とする。すなわち実施例2の場合、セグメント絶対値加算器DAD0,DAD1,...,DADmの各々、例えばセグメント絶対値加算器DAD1が、図22で示す如く、複数(図22の例の場合、4個)のディジット加算器ブロックDAB1~DAB4を有する。
 図22に示すセグメント絶対値加算器はこのように4ディジット分の構成を有し、16ビット(4×4=16)分([15:0])の構成を有する。又、図22に示すセグメント絶対値加算器は、ローカルキャリールックアヘッド回路LCLA1を有する。ローカルキャリールックアヘッド回路LCLA1は、4ディジット単位内、すなわち4個のディジット加算器ブロックDAB1~DAB4、相互間のキャリー伝播論理を実行する。したがって実施例2の場合、図8に示すブロックキャリー伝播回路BCP1は、4ディジット単位のキャリーを生成し、各セグメント絶対値加算器DAD0,DAD1,...,DADmに供給する。このように実施例2の場合、キャリー伝播論理を、4ディジット単位のセグメント絶対値加算器DAD0,DAD1,...,DADmの各々の内部(ローカルキャリールックアヘッド回路LCLA1)と外部(ブロックキャリー伝播回路BCP1)とで階層化する。その結果、セグメント絶対値加算器DAB1~DAB4の各々の内部(ローカルキャリールックアヘッド回路LCLA1)と外部(ブロックキャリー伝播回路BCP1)とで、キャリー伝播論理を並行して実施(並列処理)することができる。
 図23は、図22に示すディジット加算器ブロックDAB1~DAB4の各々、例えばディジット加算器ブロックDAB3の構成の一例を示す。図23に示す実施例2によるディジット加算器ブロックは、図9に示すディジット単位のセグメント絶対値加算器と同様の構成を有し、対応する構成要素には同一符号を付し、重複する説明を省略する。図23に示すディジット加算器ブロックが図9に示すセグメント絶対値加算器と異なる点は、セレクタSEL21,SEL22,SEL23,SEL24を有する点である。
 図23の構成を採用する場合、図22に示すローカルキャリールックアヘッド回路LCLA1は以下の動作を行う。すなわちローカルキャリールックアヘッド回路LCLA1は、4ディジット単位の入力データA,B及びブロックキャリー伝播回路BCP1から供給される4ディジット単位のキャリーBCin(BCin for recomp又はBCin for non-recomp)の値が0と1のいずれであっても対応できるように、以下の動作を行う。ローカルキャリールックアヘッド回路LCLA1が有する周知の2進演算器におけるキャリー伝播論理に従い、ディジット単位のキャリーを生成する。より具体的には、ローカルキャリールックアヘッド回路LCLA1は、ブロックキャリー伝播回路BCP1が供給する4ディジット単位のキャリーBCinが0の場合に対応して、ディジット単位のキャリーlocal digit carry at BCin=0を生成する。更に、ローカルキャリールックアヘッド回路LCLA1は、4ディジット単位のキャリーBCinが1の場合に対応して、ディジット単位のキャリーlocal digit carry at BCin=1を生成する。そして図22に示すローカルキャリールックアヘッド回路LCLA1は、生成したキャリーlocal digit carry at BCin=0及びキャリーlocal digit carry at BCin=1を、ディジット加算器ブロックDAB1~DAB4の夫々に供給する。すなわち、ローカルキャリールックアヘッド回路LCLA1は、キャリーlocal digit carry at BCin=0及びキャリーlocal digit carry at BCin=1を、図23に示すディジット加算器ブロックに供給する。
 図23中、供給されたキャリーlocal digit carry at BCin=0はセレクタSEL21,SEL23に入力される。セレクタSEL21は、キャリーlocal digit carry at BCin=0が0の場合、セレクタSEL11の出力s0をセレクタSEL15に選択出力し、1の場合、セレクタSEL13の出力s1をセレクタSEL15に選択出力する。セレクタSEL23は、キャリーlocal digit carry at BCin=0が0の場合、インバータINV5の出力rs0をセレクタSEL16に選択出力し、1の場合、インバータ6の出力rs1をセレクタSEL16に選択出力する。
 他方、供給されたキャリーlocal digit carry at BCin=1はセレクタSEL22,SEL24に入力される。セレクタSEL22は、キャリーlocal digit carry at BCin=1が0の場合、セレクタSEL11の出力s0をセレクタSEL15に選択出力し、1の場合、セレクタSEL13の出力s1をセレクタSEL15に選択出力する。セレクタSEL24は、キャリーlocal digit carry at BCin=1が0の場合、インバータINV5の出力rs0をセレクタSEL16に選択出力し、1の場合、インバータ6の出力rs1をセレクタSEL16に選択出力する。
 セレクタSEL15,SEL16は図9の場合と同様に、夫々、ブロックキャリー伝播回路BCP1が供給する上記4ディジット単位の信号BCin for non-recomp又はBCin for recompに従って選択出力動作を行う。又、セレクタSEL17も図9の場合と同様に、図8に示される信号RECOMPに従って選択出力動作を行う。
 図23のディジット加算器における他の動作は図9に示すディジット単位のセグメント絶対値加算器における動作と同様である。
 次に本発明の実施例3について説明を行う。実施例3によれば、上述した実施例1における図9に示すディジット単位のセグメント絶対値加算器に少数のゲートを追加して、2進の絶対値加算器としても動作するようにする。図24に実施例3によるディジット単位のセグメント絶対値加算器の構成の一例を示す。図9の構成と比較すると、digit carry out信号でセレクタSEL11,SEL12,SEL13,SEL14の動作を制御する部分にBINARY_MODE信号と論理をとるためのゲートを追加する。追加するゲートは、OR回路OR51,AND回路AND51,OR回路OR52,AND回路AND52である。これらOR回路OR51,AND回路AND51、OR回路OR52,AND回路AND52には、digit carry out 信号及びBINARY_MODE信号が入力される。BINARY_MODE信号は、10進演算を選択する場合0となり、2進演算を選択する場合1となる。
 s0を出力するセレクタSEL11において、BINARY_MODE信号が0のとき、OR回路OR51は、加算器ADD1からのdigit carry out信号をそのまま通過させる。その結果、図9の場合と同様な構成となり、s0に関し、図9の場合と等価な10進演算動作を実行する。他方、BINARY_MODE信号が1のとき、OR51は常時1を出力し、セレクタSEL11は常時加算器ADD1の演算結果を選択する。
 又。インバータINV5を介しrs0を出力するセレクタSEL12の動作を制御するAND51は、BINARY_MODE信号を反転した値とdigit carry out信号とのAND論理を実行する。このため、BINARY_MODE信号が0のとき、セレクタ12はdigit carry out信号で制御され、信号rs0に関し、図9の場合と等価な10進演算動作を実行する。他方、BINARY_MODE信号が1のとき、AND51は常時0を出力し、その結果セレクタ12は常時加算器ADD1の演算結果を選択する。
 s1を出力するセレクタSEL13,インバータINV6を介してrs1を出力するセレクタSEL14の夫々の制御についても上記したs0、rs0の場合と同様である。すなわちBINARY_MODE信号が0の場合、図24の回路は図9の回路と等価な10進演算の動作を行う。他方、BINARY_MODE信号が1の場合、s0は常時加算器ADD1の演算結果(A+B)となり、rs0は常時加算器ADD1の演算結果(A+B)の2の補数となる。又、BINARY_MODE信号が1の場合、s1は常時加算器ADD4の演算結果(A+B+1)となり、rs1は常時加算器ADD4の演算結果(A+B+1)の2の補数となる。
 したがってBINARY_MODE信号が1の場合、図24の回路は、4ビット幅の2進の絶対値加算器と等価の動作を行う。上記信号BCin for non-recompや信号BCin for recomp信号を生成するブロックキャリー伝播回路BCP1(図8参照)は、上記の如く2進演算器におけるキャリー伝播論理を有している。したがってブロックキャリー伝播回路BCP1による信号RECOMPの作成条件も2進演算器におけるキャリー伝播論理に従っている。よって実施例3では、図8の10進絶対値加算器本体の構成において、実施例1の図9に示すセグメント絶対値加算器の回路構成を、図24の回路構成に置き換える。その結果、このようにセグメント絶対値加算器を図24の回路構成に置き換えた10進絶対値加算器本体を含む、例えば図2に示す10進絶対値加算器は、2進の絶対値加算器としても使用し得るようになる。尚、上記セグメント絶対値加算器を図24の回路構成に置き換えた10進絶対値加算器本体を、絶対値加算器本体15Xと称する。
 又、実施例3の場合、10進演算器として動作をさせるように予め外部で+6を行っている部分、すなわち例えば図3における加算回路11は、2進演算時には不要となる。したがって図3に示す10進絶対値加算器の全体構成の例を、実施例3では図25のように変更する。すなわちセレクタ17を挿入し、セレクタ17は、BINARY_MODE信号が1の場合、すなわち2進演算時にはオペランドop1をそのままセレクタ14に供給する。他方BINARY_MODE信号が0の場合、すなわち10進演算時には上記の如く、オペランドop1に対し加算回路11でディジット単位で+6を行った上でセレクタ14に供給する。
 したがって図25の構成では、BINARY_MODE信号により、2進動作時(BINARY_MODE=1)には、加算時(SUB=0)、オペランドop1がそのまま絶対値加算器本体15Xに供給される。他方、減算時(SUB=1)、1の補数化回路12によってオペランドop1に対する1の補数がとられて絶対値加算器本体15Xに供給される。他方、10進動作時(BINARY_MODE=0)には、図3の場合と同様に、加算時(SUB=0)、オペランドop1の各ディジットに対し+6が行われた値が絶対値加算器本体15Xに供給される。又、減算時(SUB=1)、1の補数化回路12により、オペランドop1の各ディジットに対し9の補数をとって+6を行った値と等価な値が絶対値加算器本体15Xに供給される。
 実施例3では、このように、BINARY_MODE信号により、10進絶対値加算器を、2進絶対値加算器としての動作させることも、10進絶対値加算器としての動作させることも可能となる。
 11、13 加算回路
 12、24 9の補数化回路
 14,26,SEL1,SEL11,SEL12,SEL13,SEL14,SEL15,SEL16,SEL17,SEL21,SEL22,SEL23,SEL24 セレクタ
 15 10進絶対値加算器本体
 15X 絶対値加算器本体
 16 1の補数化回路
 21,31,32 2進加算器
 22 再補数化検出回路
 23、33,34 BCD補正回路
 ADD1,ADD2,ADD3,ADD4,ADD5,ADD6 4ビット加算器
 BCLA1,BCLA2 2進キャリールックアヘッド回路
 BCP1 ブロックキャリー伝播回路
 DAD0,DAD1,...,DADm セグメント絶対値加算器

Claims (8)

  1.  2つのオペランドを加算して第1の演算結果を出力する第1の演算回路と、
     前記2つのオペランド及び10を加算して第2の演算結果を出力する第2の演算回路と、
     前記2つのオペランド及び6を加算して第3の演算結果を出力する第3の演算回路と、
     前記2つのオペランド及び1を加算して第4の演算結果を出力する第4の演算回路と、
     前記2つのオペランド及び11を加算して第5の演算結果を出力する第5の演算回路と、
     前記2つのオペランド及び7を加算して第6の演算結果を出力する第6の演算回路と、
     前記2つのオペランドに対する演算が同符号の数同士の加算である場合、或いは演算結果が負とはならない異符号の数同士の加算である場合、前記第1の演算結果、前記第2の演算結果、前記第4の演算結果及び前記第5の演算結果のうちの何れかの演算結果を選択し、前記2つのオペランドに対する演算が、演算結果が負となる異符号の数同士の加算である場合、前記第1の演算結果、前記第3の演算結果、前記第4の演算結果及び前記第6の演算結果のうちの何れかの演算結果に対し1の補数をとった値を選択して10進絶対値加算結果を出力する選択回路と、を有する10進絶対値加算器。
  2.  請求項1に記載の10進絶対値加算器であって、
     前記選択回路は、前記同符号の数同士の加算か前記異符号の数同士の加算かを示す信号、前記第1の演算回路のキャリー出力信号、前記第4の演算回路のキャリー出力信号及び下位の桁からのキャリー伝播信号を用いて、前記第1の演算結果、前記第2の演算結果、前記第4の演算結果及び前記第5の演算結果のうちのいずれかを選択し、
     前記第1の演算回路のキャリー出力信号、前記第4の演算回路のキャリー出力信号及び下位の桁からのキャリー伝播信号を用いて、前記第1の演算結果、前記第3の演算結果、前記第4の演算結果及び前記第6の演算結果のうちのいずれかの演算結果に対し1の補数をとった値を選択することを特徴とする10進絶対値加算器。
  3.  更に、前記演算結果に対し1の補数をとる処理を行う回路として、ビット毎に値を反転するインバータ回路を設けることを特徴とする、請求項1又は2に記載の10進絶対値加算器。
  4.  請求項1~3のうちの何れか一項に記載の10進絶対値加算器であって、
     前記第1の演算回路、前記第2の演算回路、前記第3の演算回路、前記第4の演算回路、前記第5の演算回路及び前記第6の演算回路並びに選択回路を有する、10進数の一桁分の10進絶対値加算結果を出力する一桁分加算回路を第1の複数個組み合わせて10進数の第1の複数桁分の10進絶対値加算結果を出力する第1の複数桁分加算回路ブロックと、
     前記第1の複数桁分加算回路ブロックが有する、前記第1の複数個の一桁分加算回路の夫々に対するキャリーを生成する第1の複数桁内キャリー生成回路と、
     前記第1の複数桁分加算回路ブロックを第2の複数個組み合わせて、10進数の第1の複数桁に前記第2の複数を乗じて得た第3の複数桁分の10進絶対値加算結果を出力する第3の複数桁分加算回路を形成し、
     前記第3の複数の桁分加算回路が有する、前記第2の複数個の前記第1の複数桁分加算回路ブロックの夫々に対するキャリーを生成する第1の複数桁単位キャリー生成回路と、を有する10進絶対値加算器。
  5.  請求項1~4のうちの何れか一項に記載の10進絶対値加算器であって、
     前記10進絶対値加算器を2進絶対値加算器として使用する場合に、前記選択回路が、前記2つのオペランドに対する演算が同符号の数同士の加算である場合、或いは演算結果が負とはならない異符号の数同士の加算である場合には前記第1の演算結果又前記第4の演算結果を選択させ、前記2つのオペランドに対する演算が、演算結果が負となる異符号の数同士の加算である場合には、前記第1の演算結果又前記第4の演算結果に対し1の補数をとった数を選択させる切換回路を有することを特徴とする、10進絶対値加算器。
  6.  請求項1~5のうちの何れか一項に記載の10進絶対値加算器であって、
     前記第2の演算回路は、前記2つのオペランドを加算して6を減算する演算を行って前記2つのオペランド及び10を加算して得られる演算結果を得、
     前記第3の演算回路は、前記2つのオペランドを加算して10を減算する演算を行って前記2つのオペランド及び6を加算して得られる演算結果を得、
     前記第5の演算回路は、前記2つのオペランドを加算して5を減算する演算を行って前記2つのオペランド及び11を加算して得られる演算結果を得、
     前記第6の演算回路は、前記2つのオペランドを加算して9を減算する演算を行って前記2つのオペランド及び7を加算して得られる演算結果を得ることを特徴とする、10進絶対値加算器。
  7.  2つのオペランドの10進絶対値加算を行う10進絶対値加算器であって、
     10進数の一桁につき、前記2つのオペランドを加算して第1の演算結果を出力する第1の演算回路と、
     前記10進数の一桁につき、前記2つのオペランド及び6を加算して第3の演算結果を出力する第3の演算回路と、
     前記2つのオペランドに対する演算が異符号の数同士の加算であり、再補数化が必要であり、前記10進数の一桁に対する下位からの桁上がりが無い場合に、前記第1の演算結果及び前記第3の演算結果のうちの何れかの演算結果に対し1の補数をとった値を選択して10進絶対値加算結果を出力する選択回路と、を有する10進絶対値加算器。
  8.  2つのオペランドの10進絶対値加算を行う10進絶対値加算器であって、
     10進数の一桁につき、前記2つのオペランド及び1を加算して第4の演算結果を出力する第4の演算回路と、
     前記10進数の一桁につき、前記2つのオペランド及び7を加算して第6の演算結果を出力する第6の演算回路と、
     前記2つのオペランドに対する演算が異符号の数同士の加算であり、再補数化が必要であり、前記10進数の一桁に対する下位からの桁上がりが有る場合に、前記第4の演算結果及び前記第6の演算結果のうちの何れかの演算結果に対し1の補数をとった値を選択して10進絶対値加算結果を出力する選択回路と、を有する10進絶対値加算器。
PCT/JP2010/071923 2010-12-07 2010-12-07 10進絶対値加算器 WO2012077185A1 (ja)

Priority Applications (3)

Application Number Priority Date Filing Date Title
JP2012547619A JP5549743B2 (ja) 2010-12-07 2010-12-07 10進絶対値加算器
PCT/JP2010/071923 WO2012077185A1 (ja) 2010-12-07 2010-12-07 10進絶対値加算器
US13/873,517 US20130238680A1 (en) 2010-12-07 2013-04-30 Decimal absolute value adder

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP2010/071923 WO2012077185A1 (ja) 2010-12-07 2010-12-07 10進絶対値加算器

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US13/873,517 Continuation US20130238680A1 (en) 2010-12-07 2013-04-30 Decimal absolute value adder

Publications (1)

Publication Number Publication Date
WO2012077185A1 true WO2012077185A1 (ja) 2012-06-14

Family

ID=46206706

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2010/071923 WO2012077185A1 (ja) 2010-12-07 2010-12-07 10進絶対値加算器

Country Status (3)

Country Link
US (1) US20130238680A1 (ja)
JP (1) JP5549743B2 (ja)
WO (1) WO2012077185A1 (ja)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11099853B2 (en) 2019-02-15 2021-08-24 International Business Machines Corporation Digit validation check control in instruction execution
US11023205B2 (en) 2019-02-15 2021-06-01 International Business Machines Corporation Negative zero control in instruction execution

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH03259330A (ja) * 1990-03-08 1991-11-19 Fujitsu Ltd 加算、又は減算のための二入力算術演算方式及び10進加減算回路
JPH11312076A (ja) * 1998-04-28 1999-11-09 Fujitsu Ltd 10進演算装置

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4110831A (en) * 1977-06-29 1978-08-29 International Business Machines Corporation Method and means for tracking digit significance in arithmetic operations executed on decimal computers
US8612500B2 (en) * 2007-01-18 2013-12-17 International Business Machines Corporation Method and decimal arithmetic logic unit structure to generate a magnitude result of a mathematic
US8554822B2 (en) * 2010-06-24 2013-10-08 International Business Machines Corporation Decimal adder with end around carry

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH03259330A (ja) * 1990-03-08 1991-11-19 Fujitsu Ltd 加算、又は減算のための二入力算術演算方式及び10進加減算回路
JPH11312076A (ja) * 1998-04-28 1999-11-09 Fujitsu Ltd 10進演算装置

Also Published As

Publication number Publication date
US20130238680A1 (en) 2013-09-12
JPWO2012077185A1 (ja) 2014-05-19
JP5549743B2 (ja) 2014-07-16

Similar Documents

Publication Publication Date Title
JP2000347836A (ja) 高次基数除算器およびその方法
US4878192A (en) Arithmetic processor and divider using redundant signed digit arithmetic
JP3313002B2 (ja) 浮動小数点演算装置
JP5549743B2 (ja) 10進絶対値加算器
JPH10289096A (ja) 論理回路及び浮動小数点演算装置
KR101007259B1 (ko) 패리티 생성 회로, 계수 회로 및 계수 방법
US9448767B2 (en) Three-term predictive adder and/or subtracter
US4866655A (en) Arithmetic processor and divider using redundant signed digit
US7313586B2 (en) Adder-subtracter circuit
Al-Khaleel et al. Fast binary/decimal adder/subtractor with a novel correction-free BCD addition
US11294630B2 (en) Adder-subtractor circuit and method of controlling adder-subtractor circuit
US5978826A (en) Adder with even/odd 1-bit adder cells
JP4372822B2 (ja) パリティ予測回路及びこれを使用した論理演算回路
JP3741280B2 (ja) 桁上げ先見回路およびこれを用いた加算回路
US20030146860A1 (en) Exponent encoder circuit and mask circuit
JP3482102B2 (ja) 絶対値距離演算回路
Tyagi et al. A novel hardware efficient reconfigurable 32-bit arithmetic unit for binary, BCD and floating point operands
JP2752564B2 (ja) 先行1予測装置及び浮動小数点加減算装置
Chawla et al. Hardware efficient reconfigurable arithmetic unit
Veeramachaneni et al. A novel carry-look ahead approach to a unified bcd and binary adder/subtractor
JP3803653B2 (ja) 乗算処理装置
US8516030B2 (en) Carry look-ahead circuit and carry look-ahead method
JPH113210A (ja) 3入力比較器、並びにこれを用いた飽和演算装置およびその演算方法
KR0154934B1 (ko) 개선된 2의 보수회로
JPH10307709A (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: 10860538

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2012547619

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: 10860538

Country of ref document: EP

Kind code of ref document: A1