Short Floating-Point Number lsi ____ o 1 8 31
Long Floating-Point Number S Charactl3ristic 63
Extended Floating-Point Number I s I Characteristic High-Drder Half of F o 8 ' 63
64 72 Low-Order Half 127
In the short and long formats, the first bit is the
sign bit (51). The subsequent seven bit positions are
occupied by the characteristic. The following field
contains the fraction, which, depending on the for­
mat, consists of six or 14 hexadecimal digits.
Short floating-point numbers occupy only the
leftmost 32 bit positions of a floating-point register.
When a floating-point register is used as the source
of a short floating-point number, the rightmost 32
bit positions of the register are ignored. When a
floating-point register is used as the destination of a
short floating-point number, the rightmost 32 bit
positions IOf the register remain unchanged.
An extended floating-point number has a 28-digit
fraction and consists of two long floating-point num­
bers in consecutive floating-point registers. Two
pairs of fllDating-point registers can be used as
sources of extended operands or destinations of ex­
tended results: registers 0, 2 and registers 4, 6 .. The
designation of any other register pair causes the op­
eration to be and a program interruption
for a specification exception to occur.
The two long floating-point numbers comprising
an extended floating-point number are called the
high-order and low-order parts. The high-order part
may be allY long floating-point number. If it is nor­
malized, the extended number is considered normal­
ized. The characteristic of the high-order part is the
characteristic of the extended number, and the sign
of the high-order part is the sign of the extended
number.
The fraction field of the low-order part contains
the 14 low-order hexadecimal digits of the 28-digit
extended fraction. The sign and characteristic of the
low-order part of an extended operand are ignored,
the value of the number being assumed such as if the
158 System/370 Principles of Operation sign of the low-order part were the same as that of
the high-order part, and the characteristic of the
low-order part were 14 less than that of the high­
order part. In extended results, the sign of the low­
order part is made the same as that of the high-order
part, and, unless the result is a true zero, the low­
order characteristic is made 14 less than the high­
order characteristic. When the subtraction of 14
causes the low-order characteristic to become less
than zero, it is made 128 larger than its correct val­
ue. Exponent-underflow is indicated only when the
high-order characteristic underflows.
The entire set of floating-point functions is availa­
ble for short and long operands. These instructions
generate a result that has the same format as the
sources, except that in the case of MULTIPLY, a
long product is produced from a short multiplier and
multiplicand. For extended operands, instructions
are provided for normalized addition, subtraction,
and multiplication. Additionally, two multiplication
instructions are provided that generate an extended
product from a long multiplier and multiplicand.
The rounding instructions provide for rounding from
extended to long format and from long to short for-
mat. i Programming Note
A long floating-point number can be extended to the
extended format by appending any long floating­
point number having a zero fraction, including a true
zero. Conversion from the extended to the long for­
mat can be accomplished by truncation or by means
of LOAD ROUNDED. In the absence of an exponent overflow or expo­
nent underflow, the long floating-point number con­
stituting the low-order part of an extended result
correctly expresses the value of the low-order part of
the extended result when the characteristic of the
high-order part is 14 or higher. This relation is true
also when the result is a true zero. When the high­
order characteristic is less than 14 but the number is
not a true zero, the low-order part, when addressed
as a long floating-point number, does not have the
correct characteristic value.
Guard Digit
Although final results have six fraction digits in the
short format, 14 fraction digits in the long format,
and 28 fraction digits in the extended format, inter­
mediate results in ADD NORMALIZED, SUB­ TRACT NORMALIZED, ADD UNNORMAL­ IZED, SUBTRACT UNNORMALIZED, COM- P ARE, HALVE, and MULTIPLY may have one
additional low-order digit. This low-order digit, the
guard digit, increases the precision of the final re- . suIt.
Number Representation
The fraction of a floating-point number is expressed
in hexadecimal digits. The radix point of the fraction
is assumed to be immediately to the left of the high­
order fraction digit. The fraction is considered to be
multiplied by a power of 16. The characteristic por­
tion, bits 1-7 of the floating-point formats, indicates
this power. The bits within the characteristic field
can represent numbers from 0 through 127. To ac­
commodate large and small magnitudes, the charac­
teristic is formed by adding 64 to the actual expo­
nent. The range of the exponent is thus -64 through
+63. This technique produces a characteristic in
excess-64 notation.
Both positive and negative quantities have a true
fraction, the sign being indicated by the sign bit. The
number is positive or negative, depending on wheth­
er the sign bit is zero or one, respectively.
The range covered by the magnitude (M) of a
normalized floating-point number is:
In the short format:
16-
65 M (1-16-
6
')
X 16
63
In the long format:
16-
65 M (1-16-
14
) X 16
63
In the extended format:
16-
65 M (1-16-
28
) X 16
63
In all formats, approximately:
5.4 x 10-
79
M 7.2 X 10
75
A number with a zero characteristic, zero frac­
tion, and plus sign is called a true zero. When an
extended result is made a true zero, both the high­
order and low-order parts are made true zero.
A true zero may arise as the result of an arithme­
tic operation because of the particular magnitude of
the operands. A result is forced to be true zero when
(1) an exponent underflow occurs and the exponent­
underflow mask bit in the PSW is zero, (2) the result
fraction of an addition or subtraction operation is
zero and the significance mask bit in the PSW is
zero, or (3) the operand of HAL VB, one or both
operands of MULTIPLY, or the dividend in DI­ VIDE has a zero fraction.
When a program interruption due to exponent
underflow occurs, a true zero fraction is not forced;
instead, the fraction and sign remain correct, and the
characteristic is 128 too large. When a program in­
terruption due to the significance exception occurs,
the flaction remains zero, the sign is positive, and
the characteristic remains correct. The exponent­
overflow and exponent-underflow exceptions do not
cause a program interruption when the result has a
zero fraction. When a divisor has a zero fraction,
division is omitted, and a program interruption for a
floating-point-divide exception occurs. In addition
and subtraction, an operand with a zero fraction or
characteristic participates as a normal number.
The sign of a sum, difference, product, or quo­
tient with zero fraction is positive. The sign of a
zero fraction resulting from other operations is es­
tablished by the rules of algebra from the operand
signs.
Normalization
A quantity can be represented with the greatest pre­
cision by a floating-point number of given fraction
length when that number is normalized. A normal­
ized floating-point number has a nonzero high-order
hexadecimal fraction digit. If one or more high-order
fraction digits are zero, the number is said to be un­
normalized. The process of normalization consists of I shifting the fraction left, one digit at a time, until high-order hexadecimal digit is nonzero and reducmg
the characteristic by the number of hexadecimal
digits shifted. For ex;tended results, the entire frac­
tion participates in the normalization; therefore, the
low-order part mayor may not appear to be a nor­
malized long number, depending on the value of the
fraction. A number with a zero fraction cannot be
normalized, and its characteristic therefore remains
unchanged when normalization is called for.
Normalization usually takes place when the inter­
mediate arithmetic result is changed to the final re­
sult. This function is called postnormalization. In
performing multiplication and division, the operands
are normalized before the arithmetic process. This
function is called prenormalization.
Floating-point operations may be performed with
or without normalization. Most operations are per­
formed only with normalization. Addition and sub­
traction with short or long operands may be speci­
fied either way.
When an operation is performed without normali­
zation, high-order zeros in the result fraction are not
eliminated. The result mayor may not be normal­
ized, depending upon the original operands.
In both normalized and unnormalized operations,
the initial operands need not be in normalized form.
Also, intermediate fraction results are shifted right
when an overflow occurs, and the intermediate frac­
tion result is truncated to the final result length after
the shifting, if any.
Programming Note
Since normalization applies to hexadecimal digits,
the three high-order bits of the fraction of a normal­
ized number may be zero.
Floating-Point Instructions 159
Previous Page Next Page