Normalization; Rounding - HP 9835A Programming Manual

35 series desktop computer assembly development rom
Table of Contents

Advertisement

Arithmetic
89
The process for this "justification" of exponents can be summed up as follows:
• Subtract one exponent from the other storing the absolute value of the difference in the B
register.
• Execute the MRX shift
if
the Ar1 register is smaller; execute the MRY shift if the Ar2
register is smaller.
Normalization
The raw result of an arithmetic operation (such as FXA) might not be a floating-point number
that fits the standard form. It might have a leading DC needing to be incorporated into the
number, as was seen in the "Addition" section earlier. Another possible deviation is a resulting
Dl of zero and no overflow. There could also be several zero-valued digits as left-most digits of
the mantissa.
Such situations call for "normalization". One type of normalization is accomplished with the
NRM instruction. This instruction shifts register Ar2 left, leaving the number of shifts required in
the B register as a binary number. The maximum number of shifts NRM performs is 12. If NRM
must do all twelve shifts, Ar2 must have been O. This is indicated by a value of 12 left in Band
DC being set. For any other shift-count, NRM will leave DC at O.
The rules for the normalization process are -
• Execute the NRM instruction.
• Follow this instruction by adding the complement of the contents of B (shifted left 6 bits)
to the Ar2 exponent unless DC is set. If DC is set, store 0 into Ar2.
• Test the exponent result for an underflow.
Rounding
The addition operation (FXA) does not automatically round a result, and there is no instruction
which does rounding in one step. Instead, it is necessary that a series of instructions be estab-
lished to accomplish the result.
Recalling from "Floating Point Summations" (above) that the leftmost digit for rounding pur-
poses
(if
any) is typically deposited in the A register by an MRX or MRY instruction, this digit
can be checked to determine if rounding is required.

Advertisement

Table of Contents
loading

Table of Contents