Browse Prior Art Database

# Zoned Decimal Arithmetic

IP.com Disclosure Number: IPCOM000078260D
Original Publication Date: 1972-Dec-01
Included in the Prior Art Database: 2005-Feb-25
Document File: 3 page(s) / 24K

IBM

## Related People

Franklin, JW: AUTHOR

## Abstract

A means is described for performing arithmetic on zoned decimal data that does not require additional storage space for the intermediate result, and which preserves both operands until it is determined that the operation has been performed correctly and successfully.

This text was extracted from a PDF file.
At least one non-text object (such as an image or picture) has been suppressed.
This is the abbreviated version, containing approximately 57% of the total text.

Page 1 of 3

Zoned Decimal Arithmetic

A means is described for performing arithmetic on zoned decimal data that does not require additional storage space for the intermediate result, and which preserves both operands until it is determined that the operation has been performed correctly and successfully.

Zoned decimal data is common in computers whose unit of information is the 8-bit byte. The leftmost four bits of each byte are called the zones; the arithmetic sign of the number is determined from the code employed in the rightmost zone of the rightmost byte (sign over units). In the IBM System/370 computer, these zones are represented by the four-bit codes 1010-1111. The rightmost four bits of each byte represent the decimal numbers 0-9, using the four-bit codes 0000- 1001.

In decimal arithmetic, the first operand field is sometimes considered to also be the destination field for the result. Thus, the first operand is destroyed by the operation, unless an intermediate result field is maintained somewhere in the system. However, if one examines the format of zoned decimal data, one discovers that the zone fields can be used to store intermediate results, thus obviating need for expensive intermediate-result space in memory or register. Also, in those cases where the arithmetic operation is terminated due to a system-determined error, the original operand can easily be restored.

For purposes of illustration consider the following example.

The instruction, ADD ZONED, means to add the second operand (a zoned decimal number) to the first operand (a zoned decimal number), and store the result in the location occupied by the first operand as a zoned decimal number. s

FIRST OPERAND Z1Z2Z3Z4Z5

s

SECOND OPERAND Z0Z9Z0Z1Z0

FIRST OPER...