Method And Decimal Arithmetic Logic Unit Structure To Generate A Magnitude Result of a Mathematic
AssigneeInternational Business Machines Corporation
InventorsWilhelm Haller, Ulrich Krauch, Guenter Mayer, Eric M. Schwarz
Life of this patent
Estimating the term…
Abstract
A method to generate a magnitude result of a mathematic operation of two decimal operands within one cycle in a decimal arithmetic logic unit structure, wherein the decimal operands are in hexadecimal sign magnitude format.
Claims14
Method to generate a magnitude result of a mathematic operation of two decimal operands within one cycle in a decimal arithmetic logic unit structure, wherein the decimal operands are in hexadecimal sign magnitude format with each decimal digit of the operands represented by a code of four bits, said method comprising:
- preparing the two decimal operands for a mathematic operation;
- generating preliminary result digits by digitwise adding the digits of the prepared operands, under an assumption that digit carry-ins is zero;
- generating preliminary result digits by digitwise adding the digits of the prepared operands, under an assumption that digit carry-ins is one;
- determining digit carry-outs, which digit carry-outs are digit carry-ins for the next higher digits respectively, wherein an end around carry is generated that is the digit carry-out of the most significant digit that simultaneously is the carry-in of the least significant digit;
- digitwise selecting preliminary result digits to generate an intermediate result, wherein the preliminary result digits are selected, whose digit carry-in assumptions match the digit carry-ins;
- selectively bitwise inverting said intermediate result in case of a subtraction, wherein said selectively bitwise inversion depends on said end around carry;
- and
- selectively correcting digits of said selectively inverted intermediate result to obtain the magnitude result of the mathematic operation, wherein said selectively correction in case of a subtraction depends on the value of the end around carry and the value of the digit carry-out of the particular digit, and in case of an addition depends on the value of the digit carry-out of the particular digit.
Decimal arithmetic logic unit structure to generate a magnitude result of a mathematic operation of two decimal operands within one cycle, wherein the decimal operands are in hexadecimal sign magnitude format with each decimal digit of the operands represented by a code of four bits, said decimal arithmetic logic unit structure comprising:
- means to prepare the two decimal operands for a desired mathematic operation;
- means to generate preliminary result digits by digitwise adding the digits of the prepared operands under the assumption of digit carry-ins of zero;
- means to generate preliminary result digits by digitwise adding the digits of the prepared operands, when the digit carry-ins is one,
- wherein said decimal arithmetic logic unit structure comprises:
- means to determine digit carry-outs according to end around carry principles, which digit carry-outs are digit carry-ins for the next higher digits respectively, wherein an end around carry is generated that is the digit carry-out of the most significant digit which simultaneously is the carry-in of the least significant digit,
- means to digitwise select preliminary result digits to generate an intermediate result, wherein the preliminary result digits are selected, having carry-in assumptions match the digit carry-ins determined according to said end around carry principles,
- means to selectively bitwise invert said intermediate result in case of a subtraction, wherein said selectively bitwise inversion depends on said end around carry, and
- means to selectively correct digits of said selectively inverted intermediate result to obtain the magnitude result of the mathematic operation, wherein said selectively correction in case of a subtraction depends on the value of the end around carry and the value of the digit carry-out of the particular digit, and in case of an addition depends on the value of the digit carry-out of the particular digit.
Dependencies are inferred from the claim text.