Download Print this page

IBM 4300 Manual page 255

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

Advertisement

Number Representation
Binary Integers
Signed Binary Integers
Signed binary integers are most commonly
represented as halfwords (16 bits) or words (32
bits). In both lengths, the leftmost bit (bit 0) is the
sign of the number. The remaining bits (bits 1-15
for halfwords and 1-31 for words) are used to
designate the magnitude of. the number. Binary
integers are also referred to as fixed-point numbers,
because the radix point is considered to be fixed at
the right, and any scaling is done by the
programmer.
Positive binary integers are in true binary
notation with a zero sign bit. Negative binary
integers are in two's-complement notation with a
one bit in the sign position. In all cases, the bits
between the sign bit and the leftmost significant bit
of the integer are the same as the sign bit (that is,
all zeros for positive numbers, all ones for negative
numbers).
Negative binary integers are formed in
two's-complement notation by inverting each bit of
the positive binary integer and adding one. As an
example using the halfword format, the binary
number with the decimal value
+
26 is made
negative (-26) in the following manner:
+26
0 000 0000 0001 1010
Invert 1 111 1111 1110 0101
Add 1
1
-26
111 1111 1110 0110 (Two's comple-
ment form)
(S is the sign bit.)
This is equivalent to subtracting the number:
from
00000000 00011010
00000000 00000000
Negative binary integers are changed to positive
in the same manner.
The following addition examples illustrate
two's-complement arithmetic and overflow
conditions. Only eight bit positions are used.
1 .
+57
=
0011 1001
+35
0010 0011
+92
0101 1100
A-2
IBM 4300 Processors Principles of Operation
2.
+57
-35
0011 1001
1101 1101
+22
0001 0110
No overflow-carry
into leftmost posi-
tion and carry out.
3.
+35
-57
0010 0011
1100 0111
-22
1110 1010
Sign change only-no
carry into leftmost
position and no
carry out.
4.
-57
-35
1100 0111
1101 1101
-92
5.
+57
+92
+149
6.
-57
-92
-149
1010 0100
No overflow-carry
into leftmost posi-
tion and carry out.
0011 1001
0101 1100
*1001 0101
*Overflow-carry
into leftmost posi-
tion, no carry out.
1100 0111
1010 0100
*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:
• 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 maximum positive 16-bit binary
integer. The last is the maximum negative 16-bit
binary integer (the negative 16-bit binary integer
with the greatest absolute value).

Advertisement

loading