Appendix
0
0.3
Floating
Point
Arithmetic,
Rounding,
and
Normalization
D-4
While floating
point
packages
do
not
always implement a rounding scheme,
rounding does increase the precision
of
operations and conversions. The
TMS34010
C floating
point
RTS
package implements rounding in any
func-
tion where
it
is
applicable. The particular scheme implemented in the
TMS34010
RTS
package
is
known
as
"round
toward infinity". This
is
the na-
tural rounding method whereby negative-valued floating
point
numbers are
rounded toward negative
infinity
and positive-valued numbers
are
rounded
toward positive infinity. Because
all mantissas
are
unsigned, this type
of
rounding
is
accomplished
by
adding one
to
the retained part
of
a mantissa
whenever the most significant
bit
discarded was a one. The exception
to
this
is
when
a floating
point
number
is
converted
to
an
integer, in
which
case the
fractional part
is
truncated.
In addition
to
the "round toward
infinity"
feature, the TMS3401 0 C floating
point
RTS
package also implements extended real-number arithmetic. This
means
that
the subset
of
real
numbers representable by the
RTS
package,
along
with
+ / - infinity, form a well-ordered set. Moreover, it means
that
arithmetic operations
with
+ / -
infinity
as
one
or
both
operands can be per-
formed
with
certain error generating exceptions (see Table
0-1,
page
0-7).
The extended real number system
is
critical
to
advanced mathematic and en-
gineering
disciplines and its implementation can, therefore, be extremely use-
ful.
Note:
The implementation
of
extended real-number arithmetic does
not
affect
the arithmetic
when
neither operand
is
+ / - infinity. Extended
real
arith-
metic
is
strictly
an
added feature.
Floating-point
numbers
which
have
an
invalid value V are never generated
by
TMS34010
C floating
point
functions. In addition, .all floating
point
numbers
generated by the
TMS3401 0 C functions
are
normalized. Oenormalized
num-
bers
are
considered
to
be invalid and
as
such are never generated
by
any
function.
Normalized
floating-point
numbers
(with
the exception
of
zero and
+/-
infin-
ity) have a one in the
MSB
of
the mantissa. Oenormalized results
are
always
normalized
before their return.
If
normalization cannot be accomplished in the
format's range, then the appropriate
underflow
error
is
generated. A float-
ing-point
number
is
normalized
by
shifting the mantissa left until the
MSB
of
the mantissa
is
one and then subtracting the shift
count
from the exponent.
An
example
of
single precision normalization
is
shown
in Figure
0-3.