Browse Prior Art Database

Implementation of BINARY Integer-To-Bcd and BCD-TO-BINARY INTEGER Conversions

IP.com Disclosure Number: IPCOM000036589D
Original Publication Date: 1989-Oct-01
Included in the Prior Art Database: 2005-Jan-29
Document File: 4 page(s) / 87K

Publishing Venue

IBM

Related People

Steimle, A: AUTHOR

Abstract

The respective methods of implementing binary integer-to-BCD and BCD-to-binary integer conversions in a IEEE 754 floating point coprocessor are given below.

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

Page 1 of 4

Implementation of BINARY Integer-To-Bcd and BCD-TO-BINARY INTEGER Conversions

The respective methods of implementing binary integer-to-BCD and BCD-to- binary integer conversions in a IEEE 754 floating point coprocessor are given below.

A) BINARY INTEGER-TO-PACKED BCD CONVERSION: The integer to be converted must have no more than 60 significant bits; otherwise, it cannot fit into the target format (18 packed BCD digits or 72 bits).

The algorithm is to start with the most significant bit of the number stored in register 2 and to repeat the same algorithm for the next bits. For that the temporary register 2 is shifted left 1 position (by the scan chain) each machine cycle in order to shift into the LEFT

(Image Omitted)

MUX the bit shifted out (bit 12 in Fig. 2). The accumulator content is decimal doubled each machine cycle; it is shifted left 1 position by the multiplex input SL1, then corrected by the + 6 circuitry to get the BCD digits as shown in Fig. 2.

For a 60-bit number the algorithm is repeated 60 times to get an 18-digit BCD number that means the conversion is performed in 60 machine cycles.

Each digit of the left MUX output is compared to 9 by the +6 circuitry (2 X 3 AO) in order to correct the digit if the SL1 has produced a BCD digit > 9, as shown in Fig. 1.

It is possible to save 3 cycles by starting the algorithm with the first 3 bits but with some complexity drawbacks.

B) PACKED BCD-TO-BINARY INTEGER CONVERSION: The algorithm to convert a packed BCD number to a binary integer is also simple. Even the conversion ti...