Presentation is loading. Please wait.

Presentation is loading. Please wait.

IKI10201 05b-Arithmetic Logic Unit (ALU) Bobby Nazief Semester-I 2005 - 2006 The materials on these slides are adopted from: CS231’s Lecture Notes at UIUC,

Similar presentations


Presentation on theme: "IKI10201 05b-Arithmetic Logic Unit (ALU) Bobby Nazief Semester-I 2005 - 2006 The materials on these slides are adopted from: CS231’s Lecture Notes at UIUC,"— Presentation transcript:

1 IKI10201 05b-Arithmetic Logic Unit (ALU) Bobby Nazief Semester-I 2005 - 2006 The materials on these slides are adopted from: CS231’s Lecture Notes at UIUC, which is derived from Howard Huang’s work and developed by Jeff Carlyle; Prof. Daniel Gajski’s transparency for Principles of Digital Design.

2 Adders/Subractors: Arithmetic Unit When Sub = 0, the XOR gates output B3 B2 B1 B0 and the carry in is 0. The adder output will be A + B + 0, or just A + B. When Sub = 1, the XOR gates output B3’ B2’ B1’ B0’ and the carry in is 1. Thus, the adder output will be a two’s complement subtraction, A - B. Arithmetic Unit that is capable to do addition & subtraction can be constructed using Full Adders.

3 Logical Unit In addtion to arithmetic operations, most computers also support logical operations like AND, OR and NOT, but extended to multi-bit words instead of just single bits. To apply a logical operation to two words X and Y, apply the operation on each pair of bits X i and Y i : 1011 AND1110 1010 1011 OR1110 1111 1011 XOR1110 0101

4 Defining a logic unit Boolean functions of 2 variables have 2 inputs, 1 output, and 4 minterms We can generate 16 Boolean functions using 4 (select) variables: the Truth Table: Boolean Functions: – AND  f 8  values of select variables S 3 S 2 S 1 S 0 = 1000 – OR  f 14  values of select variables S 3 S 2 S 1 S 0 = 1110 –...

5 Logic unit implementation

6 Arithmetic-Logic Units (ALUs) An arithmetic-logic unit, or ALU, performs many different arithmetic and logic operations. The ALU is the “heart” of a processor—you could say that everything else in the CPU is there to support the ALU.

7 One of ALU structures AE = Arithmetic Extender (Add, Sub, Inc, Dec) LE = Logic Extender (AND, OR, PASS, NOT)

8 Additional variables for AE & LE M: select arithmetic or logic operations – M = 1  ALU will perform arithmetic operation – M = 0  ALU will perform logic operation S 1 & S 0 : once arithmetic or logic operations has been selected, these 2 variable will select specific operations to be performed by ALU – M = 1  S 1 & S 0 will select one of Add, Sub, Inc, Dec – M = 0  S 1 & S 0 will select one of AND, OR, PASS, NOT

9 Arithmetic Extender Functional Table: Implementation: LE’s requirement

10 Logic Extender Functional Table: Truth Table: satisfy AE Conforms with AE’s output

11 Logic Extender (cont.) Map & Implementation:

12 The ALU If M = 1, then – X i = a i, Y i = A(b i ), c 0 = S 1 If M = 0, then – X i = L(a i,b i ), Y i = 0, c 0 = 0

13 ALU function table

14 ALU’s summary This ALU is a good example of hierarchical design. – With the 12 inputs, the truth table would have had 2 12 = 4096 lines. That’s an awful lot of paper. – Instead, we were able to re-use components that we’ve seen before to construct the entire circuit from a couple of easy-to-understand components. As always, we encapsulate the complete circuit in a “black box” so we can reuse it in fancier circuits.


Download ppt "IKI10201 05b-Arithmetic Logic Unit (ALU) Bobby Nazief Semester-I 2005 - 2006 The materials on these slides are adopted from: CS231’s Lecture Notes at UIUC,"

Similar presentations


Ads by Google