Browse Prior Art Database

Packed Decimal To Binary Converter

IP.com Disclosure Number: IPCOM000088934D
Original Publication Date: 1977-Aug-01
Included in the Prior Art Database: 2005-Mar-04
Document File: 2 page(s) / 54K

Publishing Venue

IBM

Related People

Houdek, ME: AUTHOR

Abstract

A byte of packed decimal data normally contains two decimal digits. In past practice, each digit of the byte is converted separately. Improved performance is achieved by converting the two decimals at the same time on a byte basis. A first stage or portion of the conversion apparatus converts each byte containing two decimal digits into a binary equivalent. A second stage multiplies the accumulative result by 100, and adds the next converted byte to the accumulative result. The conversion takes place starting with the left-most nonzero byte of the packed decimal number and continues, byte-by-byte, until all bytes have been converted. The sign which resides in the low order byte (right-most four bits) is saved by right-justifying the packed decimal data before conversion takes place.

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 52% of the total text.

Page 1 of 2

Packed Decimal To Binary Converter

A byte of packed decimal data normally contains two decimal digits. In past practice, each digit of the byte is converted separately. Improved performance is achieved by converting the two decimals at the same time on a byte basis. A first stage or portion of the conversion apparatus converts each byte containing two decimal digits into a binary equivalent. A second stage multiplies the accumulative result by 100, and adds the next converted byte to the accumulative result. The conversion takes place starting with the left-most nonzero byte of the packed decimal number and continues, byte-by-byte, until all bytes have been converted. The sign which resides in the low order byte (right- most four bits) is saved by right-justifying the packed decimal data before conversion takes place.

The packed decimal data to be converted is entered into source register 10 of the drawing, and result register 40 is reset to zero. The left-most nonzero byte is detected by byte selector 15 and passed to the left input of subtractor 25. The four high order bits of the selected byte are applied to byte conversion translator 20 and, in this example, the four high order bits, as input data, address a translation table illustrated in Table 1, which contains conversion data forming the output of translator 20, representing the binary equivalent of two packed decimal digits.

The output of translator 20 is fed into the righthand side of subtractor 25, and a binary subtract operation is performed under control of signals from control unit
30. The binary equivalent of the two packed decimal digits is equal to the byte representation, minus the bit value thereof, times a difference weight from Table
1. A difference weight is equal...