Browse Prior Art Database

# Fast Decimal-To-Binary Conversion Technique

IP.com Disclosure Number: IPCOM000035342D
Original Publication Date: 1989-Jul-01
Included in the Prior Art Database: 2005-Jan-28
Document File: 2 page(s) / 38K

IBM

## Related People

Liu, JM: AUTHOR [+2]

## Abstract

A new technique is introduced in this article for converting decimal numbers to binary numbers. To convert a decimal number to a binary number, the technique processes a decimal digit at a time from the right to the left until all digits are processed. The value of the least significant digit is loaded into a binary accumulator initially. Starting from the second digit (the tens), the value of each digit, if not 0, is used as an index to a table of pre-computed binary values. The binary values from the table are added up. When the algorithm terminates, the result is the number in the binary accumulator.

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

Page 1 of 2

Fast Decimal-To-Binary Conversion Technique

A new technique is introduced in this article for converting decimal numbers to binary numbers. To convert a decimal number to a binary number, the technique processes a decimal digit at a time from the right to the left until all digits are processed. The value of the least significant digit is loaded into a binary accumulator initially. Starting from the second digit (the tens), the value of each digit, if not 0, is used as an index to a table of pre-computed binary values. The binary values from the table are added up. When the algorithm terminates, the result is the number in the binary accumulator.

The following describes the sequence of operations that are performed by this algorithm in detail: 1. Initialize the binary accumulator by the value of the least significant digit and set table index to 1 (see A of the figure). 2. If all digits are processed, exit the algorithm with binary result in the binary accumulator. If not, isolate the next most significant digit. 3. Test if the digit is zero. If it is zero, go to step 6. If it is not zero, proceed with step 4. 4. Use the value of the digit isolated in step 2 as an index to a table, indicated by the table index, which contains pre-computed binary values (see B and C of the figure). 5. Extract the value identified by step 4, and add it to the binary accumulator (see D of the figure). 6. Increment table index by 1 and return to step 2.

The figure provides a pictoria...