Download Print this page

IBM 4300 Manual page 256

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

Advertisement

32,767
1
o
-1
-32,768
o
111 1111 1111 1111
o
000 0000 0000 0001
o
000 0000 0000 0000
1 111 1111 1111 1111
1 000 0000 0000 0000
The following are 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.
23 1 - 1
=
2 147483647
=
0 1111111111111111111111111111111
2 16
65 536
=
0 000 0000 0000 0001 0000 0000 0000 0000
2 0
1
=
0 000 0000 0000 0000 0000 0000 0000 0001
_~o
-~
:
~ ~~~ ~~~~ ~~n ~~~~ ~~~~ ~~~~ ~~~~ ~~~~
-2 1
-2
=
1 111 1111 1111 1111 1111 1111 1111 1110
_2 16
=
-65536
=
11111111111111110000000000000000
-23311
+
1
=
-2 147 483 647
=
1 000 0000 0000 0000 0000 0000 0000 0001
-2
=
-2 147 483 648
=
1 000 0000 0000 0000 0000 0000 0000 0000
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 considered 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
3.
35
0010 0011
199
1100 0111
234
11101010
4. 199
1100 0111
221
1101 1101
420
*1010 0100
*Carry out of
leftmost position
5.
57
92
149
6.
199
164
0011 1001
0101 1100
1001 0101
1100 0111
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 are several 32-bit unsigned binary
integers arranged in descending order.
4 294 967 296
=
1111 1111 1111 1111 1111 1111 1111 1111
2 147 483 648
=
1000 0000 0000 0000 0000 0000 0000 0000
2 147 483 647
=
0111 1111 1111 1111 1111 1111 1111 1111
65 536
=
0000 0000 0000 0001 0000 0000 0000 0000
1
=
0000 0000 0000 0000 0000 0000 0000 0001
o
=
0000 0000 0000 0000 0000 0000 0000 0000
Decimal Integers
Decimal integers are represented as one or more
decimal digits and a sign digit. Each digit is a 4-bit
code. The decimal digits are in binary-coded
.
decimal (BCD) form, with the values 0-9 encoded
as 0000-1001. The sign is usually represented as
1100 (C hex) for plus and 1101 (D hex) for minus.
These are the preferred sign codes, which are
generated by the machine for the results of decimal
operations. There are also several alternate sign
codes (1010, 1110, and 1111 for plus; 1011 for
minus). The alternate sign codes are accepted by
the machine as valid but are not generated for
results.
Decimal integers may have different lengths,
from one to 16 bytes. There are. two decimal
formats: packed and zoned. In the packed format,
each byte contains two decimal digits, except for
the rightmost byte which contains the sign in its
right digit. The number of decimal digits in the
packed format can vary from one to 31. Because
decimal integers must consist of whole bytes and
there must be a sign digit on the right, the number
of decimal digits is always odd. If an even number
of significant digits is desired, a leading zero must
be inserted on the left.
In the zoned format, each byte consists of a
decimal digit on the right and the zone code 1111
(F hex) on the left, except for the rightmost byte
where the sign code replaces the zone code. Thus,
decimal integers in the zoned format can have
anywhere from one to 16 digits. The zoned format
Appendix A. Number Representation and Instruction-Use Examples
A-3

Advertisement

loading