Browse Prior Art Database

# Decimal Add/ Subtract Parity Predict

IP.com Disclosure Number: IPCOM000108781D
Original Publication Date: 1992-Jun-01
Included in the Prior Art Database: 2005-Mar-22
Document File: 5 page(s) / 129K

IBM

## Related People

Burton, RWB: AUTHOR [+1]

## Abstract

To protect the integrity of decimal arithmetic logic unit (ALU) operations, parity prediction must be performed. This article describes how it can be performed independent of binary parity prediction. This method uses a minimum number of logic levels to predict the parity for decimal ALU operations.

This text was extracted from an ASCII text file.
This is the abbreviated version, containing approximately 33% of the total text.

To protect the integrity of decimal arithmetic logic unit
describes how it can be performed independent of binary parity
prediction.  This method uses a minimum number of logic levels to
predict the parity for decimal ALU operations.

The hardware performs the following steps to do a decimal
operation:
1. Add 6 to each nibble of the left ALU input if the ALU is
2. Invert the right ALU input if there is a decimal subtract
function.
3. Perform normal binary arithmetic.
4. Subtract 6 from each nibble of the result if the carryout of that
nibble is a zero.
Because of the adding and subtracting of 6 from the input and result,
the parity predict equations used for a binary ALU operation do not
work for a decimal ALU operation.

To do decimal parity prediction, the following steps are
performed:
1. Functions are created for each nibble that are true if the result
of the decimal operation will have different parity than the parities
of the two inputs.  Four of these functions are generated for each
nibble:
Decimal Subtract with Carry-In
Decimal Subtract without Carry-In
2. These functions are used to create four possible decimal add
parity outs and four possible decimal subtract parity outs.
3. The correct byte parity is then selected based upon the two actual
carry-ins of the two nibbles that make up the byte.

The actual equations are now listed.  The equations use the
following symbols:
A(x) = Left Input.
B(x) = Right Input
= Logical Not
||= Concatenate
| = Logical OR
& = Logical AND
XOR = Logical XOR
DSubNxCin0 = Decimal Sub of Nibble x without a carry-in.
DSubNxCin1 = Decimal Sub of Nibble x with a carry-in.
ByteParL = Corresponding byte parity of left input.
ByteParR = Corresponding byte parity of right input.
BytPrAxy = Predicted Parity based on the 4 possible combinations
of the carry-in of the nibbles corresponding to the bytes for a
BytPrSxy = Predicted Parity based on the 4 possible combinations
of the carry-in of the nibbles corresponding to the bytes for a
decimal subtract operation.
BytPrAx = The predicted byte parity for byte x for a decimal add
operation.
BytPrSx = The predicted byte parity for byte x for a decimal
subtract operation.
NxCin = Carry-in of nibble x.

The first set of equations perform step 1 of decimal parity
predict.