HP 9835A Programming Manual page 110

35 series desktop computer assembly development rom
Table of Contents

Advertisement

Arithmetic 93
The mathematical properties of exponents can be utilized and the second exponent can be
subtracted from the first giving the exponent of the answer (subject to possible later adjust-
ment). This is the first (and easiest) step in the division algorithm.
Secondly, the mathematical properties of signs within a division process can be used to deter-
mine the sign of the quotient from the signs of the divisor and dividend (negative quotient if the
signs are different, positive quotient otherwise).
Thus, the problem can be reduced to the division of the mantissas -
(- 4.8
-7-
1.5) E5
As long as the full-precision numbers have been normalized, this adjustment of the exponents
works for any pair of exponents. The normalization of the numbers also assures that the
division of the mantissas under the following algorithm is sufficient to produce the mantissa of
the result.
Since the decimal point of each mantissa is in the same place, they can be dropped altogether.
For example -
- 4.8
-7-
1.5
= -
48
-7-
15
The algorithm can then consider both the divisor and the dividend as 12-digit integers.
The algorithm begins by placing the normalized values into the BCD arithmetic registers. The
divisor (1.5E2 in the example) is transferred to register Ar1. The dividend (- 4.8E3 in the
example) is transferred to register Ar2. Basically, the algorithm subtracts the absolute value of
the mantissa of Arl from the absolute value of the mantissa of Ar2 until Ar2 is smaller than Ar1.
The number of subtractions required for that to occur becomes the first digit in the quotient (it'll
be some value between 0 and 9 because the mantissas are normalized). If there is a (non-zero)
remainder, then it is shifted left (multiplied by 10) and the subtraction process is repeated to
calculate another digit in the quotient. The process is repeated until either a zero remainder
occurs, or sufficient digits have been calculated, whichever occurs first. The resulting digits are
merged, in order, to form the complete mantissa of the quotient.

Advertisement

Table of Contents
loading

Table of Contents