BCD to Binary Conversion of 3-Digit Numbers
| 5-6
|
Donald V. Weaver, New York, New York
This program is based on DEC-5-4 and is intended to illustrate
the use of alternative models in program construction.
While not the fastest possible, this program has one or two
interesting features. It converts any 3-digit BCD-coded
decimal number, D1D2D3 into binary in the invariant time
of 372 microseconds. Efficient use is made of BCD positional
logic to work the conversion formula (10D1 + D2)10 + D3 by
right shifts in the accumulator. In special situations, it could
be profitable to insert an initial test/exit on zero, adding
12 microseconds to the time for nonzero numbers. (Write-up
and Listing Only)