Dismiss
The Prior Art Database and Publishing service will be updated on Sunday, February 25th, from 1-3pm ET. You may experience brief service interruptions during that time.
Browse Prior Art Database

Packed Decimal Multiply Algorithm

IP.com Disclosure Number: IPCOM000084310D
Original Publication Date: 1975-Oct-01
Included in the Prior Art Database: 2005-Mar-02
Document File: 1 page(s) / 12K

IBM

Related People

Hoffman, RL: AUTHOR [+2]

Abstract

For machines without extensive add or shift support, this algorithm realizes an execution speed advantage. This is accomplished in part by avoiding the half-byte shifts usually needed, since two decimal digits are represented in each byte of packed decimal data. Also, the total number of additions is lowered by the use of multiplicant multiples.

This text was extracted from a PDF file.
This is the abbreviated version, containing approximately 57% of the total text.

Page 1 of 1

Packed Decimal Multiply Algorithm

For machines without extensive add or shift support, this algorithm realizes an execution speed advantage. This is accomplished in part by avoiding the half-byte shifts usually needed, since two decimal digits are represented in each byte of packed decimal data. Also, the total number of additions is lowered by the use of multiplicant multiples.

Multiplication is performed by repetitive addition to the multiplicand to a partial product a number of times proportional to the digit value in the 1's position of the multiplier. The multiplicand is multiplied by 10 if there is a digit in the 10's position of the multiplier, and addition occurs a number of times proportional to the 10's digit value. Multiplication of the multiplicand and addition to the partial product is repeated for all digits of the multiplier. Function equivalent to that specified by the S/370 Multiply Packed (MP) instruction is performed.

The number of additions is reduced by computing the value "two times the multiplicand" (X2), which along with "one times the multiplicand" (X1) is added and subtracted with carry to the partial product. The notation "with carry" means that the indicated operations are to be performed and the effective value of the next multiplier digit to the left is increased by +1. The idea is based on the equivalence; 9 x 4 = 10 x 4 - 1 x 4.

The half-byte shifts are eliminated by computing X10 and X20 and using them in conjunction with X1 and X...