IBM 1130 User Manual page 509

Computing system
Hide thumbs Also See for 1130:
Table of Contents

Advertisement

Section
Subsections
Page
70
10
I
20
01
Real Mode
General
A real number may be defined as a number with a
decimal point; fractions are allowed. If you use
1130
FORTRAN for real arithmetic, the arithmetic sub-
routines will keep track of the decimal point for you,
and the output subroutines will place it in the proper
place in the output results.
On the
1130,
a real number may be thought of as
having four components:
1. The whole portion
2. The fractional portion
3. A pointer indicating the location of the
decimal point
4. A positive or negative sign
For example, the number
267.4
has:
1.
A whole portion,
267
2. A fractional portion, .4
3. A pointer indicating that the decimal point
is between the 7 and the 4
4. A positive sign
Since the
1130
is a binary computer, these four
components are represented in binary form as
follows:
• The
267
as
100001011
The.
4
as
.011001100110--"'"-
A pointer of 9 showingthat the binary point is
between the ninth and tenth bits
The sign is positive (a 0 bit)
Rearranging and simplifying somewhat, this can
be written as
(9, +, 100001011, .011001100110----)
The first value, the 9, is , in decimal, the number
of bits in the whole portion; the second item is the
sign; the third value is the whole portion itself; the
last value is the fraction.
The number of bits available for the whole and frac-
tion combined depends on the precision option selected:
• Standard precision allots
23
bits for these
two items.
Extended preciSion allots
31
bits for them.
The whole portion of the number, since it is more
significant, gets first choice of the available bits.
In this case, the whole portion
(267)
requires
9
bits,
leaving either
14
or 22 bits for the fraction, depend-
ing on the preciSion chosen.
This can cause inaccuracies, since most fractions
cannot be represented exactly in
14
or 22 bits, or in
any number of bits, for that matter. To see why,
let us see how . 4 in the above example is repre-
sented in binary notation. You are probably familiar
with the binary system for whole numbers
(1,2,4,8,
0 1 2
3 4 5
16 , 32,
etc., or
2 , 2 , 2 , 2 , 2 , 2 ,
etc.,
respectively) . In the case of fractions, the values
proceed from the decimal (or binary) point to the
right as
1/2, 1/4, 1/8, 1/16, 1/32,
etc., or
2
-1,
2-2, 2- 3 , 2- 4 , 2- 5 ,
etc., respectively.
For example,
.625
is
.1010000000
or
1/2
plus
1/8
or
.5000
plus
.125.
It can be represented exactly in only three bits;
however, this is unusual.
The example, .4, appears to be a rather simple
number, and you might think that it also can be re-
presented exactly as a binary fraction. The table
below shows that this is not true:
Bit
Used
=
1
Position
Value
Not Used
=
0 Subtotal
1
.5
0
.0
2
.25
1
.25
3
.125
1
,.375
4
.0625
0
.375
5
.03125
0
.375
6
.015625
1
.390625
7
.0078125
1
.3984375
8
.00390625
0
.3984375
9
.001953125
0
.3984375
10
.0009765625
1
.3994140625
11
. 00048828125
1
.39990234375
12
.000244140625
0
.39990234375
You see that the binary representation can come
close to .4 but never hit it. With
12
bits
(.011001100110)
the decimal value is
.39990234375;
with
16
bits,
.399993896484375;
with
20
bits,
.3999996185302734375;
etc.
The fraction chosen, .4, is not an unusual number;
it is typical of most fractions.
Unlike fractions, whole numbers can be represented
exactly in binary form. However, you do reach a
limit, depending on the number of bits available. In
standard precision,
if
you use all
23
bits for the
whole portion, you -can attain a magnitude of
8,388,607.
With extended precision, the
31
avail-
able bits yield
2,147,483,647.

Advertisement

Table of Contents
loading

Table of Contents