ALU OPERATIONS
ALU operations in the CPU include calculations of
integers and/or fractions.
All the computations are
performed using the binary number system. ALU
operations also include signed arithmetic operations.
First we discuss how the binary equivalents of decimal
numbers are represented in fixedpoint representation
(integers),
then we discuss floatingpoint
representation (fractional). Fixed and floatingpoint
operations are important for the computer. They make
the computer versatile when performing arithmetic and
logical types of ALU operations.
FixedPoint Operations
Fixedpoint arithmetic operations are performed on
integral or whole numbers where the binary point is
assumed to be to the right of the least significant bit
(bit 0). For example, if we have an 8bit register, we
may express integer decimal numbers between 0 and 2^{8}
minus 1 (or 255), by converting the decimal number to
its binary equivalent. If we have a 16bit register, we
can store integer decimal numbers between 0 and 2^{16}
minus 1 (or 65535). Because the binary point is fixed
and always to the right of the least significant digit,
fractions are not represented. The magnitude or
absolute value of the number is always represented by
2^{N }minus 1 where N is the number of bits within the
register or memory cell where the number is being
stored.
In fixedpoint operations, the computer can
perform calculations on signed numbers (positive and
negative). The most significant bit (msb) is used as a
sign bit. A zero (0) in the msb indicates a positive or
true form number, and a one (1) in the msb indicates a
negative or one’s complement/radixminus1 form
number.
When dealing with binary numbers, we can take
this one step further; we find the two’s complement or
radixminus2 of the number. It is important to
understand the concepts behind 1’s and 2’s
complement.
It is the basis by which the computer
performs arithmetic and logical calculations. Now if
you want to accommodate an equal amount of positive
and negative numbers, a 16bit register can contain
numbers from –32768 to +32767 or –2^{15 }to 2^{15 }minus
1. The reason they are not both 2^{15 }is because one
combination is taken up for the zero value. This is more
easily seen if we examine a 4bit register. The
combinations are shown in table 52.
520
Table 52.—Binary and Decimal Values of a 4Bit Register
That is, there are 2^{3 }or 2^{N }combinations and one
combination is for the number zero. Negative numbers
are represented by their two’s complement and the most
significant bit (regardless of the word or operand size)
is the sign bit.
Fixedpoint operations can include
doublelength arithmetic operations, where operands
contain 64 bits and bit 2^{63 }is the sign bit.
FloatingPoint Operations
Floatingpoint operations are used to simplify the
addition, subtraction, multiplication, and division of
fractional numbers. They are used when dealing with
fractional numbers, such as 5.724 or a very large
number and signed fractional numbers. When
performing arithmetic operations involving fractions or
very large numbers, it is necessary to know the location
of the binary (radix) point and to properly align this
point before the arithmetic operation. For
floatingpoint operations, the location of the binary
point will depend on the format of the computer. All
numbers are placed in this format before the arithmetic
operation. The factional portion of the number is
called the mantissa and the whole integer portion,
indicating the scaled factor or exponent, is called the
characteristic.

