multioperand addition lecture 6. required reading chapter 8, multioperand addition note errata at:...

Post on 16-Dec-2015

232 Views

Category:

Documents

1 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Multioperand Addition

Lecture 6

Required Reading

Chapter 8, Multioperand Addition

Note errata at:http://www.ece.ucsb.edu/~parhami/text_comp_arit_1ed.htm#errors

Behrooz Parhami, Computer Arithmetic: Algorithms and Hardware Design

Recommended Reading

J-P. Deschamps, G. Bioul, G. Sutter, Synthesis of Arithmetic Circuits: FPGA, ASIC and Embedded Systems

Chapter 11.1.12 Multioperand Adders

Applications of multioperand addition

Multiplication Inner product

s = x(i) y(i) = i=0

n-1

i=0

n-1

p(i)p=a·x

Number of bits of the result

S = x(i)

i=0

n-1

x(i) [0..2k-1]

Smax = n (2k-1)Smin = 0

# of bits of S = log2 (Smax + 1) =

= log2 (n (2k-1) + 1) log2 n 2k =

= k + log2 n

Serial implementation of multioperand addition

Adding 7 numbers in the binary tree of adders

Ripple-carry adders at levels i and i+1

Example: Adding 8 3-bit numbers

Ripple-Carry Carry Propagate Adder (CPA)

a1 b1

FAc2

s1

a0 b0

FAc0c1

s0

a2 b2

FAc3

s2

an-1 bn-1

FAcn

sn-1

cn-1 . . .

Carry Save Adder (CSA)

FA

c2 s1

a0 b0

FA

c1 s0

FA

c3 s2

FA

cn sn-1 cn-1

. . .

c0

s3

a1 b1 c1a2 b2 c2an-1 bn-1 cn-1

A Ripple-Carry vs. Carry-Save Adder

0 1 0 1 01 1 0 1 11 0 1 1 1

24 23 22 21 20

0 0 1 1 01 1 0 1 1

xyz

sc

Operation of a Carry Save Adder (CSA)

Example

x+y+z = s + c

Carry propagate and carry-save adders in dot notation

Specifying full- and half-adder blocks in dot notation

Carry-save adder for four operands

x3 x2 x1 x0

y3 y2 y1 y0

z3 z2 z1 z0

w3 w2 w1 w0

s3 s2 s1 s0

c4 c3 c2 c1

w3 w2 w1 w0

c4 s3 s2 s1 s0

c4 c3 c2 c1

’’’’’’’’

S5 S4 S3 S2 S1 S0

Carry-save adder for four operands

s0s1s2s3 c1c2c3c4

s0s1s2s3 c1c2c3c4’’’’’’’’

Carry-save adder for four operands

x y z

4 4 4

CSA

CSA

4

w

CPA

sc

s’c’

S

Carry-save adder for six operands

CSA tree Implementation of one-bit slice

Tree of carry save adders reducingseven numbers to two

Addition of sevensix-bit numbersin dot notation

Adding sevenk-bit numbers:block diagram

Relationship Between Number of Inputs and Tree Height

Latency

LatencyCSA = h(n) TFA + LatencyCPA(k, n)

Tree heightfor n operands

Widths

CSA

CPA

k .. k + log2 ntypically

close to k bits

k + log2 n

Component Adders

Parameters of tree carry-save adders (1)

Maximum number of inputs that can be reduced to two by an h-level tree, n(h)

Parameters of tree carry-save adders (2)

n(0) = 2

n(h) = n(h-1)32

n(1) = 3n(2) = 4n(3) = 6

n(4) = 9n(5) = 13n(6) = 19

2 ( )h-1 < n(h) 2 ( )h32

32

Parameters of tree carry-save adders (3)

Smallest height of the tree carry save adder for n operands, h(n)

h(n) = 1 + h( )23

n

h(n) log ( )

h(2) = 0

n2

3

2

Wallace vs. Dadda Trees (1)

Wallace trees

Dadda trees

• Reduce the size of the final Carry Propagate Adder (CPA)• Optimum from the point of view of speed

• Reduce the cost of the carry save tree• Optimum (among the CSA trees) from the point of view of area

• Wallace reduces number of operands at earliest opportunity– Goal of this is to have smallest number of bits

for CPA adder– However, sometimes having a few bits longer

CPA adder does not affect the propagation delay significantly (i.e. carry-lookahead)

• Dadda seeks to reduce the number of FA and HA units – May be at the cost of a slightly larger final CPA

Wallace vs. Dadda Trees (2)

Wallace Tree

Dadda Tree

0 1 0 1 01 1 0 1 11 0 1 1 11 0 1 1 11 1 1 1 1

24 23 22 21 20

0 1 1 1 0 0 1 1 0 01 0 0 1 1

abcde

s0s1s2

5-to-3 Parallel Counter

a+b+c+d+e = s0+s1+s2

S0

S1

S2

‘0’

e

LUT F

d

c

a

b

d

c

a

bLUT G

Implementation of 1-bit of 5-to-3 parallel counter

using single CLB slice of a Virtex FPGA

w w w w w

w

CSA

CSA

CSA

CPA

y=a+b+c+d+e mod 2w

a b c d ew w w w w

w

PC

CSA

CPA

y=a+b+c+d+e mod 2w

a b c d e

s2 s1 s0

Carry Save Adder vs. 5-to-3 Parallel Counter

Generalized Parallel Counters

(5, 5; 4)-counter Fig. 8.17 Dot notation for a (5, 5; 4)-counter and the use of such counters for reducing five numbers to two numbers.

. . .

Multicolumn reduction

(2, 3; 3)-counter

Unequal columns

Generalized parallel counter = Parallel compressor

top related