- Arithmetic logic unit
In computing, an arithmetic logic unit (ALU) is a digital circuit that performs arithmetic and logical operations. The ALU is a fundamental building block of the central processing unit of a computer, and even the simplest microprocessors contain one for purposes such as maintaining timers. The processors found inside modern CPUs and graphics processing units (GPUs) accommodate very powerful and very complex ALUs; a single component may contain a number of ALUs.
Mathematician John von Neumann proposed the ALU concept in 1945, when he wrote a report on the foundations for a new computer called the EDVAC. Research into ALUs remains an important part of computer science, falling under Arithmetic and logic structures in the ACM Computing Classification System.
An ALU must process numbers using the same format as the rest of the digital circuit. The format of modern processors is almost always the two's complement binary number representation. Early computers used a wide variety of number systems, including ones' complement, two's complement sign-magnitude format, and even true decimal systems, with various[NB 2] representation of the digits. ALUs for each one of these that makes it easier for the ALUs to calculate additions and subtractions.
The ones' complement and two's complement number systems allow for subtraction to be accomplished by adding the negative of a number in a very simple way which negates the need for specialized circuits to do subtraction; however, calculating the negative in two's complement requires adding a one to the low order bit and propagating the carry. An alternative way to do two's complement subtraction of A−B is to present a one to the carry input of the adder and use ¬B rather than B as the second input.
Most of a processor's operations are performed by one or more ALUs. An ALU loads data from input registers, an external Control Unit then tells the ALU what operation to perform on that data, and then the ALU stores its result into an output register. The Control Unit is responsible for moving the processed data between these registers, ALU and memory.
Most ALUs can perform the following operations:
- Bitwise logic operations (AND, NOT, OR, XOR)
- Integer arithmetic operations (addition, subtraction, and sometimes multiplication and division, though this is more expensive)
- Bit-shifting operations (shifting or rotating a word by a specified number of bits to the left or right, with or without sign extension). Shifts can be seen as multiplications and divisions by a power of two.
Engineers can design an Arithmetic Logic Unit to calculate any operation. The more complex the operation, the more expensive the ALU is, the more space it uses in the processor, the more power it dissipates. Therefore, engineers compromise. They make the ALU powerful enough to make the processor fast, yet not so complex as to become prohibitive. For example, computing the square root of a number might use:
- Calculation in a single clock Design an extraordinarily complex ALU that calculates the square root of any number in a single step.
- Calculation pipeline Design a very complex ALU that calculates the square root of any number in several steps. The intermediate results go through a series of circuits arranged like a factory production line. The ALU can accept new numbers to calculate even before having finished the previous ones. The ALU can now produce numbers as fast as a single-clock ALU, although the results start to flow out of the ALU only after an initial delay.
- Iterative calculation Design a complex ALU that calculates the square root through several steps. This usually relies on control from a complex control unit with built-in microcode.
- Co-processor Design a simple ALU in the processor, and sell a separate specialized and costly processor that the customer can install just beside this one, and implements one of the options above.
- Software libraries Tell the programmers that there is no co-processor and there is no emulation, so they will have to write their own algorithms to calculate square roots by software.
- Software emulation Emulate the existence of the co-processor, that is, whenever a program attempts to perform the square root calculation, make the processor check if there is a co-processor present and use it if there is one; if there isn't one, interrupt the processing of the program and invoke the operating system to perform the square root calculation through some software algorithm.
The options above go from the fastest and most expensive one to the slowest and least expensive one. Therefore, while even the simplest computer can calculate the most complicated formula, the simplest computers will usually take a long time doing that because of the several steps for calculating the formula.
Powerful processors like the Intel Core and AMD64 implement option #1 for several simple operations, #2 for the most common complex operations and #3 for the extremely complex operations.
Inputs and outputs
In many designs the ALU also takes or generates as inputs or outputs a set of condition codes from or to a status register. These codes are used to indicate cases such as carry-in or carry-out, overflow, divide-by-zero, etc.
ALUs vs. FPUs
A floating-point unit also performs arithmetic operations between two values, but they do so for numbers in floating-point representation, which is much more complicated than the two's complement representation used in a typical ALU. In order to do these calculations, a FPU has several complex circuits built-in, including some internal ALUs.
In modern practice, engineers typically refer to the ALU as the circuit that performs integer arithmetic operations (like two's complement and BCD). Circuits that calculate more complex formats like floating point, complex numbers, etc. usually receive a more specific name such as FPU.
- 7400 series
- Adder (electronics)
- Multiplication ALU
- Digital circuit
- Division (electronics)
- Control Unit
- ^ Reference Manual, 7070 Data Processing System, A22-7003-01
- ^ [http://bitsavers.org/pdf/univac/uss/SolidState90_Specs.pdf UNIVAC SOLID-STATE 90 Specification Features]
- ^ 650 Data Procssing Machine Manual of Operation, 22-6060-2
- Hwang, Enoch (2006). Digital Logic and Microprocessor Design with VHDL. Thomson. ISBN 0-534-46593-5. http://faculty.lasierra.edu/~ehwang/digitaldesign.
- Stallings, William (2006). Computer Organization & Architecture: Designing for Performance 7th ed. Pearson Prentice Hall. ISBN 0-13-185644-8. http://williamstallings.com/COA/COA7e.html.
CPU technologies Architecture ParallelismPipelineLevelThreads Types Components Power management
Wikimedia Foundation. 2010.
См. также в других словарях:
arithmetic logic unit — noun (computing) The part of a central processing unit that carries out arithmetic and logical operations (abbrev ALU) • • • Main Entry: ↑arithmetic … Useful english dictionary
Arithmetic Logic Unit — Arithmetic Logic Unit, ALU, Rechenwerk, Prozessor … Universal-Lexikon
arithmetic-logic unit — aritmetinis loginis įtaisas statusas T sritis automatika atitikmenys: angl. ALU; arithmetic logic unit vok. Arithmetik Logik Einheit, f; Recheneinheit, f; Rechen und Leitwerk, n; Rechen und Steuerwerk, n rus. АЛУ; арифметическо логическое… … Automatikos terminų žodynas
arithmetic-logic unit — aritmetinis loginis įtaisas statusas T sritis informatika apibrėžtis ↑Centrinio procesoriaus funkcinis komponentas aritmetinėms ir loginėms operacijoms atlikti. Santrumpa ALĮ. Veikimo požiūriu yra autonominis, tačiau mikroprocesoriuose… … Enciklopedinis kompiuterijos žodynas
arithmetic logic unit — part of a computer processor responsible for executing arithmetic functions … English contemporary dictionary
arithmetic logic unit — (ALU) Unit within a microprocessor that computes logical and arithmetical operations … IT glossary of terms, acronyms and abbreviations
arithmetic/logic unit — /ar ith met ik loj ik/, Computers. See ALU. * * * … Universalium
arithmetic logic unit — noun That part of a CPU that does calculations and logical operations Syn: ALU … Wiktionary
Arithmetic Logic Unit — The place in a computer where calculations are performed. Also known simply as the ALU. The ALU takes two pieces of data held in the registers and performs a calculation. See also Accumulator … International financial encyclopaedia
arithmetic/logic unit — /ar ith met ik loj ik/, Computers. See ALU … Useful english dictionary