Arithmetic Logic Unit is Combinational Digital Electronic Circuit
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 (see cpu ). Arithmetic logic unit is a combinational digital electronic circuit that performs arithmetic and bitwise operations on integer binary numbers. 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, corresponding to Boolean operators such as AND, OR, and XOR (see bitwise operations and B oolean operators ). The data or operand specified in the operation code is retrieved as words of memory that represent numeric data, or indirectly, character data (see memory , numeric data , and characters and strings ). 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 (see flag ).
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 (see assembler ) 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 (see device driver ). 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.
References:
- Kleitz, William. Digital and Microprocessor Fundamentals: Theory and Applications. 4th ed. Upper Saddle River, N.J.: Prentice Hall, 2002.
- Stokes, Jon. “Understanding the Microprocessor.” Ars Technica. Available online. URL: http://arstechnica.com/paedia/c/cpu/ part-1/cpu1-1.html. Accessed May 22, 2007.
Important ! Important! Important!
If you want to know about the celebrities and Stars biography, Then you must visit our Partner Website... Stardomadda
Comments
Post a Comment