Arithmetic logic unit
lastmod 2018-08-17created 2015-12-045 edits
An arithmetic logic unit is a digital circuit that computes arithmetic operations (such as addition and subtraction) and logical operations (such as exclusive OR, AND, and OR) on two numbers. The arithmetic logic unit is a fundamental building block of a computer's central processing unit.
Many kinds of electronic circuits need to compute some form of arithmetic operation; even the small circuit in a digital watch has a small arithmetic logic unit that adds 1 to the current time and checks when to sound the alarm.
Clearly, the most complex electronic circuits are probably the designs inside modern microprocessor chips such as the Pentium. Accordingly, these processors have powerful and very complex arithmetic logic units inside. In fact, modern microprocessors (or mainframes) have multiple cores, multiple execution units, and multiple arithmetic logic units.
Many other circuits contain arithmetic logic units inside: graphics processing units such as NVIDIA and ATI graphics cards, floating-point units such as the old 80387 coprocessor, digital signal processors found in Sound Blaster sound cards, CD players, high-definition televisions, and so on. All of these have several powerful and complex arithmetic logic units inside.
Implementation speed
Typically, the speed order is as follows.
## [빠르다] <--- ---> [느리다]
정수 가산기 - 정수 승산기 - 정수 나눗셈 - 부동소수점 곱셈 - 부동소수점 덧셈 - 부동소수점 나눗셈 - 루트,삼각함수 등
## 확인요망: Shift 연산, Bit 연산
When programming, it is good to take the speeds above into account and favor the faster operations.
For example, for floating-point division:
-
B=0.5*Ais better thanB=A/2.0. -
X=1/A, C=B*X, D=E*Xis better thanC=B/A, D=E/A.
Integer adder
- Full Adder
- Half Adder
- Prefix Adder
Integer multiplier
- Wallace Tree: speeds up by adding up the partial products of each digit
- Booth Encode: speeds up by grouping the digits of the multiplier
Division
- SRT division algorithm
Floating-point unit
- Normalization
- Rounding (handling of fractions)
- IEEE 754
- Infinity
- Denormalized numbers (Gradual Underflow feature)
See also
- Binary operation
- Bitwise operation
shift
- Barrel shifter
- Circular shift