Example: quiz answers

Arithmetic / Logic Unit – ALU Design

1 Arithmetic / Logic Unit ALU Design Presentation F CSE : Introduction to Computer Architecture Slides by Gojko Babi Reading Assignment: B5, g. babic Presentation F 2 ALU Control 32 32 32 Result A B 32-bit ALU Our ALU should be able to perform functions: logical and function logical or function Arithmetic add function Arithmetic subtract function Arithmetic slt (set-less-then) function logical nor function ALU control lines define a function to be performed on A and B. 32-bit ALU Zero Overflow Carry out 2 g. babic Presentation F 3 Functioning of 32-bit ALU ALU Control 32 32 32 Result A B 32-bit ALU Zero Overflow Carry out ALU Control lines Result lines provide result of the chosen function applied to values of A and B Since this ALU operates on 32-bit operands, it is called 32-bit ALU Zero output indicates if all Result lines have value 0 Overflow indicates integer overflow of add and s

design for CarryOut Figure B.5.3 . 4 g. babic Presentation F 7 32-bit Adder + + + + a0 b0 a2 b2 a1 b1 a31 b31 sum0 sum31 sum2 sum1 Cout Cin Cout Cout Cout Cin Cin Cin “0” This is a ripple carry adder. The key to speeding up addition is determining carry out in the

Tags:

  Design

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Transcription of Arithmetic / Logic Unit – ALU Design

1 1 Arithmetic / Logic Unit ALU Design Presentation F CSE : Introduction to Computer Architecture Slides by Gojko Babi Reading Assignment: B5, g. babic Presentation F 2 ALU Control 32 32 32 Result A B 32-bit ALU Our ALU should be able to perform functions: logical and function logical or function Arithmetic add function Arithmetic subtract function Arithmetic slt (set-less-then) function logical nor function ALU control lines define a function to be performed on A and B. 32-bit ALU Zero Overflow Carry out 2 g. babic Presentation F 3 Functioning of 32-bit ALU ALU Control 32 32 32 Result A B 32-bit ALU Zero Overflow Carry out ALU Control lines Result lines provide result of the chosen function applied to values of A and B Since this ALU operates on 32-bit operands, it is called 32-bit ALU Zero output indicates if all Result lines have value 0 Overflow indicates integer overflow of add and subtract functions.

2 For unsigned integers, this overflow indicator does not provide any useful information Carry out indicates carry out and unsigned integer overflow 4 Function Ainvert Binvert Operation and 0 0 00 or 0 0 01 add 0 0 10 subtract 0 1 10 slt 0 1 11 nor 1 1 00 g. babic 4 Designing 32-bit ALU: Beginning a0 b0 a1 b1 a2 b2 a31 b31 Result0 Result1 Result2 Result31 1.

3 Let us start with and function 2. Let us now add or function 0 1 0 1 0 1 0 1 Operation = 0 and = 1 or 3 g. babic 5 Designing 32-bit ALU: Principles a0 b0 a1 b1 a2 b2 a31 b31 Result0 Result1 Result2 Result31 0 1 0 1 0 1 0 1 Operation A number of functions are performed inter- nally, but only one result is chosen for the output of ALU 32-bit ALU is built out of 32 identical 1-bit ALU s and or and or and or and or = 0 and = 1 or g. babic Presentation F 6 Designing the Adder a b CarryIn Sum CarryOut 0 0 0 0 0 0 0 1 1 0 0 1 0 1 0 0 1 1 0 1 1 0 0 1 0 1 0 1 0 1 1 1 0 0 1 1 1 1 1 1 32-bit adder is built out of 32 1-bit adders Input Output Figure Figure 1-bit Adder Truth Table 1-bit Adder From the truth table and after minimization.

4 We can have this Design for CarryOut Figure 4 g. babic Presentation F 7 32-bit Adder + + + + a0 b0 a2 b2 a1 b1 a31 b31 sum0 sum31 sum2 sum1 Cout Cin Cout Cout Cout Cin Cin Cin 0 This is a ripple carry adder. The key to speeding up addition is determining carry out in the higher order bits sooner. Result: Carry look-ahead adder. Carry out g. babic Presentation F 8 32-bit ALU With 3 Functions 1-bit ALU CarryOut =0 Operation = 00 and = 01 or = 10 add Figure Figure + carry out 5 g. babic Presentation F 9 32-bit Subtractor 0 a31 b31 + + + + a0 b0 a2 b2 a1 b1 Result0 Result31 Result2 Result1 Cout Cin Cout Cout Cout Cin Cin Cin CarryOut 1 A B = A + ( B) = A + B + 1 g.

5 Babic 10 32-bit Adder / Subtractor 0 0 1 0 1 0 1 0 1 a31 b31 + + + + a0 b0 a2 b2 a1 b1 Result0 Result31 Result2 Result1 Cout Cin Cout Cout Cout Cin Cin Cin CarryOut binvert Binvert = 0 addition = 1 subtraction 0 1 6 g. babic Presentation F 11 32-bit ALU With 4 Functions Function Binvert (1 line) Operation (2 lines) and 0 00 or 0 01 add 0 10 subtract 1 10 Control lines 1-bit ALU Carry Out a 3 1 A L U 0 R e s u l t 0 a 0 R e s u l t 1 a 1 R e s u l t 2 a 2 O p e r a t i o n b 3 1 b 0 b 1 b 2 R e s u l t 3 1 B i n v e r t C a r r y I n C a r r y I n C a r r y O u t A L U 1 C a r r y I n C a r r y O u t A L U 2 C a r r y I n C a r r y O u t A L U 3 1 C a r r y I n 0 2 R e s u l t O p e r a t i o n a 1 C a r r y I n C a r r y O u t 0 1 B i n v e r t b Figure 0 1 g.

6 Babic Presentation F 12 2 s Complement Overflow 0 3 R e s u l t O p e r a t i o n a 1 C a r r y I n 0 1 B i n v e r t b 2 L e s s O v e r f l o w d e t e c t i o n O v e r f l o w + Carry Out 1-bit ALU for the most significant bit Other 1-bit ALUs, non-most significant bit ALUs, are not affected. 2 s complement overflow happens: if a sum of two positive numbers results in a negative number if a sum of two negative numbers results in a positive number 7 g. babic Presentation F Carry Out a 3 1 A L U 0 R e s u l t 0 a 0 R e s u l t 1 a 1 R e s u l t 2 a 2 O p e r a t i o n b 3 1 b 0 b 1 b 2 R e s u l t 3 1 O v e r f l o w B i n v e r t C a r r y I n C a r r y I n C a r r y O u t A L U 1 C a r r y I n C a r r y O u t A L U 2 C a r r y I n C a r r y O u t A L U 3 1 C a r r y I n 32-bit ALU With 4 Functions and Overflow Function Binvert (1 line) Operation (2 lines) and 0 00 or 0 01 add 0 10 subtract 1 10 Control lines Missing.

7 Slt & nor functions and Zero output


Related search queries