Presentation is loading. Please wait.

Presentation is loading. Please wait.

Tree and Array Multipliers

Similar presentations


Presentation on theme: "Tree and Array Multipliers"— Presentation transcript:

1 Tree and Array Multipliers
Lecture 7 Tree and Array Multipliers

2 Required Reading Behrooz Parhami,
Computer Arithmetic: Algorithms and Hardware Design Chapter 11, Tree and Array Multipliers Chapter 12.5, The special case of squaring Note errata at:

3

4 Notation a Multiplicand ak-1ak a1 a0 x Multiplier xk-1xk x1 x0 p Product (a  x) p2k-1p2k p2 p1 p0

5 Multiplication of two 4-bit unsigned binary numbers in dot notation

6 Basic Multiplication Equations
k-1 x =  xi  2i p = a  x i=0 k-1 p = a  x =  a  xi  2i = = x0a20 + x1a21 + x2a22 + … + xk-1a2k-1 i=0

7 Unsigned Multiplication
a4 a3 a2 a1 a0 x x4 x3 x2 x1 x0 ax0 20 a4x0 a3x0 a2x0 a1x0 a0x0 ax1 21 a4x1 a3x1 a2x1 a1x1 a0x1 + ax2 22 a4x2 a3x2 a2x2 a1x2 a0x2 ax3 23 a4x3 a3x3 a2x3 a1x3 a0x3 ax4 24 a4x4 a3x4 a2x4 a1x4 a0x4 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0

8 Full tree multiplier - general structure

9 7 x 7 tree multiplier

10 A slice of a balanced-delay tree for 11 inputs

11 with a more regular structure
Tree multiplier with a more regular structure

12 Unsigned vs. Signed Multiplication
1111 15 1111 -1 x x x x 225 1

13 2’s Complement Multiplication (1)
-24 23 22 21 20 a4 a3 a2 a1 a0 x x4 x3 x2 x1 x0 24 23 22 21 20 -a4 a3 a2 a1 a0 x -x4 x3 x2 x1 x0

14 2’s Complement Multiplication (2)
-a4 a3 a2 a1 a0 x -x4 x3 x2 x1 x0 -a4x0 a3x0 a2x0 a1x0 a0x0 -a4x1 a3x1 a2x1 a1x1 a0x1 + -a4x2 a3x2 a2x2 a1x2 a0x2 -a4x3 a3x3 a2x3 a1x3 a0x3 a4x4 -a3x4 -a2x4 -a1x4 -a0x4 -p9 p8 p7 p6 p5 p4 p3 p2 p1 p0 29 28 27 26 25 24 23 22 21 20

15 2’s Complement Multiplication (3)
29 28 27 26 25 24 23 22 21 20 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0 -29 28 27 26 25 24 23 22 21 20

16 2’s Complement Multiplication (4)
z = 1 - z z = 1 - z - aj xi = - aj (1 - xi) = aj xi - aj = aj xi + aj - 2 aj - aj xi = - (1- aj ) xi = aj xi - xi = aj xi + xi - 2 xi - aj xi = - (1- aj xi) = aj xi = aj xi -aj = - (1 - aj) = aj = aj -xi = - (1 - xi) = xi = xi

17 + -a4x0 -a4x1 -a4x2 -a4x3 -a4 a4x0 -a4 a4x1 a4 -a4 a4x2 a4 -a4 a4x3 a4
-1 a4

18 + -a3x4 -a2x4 -a1x4 -a0x4 -x4 a0x4 -x4 a1x4 x4 -x4 a2x4 x4 -x4 a3x4 x4
-1 x4

19 29 28 27 26 25 24 a4 a4x3 a4x2 a4x1 a4x0 -1 a4 x4 a3x4 a2x4 a1x4 a0x4 -1 x4 -1 a4 a4x3 a4x2 a4x1 a4x0 x4 a3x4 a2x4 a1x4 a0x4 a4 x4 1 a4 a4x3 a4x2 a4x1 a4x0 x4 a3x4 a2x4 a1x4 a0x4 a4 -29 x4

20 Baugh-Wooley 2’s Complement Multiplier
-a4 a3 a2 a1 a0 x -x4 x3 x2 x1 x0 a4x0 a3x0 a2x0 a1x0 a0x0 a4x1 a3x1 a2x1 a1x1 a0x1 + a4x2 a3x2 a2x2 a1x2 a0x2 a4x3 a3x3 a2x3 a1x3 a0x3 a4x4 a3x4 a2x4 a1x4 a0x4 a4 a4 1 x4 x4 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0 -29 28 27 26 25 24 23 22 21 20

21 + -a4x0 -a4x1 -a4x2 -a4x3 -1 a4x0 -1 a4x1 1 -1 a4x2 1 -1 a4x3 1 1 a4x3

22 + -a3x4 -a2x4 -a1x4 -a0x4 -1 a0x4 -1 a1x4 1 -1 a2x4 1 -1 a3x4 1 1 a3x4

23 29 28 27 26 25 24 a4x3 a4x2 a4x1 a4x0 -1 1 a3x4 a2x4 a1x4 a0x4 -1 1 a4x3 a4x2 a4x1 a4x0 a3x4 a2x4 a1x4 a0x4 -1 1 a4x3 a4x2 a4x1 a4x0 a3x4 a2x4 a1x4 a0x4 1 1 -29

24 Modified Baugh-Wooley Multiplier
-a4 a3 a2 a1 a0 x -x4 x3 x2 x1 x0 a4x0 a3x0 a2x0 a1x0 a0x0 a4x1 a3x1 a2x1 a1x1 a0x1 + a4x2 a3x2 a2x2 a1x2 a0x2 a4x3 a3x3 a2x3 a1x3 a0x3 a4x4 a3x4 a2x4 a1x4 a0x4 1 1 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0 -29 28 27 26 25 24 23 22 21 20

25 Basic array multiplier

26 5 x 5 Array Multiplier

27 Array Multiplier - Basic Cell
cin x y FA cout s

28 Baugh-Wooley 2’s Complement Multiplier
-a4 a3 a2 a1 a0 x -x4 x3 x2 x1 x0 a4x0 a3x0 a2x0 a1x0 a0x0 a4x1 a3x1 a2x1 a1x1 a0x1 + a4x2 a3x2 a2x2 a1x2 a0x2 a4x3 a3x3 a2x3 a1x3 a0x3 a4x4 a3x4 a2x4 a1x4 a0x4 a4 a4 1 x4 x4 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0 -29 28 27 26 25 24 23 22 21 20

29 Modifications in a 5 x 5 multiplier

30 Array Multiplier – Modified Basic Cell
am ci si-1 xn FA ci+1 si

31 5 x 5 Array Multiplier with modified cells

32 Pipelined 5 x 5 Multiplier

33 Optimizations for Squaring (1)

34 Optimizations for Squaring (2)
xi xj xi xj + xi xj = 2 xi xj xj xi xi xj xi xi = xi xi xj xi xj + xi = 2 xi xj - xi xj + xi = = 2 xi xj + xi (1-xj) = = 2 xi xj + xi xj xi xi xj xi xj

35 Squaring Using Look-Up Tables
for relatively small values k input=a output=a2 1 1 2 4 3 9 4 16 2k words 2k-bit each . . . i i2 . . . 2k-1 (2k-1)2

36 Multiplication Using Squaring
(a+x)2 - (a-x)2 a  x = 4


Download ppt "Tree and Array Multipliers"

Similar presentations


Ads by Google