Patent ID: 8554822

Claim:
A computer program product for implementing a binary code decimal (BCD) arithmetic add/subtract operation on two BCD numbers independent of which BCD number is of a greater magnitude, the computer program product comprising a tangible storage medium readable by a processing circuit and storing instructions for execution by the processing circuit for performing a method, the method comprising: performing a BCD arithmetic add/subtract operation on a first BCD number A and a second BCD number B, wherein the first BCD number A has a first magnitude and the second BCD number B has a second magnitude, wherein the first magnitude is one of greater than, equal to, and less than the second magnitude, the performing comprising: generating carry information based on the first and second BCD numbers; in parallel to the generation of the carry information, computing a sum and two differences of the first and second BCD numbers; and selecting a final result in signed magnitude form from the sum and two differences based on the carry information and a control signal indicating one of an add operation and a subtract operation without any post processing steps.