arithmetic logic unit  (ALU)




The arithmetic logic unit is the part of a computer system
that actually performs calculations and logical comparisons
on data. It is part of the central processing unit (CPU), and
in practice there may be separate and multiple arithmetic
and logic units.


The ALU works by first retrieving a code that represents
the operation to be performed (such as ADD). The code also
specifies the location from which the data is to be retrieved
and to which the results of the operation are to be stored.
(For example, addition of the data from memory to a num-
ber already stored in a special accumulator register within
the CPU, with the result to be stored back into the accumu-
lator.) The operation code can also include a specification
of the format of the data to be used (such as fixed or float-
ing-point numbers)—the operation and format are often
combined into the same code.

In addition to arithmetic operations, the ALU can also
carry out logical comparisons, such as bitwise operations
that compare corresponding bits in two data words,

The data or operand specified in the operation code is
retrieved as words of memory that represent numeric data,
or indirectly, character data .once the operation is per-
formed, the result is stored (typically in a register in the
CPU). Special codes are also stored in registers to indicate
characteristics of the result (such as whether it is positive,
negative, or zero). Other special conditions called excep-
tions indicate a problem with the processing. Common
exceptions include overflow, where the result fills more bits
than are available in the register, loss of precision (because
there isn’t room to store the necessary number of decimal
places), or an attempt to divide by zero. Exceptions are
typically indicated by setting a flag in the machine status
register.


The Big Picture
Detailed knowledge of the structure and operation of the
ALU is not needed by most programmers. Programmers
who need to directly control the manipulation of data in
the ALU and CPU write programs in assembly language
That specify the sequence of operations to
be performed. Generally only the lowest-level operations
involving the physical interface to hardware devices require
this level of detail. Modern compilers
can produce optimized machine code that is almost as effi-
cient as directly-coded assembler. However, understanding
the architecture of the ALU and CPU for a particular chip
can help predict its advantages or disadvantages for various
kinds of operations.

See also:

Application suite

application service provider asp

application program interface api

application program interface api
Share on Google Plus

About Tech-technewes.blogspot.com

This is a short description in the author block about the author. You edit it by entering text in the "Biographical Info" field in the user admin panel.
    Blogger Comment
    Facebook Comment

0 comments: