1 Using 2-opr adder Carry-save adder Wallace Tree Dadda Tree Parallel Counters Multi-Operand...

19
1 • Using 2-opr adder • Carry-save adder • Wallace Tree • Dadda Tree • Parallel Counters Multi-Operand Addition

Transcript of 1 Using 2-opr adder Carry-save adder Wallace Tree Dadda Tree Parallel Counters Multi-Operand...

Page 1: 1 Using 2-opr adder Carry-save adder Wallace Tree Dadda Tree Parallel Counters Multi-Operand Addition.

1

• Using 2-opr adder

• Carry-save adder

• Wallace Tree

• Dadda Tree

• Parallel Counters

Multi-Operand Addition

Page 2: 1 Using 2-opr adder Carry-save adder Wallace Tree Dadda Tree Parallel Counters Multi-Operand Addition.

2

• X1+X2+ …+Xk with n-bit each

• Sum= n +log2(k) bits

• Serial Addition Tadd= (k–1) (TAdder + TReg )

Aadd= AAdder + AReg

Two-Operand Adders

X i

n+log2(k)

Adder Reg.

Page 3: 1 Using 2-opr adder Carry-save adder Wallace Tree Dadda Tree Parallel Counters Multi-Operand Addition.

3

• Serial Addition: Cascading Tadd=

Aadd= AAdder= bits adders

Two-Operand Adders(2)

Add

er

Add

er

Add

er

. . .

X1

X2X3

Xk

1

12 )log(

k

iin

1

12 )log(

k

iinT

Page 4: 1 Using 2-opr adder Carry-save adder Wallace Tree Dadda Tree Parallel Counters Multi-Operand Addition.

4

• Parallel Addition: Binary tree

Tadd=

Aadd=

Two-Operand Adders(3)

Add

er

Add

er

Add

er

/

/

/

. . . /

X1

X2

X3

n+1Add

er

X4

n+2

n+log2K

k

iinT

2log

1)1(

k

i

i inAk2log

1)1()2/(

Page 5: 1 Using 2-opr adder Carry-save adder Wallace Tree Dadda Tree Parallel Counters Multi-Operand Addition.

5

• Add more than two numbers (says n)

• Carry not added (Carry save)

• 3 # (3,2) 2#

Carry-Save Adder

FA

0 1 0 1

FA FA FA

1 0 0 10 1 1 1

1 0 1 10 1 0 1

Page 6: 1 Using 2-opr adder Carry-save adder Wallace Tree Dadda Tree Parallel Counters Multi-Operand Addition.

6

• CPA in the last step

• 3 # (3,2) 2#;

• TCPA+log3/2kTFA

Carry-Save Adder(2)

Csa

veA

CSa

veA

CPA

X1X2

X3

CSa

veA CSa

veA

Page 7: 1 Using 2-opr adder Carry-save adder Wallace Tree Dadda Tree Parallel Counters Multi-Operand Addition.

7

• 4# (4,2) 2#;

• TCPA+ 2 log2kTFA

Carry-Save Adder(3)

FA FA

FA FA

FA FA

FA FA

Page 8: 1 Using 2-opr adder Carry-save adder Wallace Tree Dadda Tree Parallel Counters Multi-Operand Addition.

8

• 7# (7,3) 3#;

• TCPA+ 2 log7/3kTFA

Carry-Save Adder(4)

FA FA

FA

(7,3)-counter

FA

Page 9: 1 Using 2-opr adder Carry-save adder Wallace Tree Dadda Tree Parallel Counters Multi-Operand Addition.

9

• Applying (3,2) FA & (2,2) HA with dot notation n=6&k=6 12 FA in 1st level

Carry-Save Adder(5-1)

Page 10: 1 Using 2-opr adder Carry-save adder Wallace Tree Dadda Tree Parallel Counters Multi-Operand Addition.

10

• Applying (3,2) FA & (2,2) HA with dot notation n=6&k=6 5 FA & 2HA in 2nd level

Carry-Save Adder(5-2)

Page 11: 1 Using 2-opr adder Carry-save adder Wallace Tree Dadda Tree Parallel Counters Multi-Operand Addition.

11

• Applying (3,2) FA & (2,2) HA with dot notation n=6&k=6 12HA in 2nd level 4 numbers (same)Not so good

Carry-Save Adder(5-2-1)

Page 12: 1 Using 2-opr adder Carry-save adder Wallace Tree Dadda Tree Parallel Counters Multi-Operand Addition.

12

• Applying (3,2) FA & (2,2) HA with dot notation n=6&k=6 5 FA & 1HA in 3rd level7-bit CPA in last level

Carry-Save Adder(5-3)

Page 13: 1 Using 2-opr adder Carry-save adder Wallace Tree Dadda Tree Parallel Counters Multi-Operand Addition.

13

• k-input Wallace Tree reduces to two (n+log2k –1)-bit outputs h(k)=1+h(2k/3)h(k): the smallest height of an k-input

Wallace tree

Wallace Tree

h(k)= 0 1 2 3 4 5 6

k= 2 3 4 6 9 13 19

Page 14: 1 Using 2-opr adder Carry-save adder Wallace Tree Dadda Tree Parallel Counters Multi-Operand Addition.

14

• 7-input Wallace Tree reduces to two (n+log2k –1)=(n+2)-bit outputs

Wallace Tree(2)

csa csa

csa csa

csa

(n,1)(n-1,0)

(n+1,2)

(1) (0)

Page 15: 1 Using 2-opr adder Carry-save adder Wallace Tree Dadda Tree Parallel Counters Multi-Operand Addition.

15

• Reduce the number to the next lower number

Dadda Tree

h(k)= 0 1 2 3 4 5 6

k= 2 3 4 6 9 13 19

h(k)= 7 8 9 10 11 12 13

k= 28 42 63 94 141 211 316

Page 16: 1 Using 2-opr adder Carry-save adder Wallace Tree Dadda Tree Parallel Counters Multi-Operand Addition.

16

• Reduce the number to the next lower number

• Ex1: k=8 8 (2CSA)6 (2CSA)4 (1CSA)3(1CSA)2CPA

• Ex2: k=12 12 (3CSA)9 6 4 2

Dadda Tree(2)

h(k)= 0 1 2 3 4 5 6

k= 2 3 4 6 9 13 19

Page 17: 1 Using 2-opr adder Carry-save adder Wallace Tree Dadda Tree Parallel Counters Multi-Operand Addition.

17

• One column(3,2) counter at most 3 1’s 2 bits (k,m) counter at most k 1’s

m=log2(k+1) bits

• How about multi-column?(k,k,m) counter: at most k 3’s

m=log2(3k+1) bits

Parallel Counters

Page 18: 1 Using 2-opr adder Carry-save adder Wallace Tree Dadda Tree Parallel Counters Multi-Operand Addition.

18

• Ex: (5,5,m); m= log2(3*5+1)= 4 bitsOverlapped m/(# of col.) = 2 bits CPA at last stage too

Parallel Counters(2)

Page 19: 1 Using 2-opr adder Carry-save adder Wallace Tree Dadda Tree Parallel Counters Multi-Operand Addition.

19

• Ex: (5,5,5,m); m= log2(7*5+1)= 6 bitsOverlapped m/(# of col.) = 2 bits CPA at last stage too

Parallel Counters(3)