Floating-point arithmetic simplifies programming by
automatically maintaining binary point placement
( scaling) during computations in which the range of
values used vary widely or are unpredictable.
The key to floating-point data representation is the
separation of the significant digits of a number from
the size (scale) of the number. Thus, the number is
expressed as a fraction times a power of 16.
A floating-point number has two associated sets of
values.One set represents the significant digits of the
num ber and is called the fraction. The second set
specifies the power (exponent) to which 16 is raised
and indicates the location of the binary point of the
number.
These two numbers (the fraction and exponent) are
recorded in a single word or double-word.Since each of these two numbers is signed, some
method must be employed to express two signs in an
area that provides for a single sign. This isaccom plished by having the fraction sign use the sign associ ated with the word (or double word) and expressing
the exponent in excess 64 arithmetic; that is, theex ponent is added as a signed number to 64. The result ing number is called the charactcristic. Since 64 uses 7
bits, the characteristic can vary from0 to 127, permit ting the exponent to vary from -64 through 0 to +63.
This provides a decimal range of n x10
75 to n x 10-
78
• Floating-point data in the System/360 may be re corded in short or long formats, depending on the
precision required. Both formats use a sign bit in bit
position0, followed by a characteristic in bit positions
1-7. Short-precision floating-point data operandscon tain the fraction in bit positions 8-31; long-precision
operands have the fraction in bit positions 8-63.
Short-Precision Floating-Point FormatIs I Characteristic I Fraction
o 1 7 8 31
Long-Precision Floating-Point Format _________ F_ra_c_ti_o_n ______ ____ o 1 7 8 63
The sign of the fraction is indicated by a zero or one
bit in bit position0 to denote a positive or negative
fraction, respectively.
AppendixC. Floating-Point Arithmetic
Within a given fraction length (24 or 56 bits), a
floating-point operation will provide the greatestpre cision if the fraction is normalized. A fraction is nor malized when the high-order digit (bit positions 8,
9,10 and 11) is not zero. It is unnormalized if the
high-order digit contains all zeros.
If normalization of the operand is desired, thefloat ing-point instructions that provide automatic normal ization are used. This automatic normalization is ac complished by left-shifting the fraction (four bits per
shift) until a nonzero digit occupies the high-order
digit position. The characteristic is reduced by one for
each digit shifted.Conversion Example Convert the decimal number 149.25 to a short-preci
sion floating-point operand.
1. The number is decomposed into a decimal integer
and a decimal fraction.
149.25 149 plus0.25 2. The decimal integer is converted to its hexadeci
mal representation.
14910
3. The decimal fraction is converted to its hexadeci
mal representation.0.2510 4. Combine the integral and fractional parts and ex press as a fraction times a power of 16 (exponent).
95.4]6(0.954 X 16
2
ha 5. The characteristic is developed from the expon ent and converted to binary.
base + exponent characteristic
64 + 2 = 66 = 10 0 0 0 1 0 6. The fraction is converted to binary and grouped
hexadecimally..95410 = .1001 0101 0100 7. The characteristic and the fraction are stored in
short precision format. The sign position contains the
sign of the fraction.
S Char Fraction
o1000010 100101010100000000000000 Appendix C 133
automatically maintaining binary point placement
( scaling) during computations in which the range of
values used vary widely or are unpredictable.
The key to floating-point data representation is the
separation of the significant digits of a number from
the size (scale) of the number. Thus, the number is
expressed as a fraction times a power of 16.
A floating-point number has two associated sets of
values.
num ber and is called the fraction. The second set
specifies the power (exponent) to which 16 is raised
and indicates the location of the binary point of the
number.
These two numbers (the fraction and exponent) are
recorded in a single word or double-word.
method must be employed to express two signs in an
area that provides for a single sign. This is
the exponent in excess 64 arithmetic; that is, the
bits, the characteristic can vary from
This provides a decimal range of n x
75
78
•
precision required. Both formats use a sign bit in bit
position
1-7. Short-precision floating-point data operands
operands have the fraction in bit positions 8-63.
Short-Precision Floating-Point Format
o 1 7 8 31
Long-Precision Floating-Point Format
The sign of the fraction is indicated by a zero or one
bit in bit position
fraction, respectively.
Appendix
Within a given fraction length (24 or 56 bits), a
floating-point operation will provide the greatest
9,
high-order digit contains all zeros.
If normalization of the operand is desired, the
shift) until a nonzero digit occupies the high-order
digit position. The characteristic is reduced by one for
each digit shifted.
sion floating-point operand.
1. The number is decomposed into a decimal integer
and a decimal fraction.
149.25 149 plus
mal representation.
14910
3. The decimal fraction is converted to its hexadeci
mal representation.
95.4]6
2
ha
base + exponent characteristic
64 + 2 = 66 = 1
hexadecimally.
short precision format. The sign position contains the
sign of the fraction.
S Char Fraction
o