Download Print this page

Data Format; Binary-Integer Representation - IBM 4300 Manual

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

Advertisement

This chapter includes all the unprivileged
instructions described in this publication, other than
the decimal and floating-point instructions.
Data Format
The general instructions treat data as being of four
types: signed binary integers, unsigned binary
integers, unstructured logical data, and decimal
data. Data is treated as decimal by the conversion,
packing, and unpacking instructions. Decimal data
is described in Chapter 8, "Decimal Instructions."
Data resides in general registers or in storage or
is introduced from the instruction stream.
In a storage-to-storage operation the operand
fields may be defined in such a way that they
overlap. The effect of this overlap depends upon
the operation. When the operands remain
unchanged, as in COMPARE or TRANSLATE
AND TEST, overlapping does not affect the
execution of the operation. For instructions such
as MOVE and TRANSLATE, one operand is
replaced by new data, and the execution of the
operation may be affected by the amount of
overlap and the manner in which data is fetched or
stored. For purposes of evaluating the effect of
overlapped operands, data is considered to be
handled one eight-bit byte at a time. All
overlapping fields are considered valid.
Binary-Integer Representation
Binary integers are treated as signed or unsigned.
In an unsigned binary integer, all bits are used to
express the absolute value of the number. When
two unsigned binary integers of different lengths
are added, the shorter number is considered to be
extended on the left with zeros.
For signed binary integers, the leftmost bit
represents the sign, which is followed by the
numeric field. Positive numbers are represented in
true binary notation with the sign bit set to zero.
Negative numbers are represented in two's-
complement binary notation with a one in the
sign-bit position.
Specifically, a negative number is represented by
the two's complement of the positive number of the
same absolute value. The two's complement of a
number is obtained by inverting each bit of the
number, including the sign, and adding a one in the
low-order bit position.
This type of number representation can be
considered the low-order portion of an infinitely
long representation of the number. When the
number is positive, all bits to the left of the most
significant bit of the number are zeros. When the
number is negative, all these bits are ones.
7-2
IBM 4300 Processors Principles of Operation
Therefore, when a signed operand must be
extended with high-order bits, the extension is
achieved by setting these bits equal to the sign bit
of the operand.
The notation for signed binary integers does not
include a negative zero.
It
has a number range in
which the set of negative numbers is one larger
than the set of positive numbers. The maximum
positive number consists of a sign bit of zero
followed by all ones,whereas the maximum
negative number (the negative number with the
greatest absolute value) consists of a sign bit of one
followed by all zeros. The number zero consists of
all-zero bits.
A signed binary integer of either sign, except for
zero and for the maximum negative number, is
changed to the number with opposite sign by
forming its two's complement. This operation of
complementing a number is equivalent to
subtracting the number from zero. The
complement of zero is zero.
The complement of the maximum negative
number cannot be represented in the same number
of bits. When an operation, such as a subtraction
of the maximum negative number from zero,
attempts to produce the complement of the
maximum negative number, the result is the
maximum negative number, and a fixed-point-
overflow exception is recognized. An overflow
does not result, however, when the maximum
negative number is complemented as an
intermediate result but the final result is within the
representable range. An example of this case is a
subtraction of the maximum negative number from
minus one. The product of two maximum negative
numbers is representable as a double-length
positive number.
In discussions of signed binary integers in this
publication, a signed binary integer includes the
sign bit. Thus, the expression "32-bit signed binary
integer" denotes an integer with 31 numeric bits
and a sign bit, and the expression" 64-bit signed
binary integer" denotes an integer with 63 numeric
bits and a sign bit.
In some operations, the result is achieved by the
use of the one's complement of the number. The
one's complement of a number is obtained by
inverting each bit of the number.
In an arithmetic operation, a carry out of the
numeric field of a signed binary integer changes the
sign. However, in algebraic left-shifting the sign
bit does not change even if significant high-order
bits are shifted out.

Advertisement

loading