Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS 140 Lecture 14 Professor CK Cheng 11/14/02. Part II. Standard Modules A.Interconnect B.Operators. Adders Multiplier Adders1. Representation of numbers.

Similar presentations


Presentation on theme: "CS 140 Lecture 14 Professor CK Cheng 11/14/02. Part II. Standard Modules A.Interconnect B.Operators. Adders Multiplier Adders1. Representation of numbers."— Presentation transcript:

1 CS 140 Lecture 14 Professor CK Cheng 11/14/02

2 Part II. Standard Modules A.Interconnect B.Operators. Adders Multiplier Adders1. Representation of numbers 2. Full Adder 3. Half Adder 4. Carry Look Ahead Adder

3 id 0 1 2 3 4 5 6 7 8 4 bit 0000 0001 0010 0011 0100 0101 0110 0111 Sign magnitude 1000 1001 1010 1011 1100 1101 1110 1111 2s Compliment 0000 1111 1110 1101 1100 1011 1010 1001 1000 1s Compliment 1111 1110 1101 1100 1011 1010 1001 1000 1. Representation

4 2 + 3 = 5 0 0 1 0 + 0 0 1 1 0 1 0 1 2 - 3 = -1 (2’s) 0 0 1 0 + 1 1 0 1 1 1 1 1 2 - 3 = -1 (1’s) 0 0 1 0 + 1 1 0 0 1 1 1 0 Examples -2 - 3 = -5 (2’s) 1 1 1 0 + 1 1 0 1 1 0 1 1 -2 - 3 = -5 (1’s) 1 1 1 0 + 1 1 0 0 1 0 0 1 3 + 5 = 8 0 0 1 1 + 0 1 0 1 1 0 0 0 1 1 1 C 5 C 4 Checking for overflow -3 + -5 = -8 1 1 0 1 + 1 0 1 1 1 0 0 0 1 1 1 1 C 5 C 4

5 Adder MUX Sum minus bb’ a Cout overflow C4C4 C3C3

6 s um = a + b + c in c out = ab + a c in + b c in = ab + (a + b)c in 2. Full Adder FA a b Sum c out c in 0 0 0 0 1 1 b c a a + b = a + b if ab = 0 a + b + ab = a + b + ab

7 Id a b c in carry sum 0 0 0 0 0 0 1 0 0 1 0 1 2 0 1 0 0 1 3 0 1 1 1 0 4 1 0 0 0 1 5 1 0 1 1 0 6 1 1 0 1 0 7 1 1 1 1 1 Sum = a + b + Cin Cout = ab + aCin + bCin

8 a b Cout sum 0 0 0 0 0 1 0 1 1 0 0 1 1 1 1 0 Sum = ab’ + a’b = a + b Cout = ab Cout Sum abab HA a b Sum c out 3. Half Adder

9 HA a b cin a + b x sum carryout OR sum cout

10 4. Carry Look Ahead Adder C 1 = a 0 b 0 + (a 0 +b 0 )c 0 = q 0 + p 0 c 0 C 2 = a 1 b 1 + (a 1 +b 1 )c 1 = q 1 + p 1 c 1 = q 1 + p 1 q 0 + p 1 p 0 c 0 C 3 = a 2 b 2 + (a 2 +b 2 )c 2 = q 2 + p 2 c 2 = q 2 + p 2 q 1 + p 2 p 1 q 0 + p 2 p 1 p 0 c 0 C 4 = a 3 b 3 + (a 3 +b 3 )c 3 = q 3 + p 3 c 3 = q 3 + p 3 q 2 + p 3 p 2 q 1 + p 3 p 2 p 1 q 0 + p 3 p 2 p 1 p 0 c 0 q i = a i b i p i = a i + b i a 3 b 3 q3q3 p 3 a 2 b 2 q2q2 p 2 a 1 b 1 q1q1 p 1 a 0 b 0 q0q0 p 0 c1c1 c2c2 c3c3 c4c4 c0c0


Download ppt "CS 140 Lecture 14 Professor CK Cheng 11/14/02. Part II. Standard Modules A.Interconnect B.Operators. Adders Multiplier Adders1. Representation of numbers."

Similar presentations


Ads by Google