Download Print this page

IBM 4300 Manual page 258

Processors principles of operation for ecps: vse mode
Hide thumbs Also See for 4300:

Advertisement

More precisely,
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
Within a given fraction length (6, 14, or 28
digits), a floating-point operation will provide the
greatest precision if the fraction is normalized. A
fraction is normalized when the leftmost digit (bit
positions 8, 9, 10, and 11) is nonzero.
It
is
unnormalized if the leftmost digit contains all
zeros.
If normalization of the operand is desired, the
floating-point instructions that provide automatic
normalization are used. This automatic
normalization is accomplished by left-shifting the
fraction (four bits per shift) until a nonzero digit
occupies the leftmost digit position. The
characteristic is reduced by one for each digit
shifted.
The following are sample normalized short
floating-point numbers. The last two numbers
represent the smallest and the largest positive
normalized numbers.
~
Powers of
16
S <-Char-> <----------Fract lon--------->
I 0
=
+1/16xI6 1
=
0 100 0001 0001 0000 0000 0000 0000 0000
O· 5
.. +8/16xI6 0
=
0 100 0000 1000 0000 0000 0000 0000 0000
li64
..
+4/16xI6- 1
= 0 011 1111 0100 0000 0000 0000 0000 0000
o
0
.. +0
xl(-64
.. 0 000 0000 0000 0000 0000 0000 0000 0000
-IS 0
• -15/16xT6 1
= 1 100 0001 1111 0000 0000 0000 0000 0000
5 kx I
0-7~
;II!
+ 1I16x 16 -64
=
0 000 0000 000 1 0000 0000 0000 0000 0000
7:2xI0 75
It
(1-16-6)xI6 63
=
0 III 1111 1111 1111 1111 1111 1111 1111
II
1
1 "]
[The symbol
~
means
approximate y equa .
Conversion Example
Convert the decimal number 59.25 to a short
floating-point number. (In another appendix are
tables for the conversion of hexadecimal and
decimal integers and fractions.)
1. The number is· decomposed into a decimal
integer and a decimal fraction.
59.25 - 59 plus 0.25
2. The decimal integer is converted to its
hexadecimal representation.
59
10
-
3B16
3. The decimal fraction is converted to its
hexadecimal representation.
0. 25
10
-
0.416
4. The integral and fractional parts are combined
and expressed as a fraction times a power of 16
(exponent).
3B.416
= 0.3B416
x
16 2
5. The characteristic is developed from the
exponent and converted to binary.
base
+
exponent
=
characteristic
64
+
2
= 66 = 1000010
6. The fraction is converted to binary and grouped
hexadecimally.
.3 B 4 1 6
=.0011 1011 0100
7. The characteristic and the fraction are stored in
the short format. The sign position contains
the sign of the fraction.
SChar
Fraction
---
o
10000 000010
0011 1011 0100 0000 0000
Examples of instruction sequences that may be
used to convert between signed binary integers and
floating-point numbers are shown in the section
"Floating-Point-Number Conversion" later in this
appendix.
Instruction-Use Examples
The following examples illustrate the use of many
of the unprivileged instructions. Before studying
one of these examples, the reader should consult
the instruction description in this manual for the
particular instruction of interest to him.
The instruction-use examples are written
principally for assembler-language programmers, to
be used in conjunction with the appropriate
assembler-language manuals.
Most examples present one particular instruction,
both as it is written in an assembler-language
statement and as it appears when assembled in
storage (machine format).
Machine Format
All machine-format numerical operands are written
in hexadecimal notation unless otherwise specified.
Hexadecimal operands are shown converted into
binary, decimal, or both if such conversion helps to
clarify the example for the reader. Storage
addresses are also given in hexadecimal.
Assembler-Language Format
In assembler-language statements, registers and
lengths are presented in decimal. Displacements,
immediate operands, and masks may be shown in
decimal, hexadecimal, or binary notation; for
example, 12, X'C', or B'1100' represent the same
value. Whenever the value in a register or storage
' "
.
Appendix A. Number Representation and
Instruction~Use
Examples
~. A~5

Advertisement

loading