You are on page 1of 4

Arithmetic logic unit

Arithmetic logic unit


In computing, an arithmetic and logic unit (ALU) is a digital circuit that performs integer 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 as an important part of computer science, falling under Arithmetic and logic structures in the ACM Computing Classification System. ALUs are designed to performintegercalculations. Therefore, besides adding and subtracting numbers, ALUs often handle the multiplication of two integers, since the result is also an integer. However, ALUs typically do not perform division operations[citation needed], since the result may be a fraction, or a "floating point" number. Instead, division operations are usually handled by the floating-point unit (FPU), which also performs other non-integer calculations.

Arithmetic And Logic Unit schematic symbol

Numerical systems
An ALU must process numbers using the same formats 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[1] 5-bit biquinary[2] encoding,[3] and 2-out-of-seven biquinary encoding in 7 bits[4]</ref> representation of the digits. The ones' complement and two's complement number systems allow for subtraction to be accomplished by adding the negative of a number Cascadable 8 Bit ALU Texas Instruments in a very simple way which negates the need for specialized circuits to SN74AS888 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 AB is to present a one to the carry input of the adder and use B rather than B as the second input. The arithmetic, logic and shift circuits introduced in previous sections can be combined into one ALU with common selection.

Arithmetic logic unit

Practical overview
Most of a processor's operations are performed by one or more ALUs. An ALU loads data from input registers. Then an external control unit 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.

Complex operations
Engineers can design an Arithmetic Logic Unit to calculate most operations. The more complex the operation, the more expensive the ALU is, the more space it uses in the processor, and 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: 1. Calculation in a single clock Design an extraordinarily complex ALU that calculates the square root of any number in a single step. 2. 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. 3. 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. 4. 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. 5. 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. 6. 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 is not 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


The inputs to the ALU are the data to be operated on (called operands) and a code from the control unit indicating which operation to perform. Its output is the result of the computation. One thing designers must keep in mind is whether the ALU will operate on big-endian or little-endian numbers. In many designs, the ALU also takes or generates 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. 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.

Arithmetic logic unit 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.

Notes
[1] Including Binary-Coded Decimal (BCD) in 4 bits, 2-out-of-5 coding in five bits,<ref> Reference Manual, 7070 Data Processing System, A22-7003-01 (http:/ / bitsavers. org/ pdf/ ibm/ 7070/ A22-7003-01_7070_Reference_Jan60. pdf) [2] IBM and UNIVAC used the term biquinary with different meanings. [3] UNIVAC SOLID-STATE 90 Specification Features (http:/ / bitsavers. org/ pdf/ univac/ uss/ SolidState90_Specs. pdf) [4] 650 Data Processing Machine Manual of Operation, 22-6060-2 (http:/ / bitsavers. org/ pdf/ ibm/ 650/ 22-6060-2_650_OperMan. pdf)

References
Hwang, Enoch (2006). Digital Logic and Microprocessor Design with VHDL (http://faculty.lasierra.edu/ ~ehwang/digitaldesign). Thomson. ISBN0-534-46593-5. Stallings, William (2006). Computer Organization & Architecture: Designing for Performance (http:// williamstallings.com/COA/COA7e.html) (7th ed.). Pearson Prentice Hall. ISBN0-13-185644-8.

External links
ALU and its Micro-operations: Bitwise, Arithmetic and Shift (http://www.fullchipdesign.com/tyh/ alu_arithmetic_logical_unit.htm) A Simulator of Complex ALU in MATLAB (http://www.mathworks.com/matlabcentral/fileexchange/ loadFile.do?objectId=12762&objectType=FILE)

Article Sources and Contributors

Article Sources and Contributors


Arithmetic logic unit Source: http://en.wikipedia.org/w/index.php?oldid=584399897 Contributors: 144.62.18.xxx, 74s181, AgadaUrbanit, Akhil 0950, Alfio, Alphachimp, AndrewHarvey4, Aoineko, Arakunem, Arch dude, Arny, Arthena, Balzug, Barticus88, Beegram, Beowulf king, Beyondthislife, Bishopw, Brendan Moody, Bryan Derksen, Bunnyhop11, Burundee, CapitalR, Capricorn42, Cburnett, Chalst, Charles Matthews, Chatul, Ciphers, Colin Marquardt, Conversion script, Cspan64, Ccero, Dcirovic, Dcljr, Dcoetzee, Delirium, Dgw, DoorsAjar, Drrngrvy, Ea91b3dd, Eadthem, Edivorce, Emptyboy, Encephalon, Enochhwang, Everyking, Evil Monkey, FallingGravity, Fbastos, Franois Robere, GDonato, Gimboid13, Glenn, Graham87, Greenv3, Gruas, Gurch, Guy Harris, HaZaRd, Hamza jadoon, Hannes Hirzel, Hayabusa future, Henriok, Hmains, Hoof Hearted, Hooperbloob, Hotdoglives, Imroy, Intgr, IraqsNextTarget, J.delanoy, JaGa, Jfmantis, Jmvalin, JonHarder, Jonathanfu, Josh Parris, Jpape, KRossKoWolf, Kalzekdor, KamasamaK, Ketiltrout, Klutzy, Kupirijo, L Kensington, LOL, Lazer erazer, Leclaird, Ligulem, LiuyuanChen, Malcolma, ManuelGR, Martial75, Materialscientist, Matt Britt, Matthew0028, Md bluelily, Miaow Miaow, Michael Hardy, Milad621, Mild Bill Hiccup, Minesweeper, Mintguy, Mipsseo, Moncrief, MrBeauGiles, Mudlock, Muendelezaji, My name is not dave, Myanw, NawlinWiki, Nihiltres, Nosebud, Ntse, Oli Filth, PS2pcGAMER, Peak, Pinethicket, Poccil, QTCaptain, Qasimian, Quinobi, Qwfp, R. S. Shaw, Rac7hel, Ray G. Van De Walker, Ray Van De Walker, Rbuj, Redgecko20, RexNL, Rjwilmsi, Robert.Baruch, Rocastelo, Rofthorax, Ronsta987, RoseParks, Rsrikanth05, Ruvald, Sarbruis, Savh, Seanm924, Shadow demon, ShadowPhox, Shamesspwns, Sleske, SnoFox, Somnathishere, Sriharsh1234, Stefan h, Szajd, TAz69x, Thumperward, Titodutta, Uriyan, VampWillow, Viedaloca, Wadems, Wannabemodel, WardMuylaert, Wbm1058, Wernher, Wideload3, WikiDao, Woohookitty, Xueexueg, Yunshui, Zarano, ZeWrestler, Zntrip, 281 anonymous edits

Image Sources, Licenses and Contributors


File:ALU symbol.svg Source: http://en.wikipedia.org/w/index.php?title=File:ALU_symbol.svg License: Creative Commons Attribution-ShareAlike 3.0 Unported Contributors: en:User:Cburnett File:KL Texas Instruments ALU SN74AS888.jpg Source: http://en.wikipedia.org/w/index.php?title=File:KL_Texas_Instruments_ALU_SN74AS888.jpg License: GNU Free Documentation License Contributors: Konstantin Lanzet

License
Creative Commons Attribution-Share Alike 3.0 //creativecommons.org/licenses/by-sa/3.0/

You might also like