2. +57 = 0011 1001 -35 = 1101 1101 +22 = 0001 0110 No overflow --carry
into leftmost posi­
tion and carry out
3. +35 = 0010 0011 -57 = 1100 0111 -22 = 1110 1010 Sign change only
no carry into left­
most position and no
carry out
4. -57 = 1100 0111 -35 = 1101 1101 -92 = 1010 0100 No overflow --carry
into leftmost posi­
tion and carry out
5. +57 = 0011 1001 +92 = 0101 1100 +149 =*1001 0101 *Overflow -- carry
into leftmost posi­
tion, no carry out
6. -57 = 1100 0111 -92 = 1010 0100 -149 =*0110 1011 *Overflow -- no carry
into leftmost posi­
tion but carry out
The presence or absence of an overflow
condition may be recognized from the
carries:
2 31 _1
= 2 147 483 647 = 0 111 1111
2
16
= 65 536 = 0 000 0000 = 1 = 0 000 0000 0 = a = a 000 0000 -2° = -1 = 1 111 1111
-2
1
= -2 = 1 111 1111
-2
16
= -65 536 = 1 111 1111
-2
31
+1 = -2 147 483 647 = 1 000 0000 -2
31
= -2 147 483 648 = 1 000 0000 32-Bit Signed Binary Integers
1111 0000 0000 0000 1111
1111
1111 0000 0000 There is no overflow:
a. If there is no carry into the
leftmost bit position and no
carry out (examples 1 and 3).
b. If there is a carry into the
leftmost position and also a
carry out (examples 2 and 4). There is an overflow:
a. If there is a carry into the
leftmost position but no carry
out (example 5).
b. If there is no carry into the
leftmost position but there is
a carry out (example 6).
The following are 16-bit signed binary
integers. The first is the maX1mum
positive 16-bit binary integer. The
last 1S the maximum negative 16-bit
binary integer (the negative 16-bit
binary integer with the greatest abso­
lute value).
2
15
_1 = 32,767 a -2° -2
15
1 a -1
= -32,768
=
=
=
= 0 111 1111 1111 1111
= 0 000 0000 0000 0001 = 0 000 0000 0000 0000 = 1 111 1111 1111 1111
= 1 000 0000 0000 0000 The following figure illustrates several
32-bit signed binary integers arranged
in descending order. The first is the
maximum positive binary integer that can
be represented by 32 bits, and the last
is the maximum negative binary integer
that can be represented by 32 bits.
1111 1111 1111 1111 1111 0001 0000 0000 0000 0000 0000 0000 0000 0000 0001 0000 0000 0000 0000 0000 1111 1111 1111 1111 1111
1111 1111 1111 1111 1110 1111 0000 0000 0000 0000 0000 0000 0000 0000 0001 0000 0000 0000 0000 0000 Appendix A. Number Representation and Instruction-Use Examples A-3
Unsigned Binary Integers Certain instructions, such as ADD LOGICAL, treat binary integers as
unsigned rather than signed. Unsigned binary integers have the same format as
signed binary integers, except that the
leftmost bit is interpreted as another
numeric bit rather than a sign bit.
There is no complement notation because
all unsigned binary integers are consid­
ered positive.
The following examples illustrate the
addition of unsigned binary integers.
Only eight bit positions are used. The
examples are numbered the same as the
corresponding examples for signed binary integers.
1. 57 = 0011 1001 35 = 0010 0011 92 = 0101 1100 2. 57 = 0011 1001 221 = 1101 1101 278 =*0001 0110 *Carry out of
leftmost position 2
32
-1
= 4 294 967 295 = 1111 1111
2
31
= 2 147 483 648 = 1000 0000 2 31 _1
= 2 147 483 647 = 0111 1111
2
16
= 65 536 = 0000 0000 = 1 = 0000 0000 0 = 0 = 0000 0000 32-Bit Unsigned Binary Integers
A-4 System/370 Principles of Operation
1111 0000 1111 0000 0000 0000 3. 35 = 0010 0011 199 = 1100 0111 234 = 1110 1010 4. 199 = 1100 0111 221 = 1101 1101 420 =*1010 0100 *Carry out of
leftmost position
5. 57 = 0011 1001 92 = 0101 1100 149 = 1001 0101 6. 199 = 1100 0111 164 = 1010 0100 363 =*0110 1011 *Carry out of
leftmost position
A carry out of the leftmost bit position
mayor may not imply an overflow,
depending on the application.
The following figure illustrates several
32-bit unsigned binary integers arranged
in descending order.
1111 1111 1111 1111 1111 0000 0000 0000 0000 0000 1111 1111 1111 1111 1111 0001 0000 0000 0000 0000 0000 0000 0000 0000 0001 0000 0000 0000 0000 0000
Previous Page Next Page