Patent ID: 7912890
Filing Date: 2011-03-22
Classification: G06F

Abstract:
1. A machine-implemented method for performing a decimal number multiplication between a first operand and a second operand using hardware for binary number operations, comprising: obtaining, using the hardware, a first coefficient and a second coefficient, said first coefficient being the integer coefficient of said first operand and said second coefficient being the integer coefficient of said second operand; performing a binary multiplication operation between said first coefficient and said second operand to obtain a first product, using a binary integer multiplier of the hardware; rounding the number of decimal digits in said first product to a pre-determined number of digits in a designated rounding mode to obtain a second product based on a comparison of the number of decimal digits in said first product with said pre-determined number of digits, wherein the rounding comprises: determining the number of decimal digits in said first product; using said first product as said second product, if the number of decimal digits in said first product is less than or equal to said pre-determined number of digits; and otherwise, converting said first product to said second product, and the converting comprises: calculating a difference (x) between the number of decimal digits in said first product and said pre-determined number of digits; obtaining a binary representation of 10^(−x); and if said designated rounding mode is either rounding-down or rounding-up, performing a binary integer multiplication between said first product and said binary representation of 10^(−x) to produce an intermediate product; and if said designed rounding mode is rounding-to-nearest, obtaining a binary representation of (½*10^x), performing a binary addition between said first product and said binary representation of (½*10^x), and performing a binary integer multiplication between the result of said binary addition and said binary representation of 10^(−x) to produce said intermediate product; obtaining, using the hardware, a result for said decimal number multiplication based at least in part on said second product; and determining whether said result is exact.