Download Print this page

IBM 2030 Manual Of Instruction page 31

Processing unit, field engineering

Advertisement

r-------------~---------------------------------------------,
I
NUMBER
DECIMAL
S
INTEGER
1
I
I
1 2
31
"'1
=
2 147 483 647
=0 1111111 11111111 11111111 111111111
I
2
1 •
=
65 536
=0 0000000 00000001 00000000 000000001
I'
2
0
=
1 =0 0000000 00000000 00000000 000000011
I
0
=
0
=0 0000000 00000000 00000000 000000001
1-2
0
=
-1
=1 1111111 11111111 11111111 111111111
1-2
1
=
-2
=1 1111111 11111111 11111111 111111101
1-2
1 •
=
-65 536
=1 1111111 11111111 00000000 000000001
1-2
31
+1= -2 141 483 647
=1
0000000 00000000 00000000 000000011
1-2
31
=
-2 147 483 648
=1
0000000 00000000 00000000 000000001
L-_________________________
~
___________________________________
J
Table
1.
Fixed Point Numbers
The following is an example of hexa-
decimal complement addition.
The gener-
al method is the same as binary but the
base is sixteen.
Problem:
E7A4
-A48E
First, convert the number to be sub-
tracted to its sixteen- complement.
FFFF
-A48E
SB71
+1
5B72
Now, add the sixteen·s complement of
A48E to E7A4.
E7A4
+5B72
Carry-4316
Presence of the high-order carry means
the answer is in true form.
If there
had been no carry, the result would have
been in complement form.
PACKED DECIMAL
Sign-Operation Analysis
Before any packed decimal arithmetic can
take place, a sign- operation analysis
must be performed.
The result of this
analysis determines whether the opera-
tion is to be a true add or a complement
add.
There are three conditions that
are analyzed to determine the type of
operation.
These are:
1.
type of operation
(add or subtract) :
• or -
2.
sign of first operand:
• or -
3.
sign of second operand: + or -
An even number of minus signs calls for
a true-add operation to combine the two
operands.
An odd number of minus signs
calls for a complement-add operation to
combine the two operands.
Thus, eight
conditions can occur.
These eight are
analyzed as follows:
First
Operation
Second
True or
Operand
Sign
Operand
Complement
.X
+
+y
True
-X
+y
Complement
-X
-y
True
+X
+
-y
Complement
.X
.y
Complement
-x
.Y
True
-X
-y
Complement
+X
-y
True
The signs of the operands are main-
tained in the low-order half byte (four
bit positions).
The actual bit-coding
of the sign depends on the data-coding
scheme being used.
Packed-Decimal True Add
In the packed-decimal data format, we
want each four bits to represent one
decimal digit.
The range of this deci-
mal digit is, of course, 0 - 9.
However, four bits with the packed-
decimal value of 1,2, 4, and 8 can
represent any decimal number from 00 to
1-27

Advertisement

loading

This manual is also suitable for:

System/360 30