Top Banner
Multiplication
34

Multiplication. Multiplier Notation Partial Products Logical-AND.

Dec 23, 2015

Download

Documents

Colin Little
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Multiplication. Multiplier Notation Partial Products Logical-AND.

Multiplication

Page 2: Multiplication. Multiplier Notation Partial Products Logical-AND.

Multiplier Notation

Partial ProductsLogical-AND

Page 3: Multiplication. Multiplier Notation Partial Products Logical-AND.

Shift and Add Paradigm

Page 4: Multiplication. Multiplier Notation Partial Products Logical-AND.

Shift and Add Examples

Page 5: Multiplication. Multiplier Notation Partial Products Logical-AND.

Programmed Multiplication

Page 6: Multiplication. Multiplier Notation Partial Products Logical-AND.

Programmed Multiplication (cont.)

Page 7: Multiplication. Multiplier Notation Partial Products Logical-AND.

Hardware Shift and Add (right)

Page 8: Multiplication. Multiplier Notation Partial Products Logical-AND.

Hardware Shift and Add

Page 9: Multiplication. Multiplier Notation Partial Products Logical-AND.

Hardware Shift and Add (left)

Page 10: Multiplication. Multiplier Notation Partial Products Logical-AND.

Signed Number Multiplication(positive case)

Page 11: Multiplication. Multiplier Notation Partial Products Logical-AND.

Signed Number Multiplication(negative case)

Page 12: Multiplication. Multiplier Notation Partial Products Logical-AND.

Booth’s Recoding (or encoding)

• Developed for Speeding Up Multiplication in Early Computers• When a Partial Product of 0 Occurs, Can Skip Addition and

Just Shift• Doesn’t Help Multipliers Where Datapaths Go Through Adder

Such as Previous Examples• Does Help Designs for Asynchronous Implementation or

Microprogramming Since Shifting is Faster Than Addition• Variable Delay – Depends on Number of One’s in • Booth Observed that a String of 1’s May be Replaced as:

1 1 12 2 2 2 2 2j j i i j i

Page 13: Multiplication. Multiplier Notation Partial Products Logical-AND.

Booth’s Recoding Example

xn xn-1 ... xi xi-1 ... x0 (0)

yn ... yi ... y0

yi=xi-1 - xi

xi xi-1 Operation Comments yi 0 0 shift only string of zeros 0 1 1 shift only string of ones 0 1 0 subtract shift beg. string of ones -1 0 1 addition shift end string of ones 1

EXAMPLE 0011110011(0) 0100010101

Page 14: Multiplication. Multiplier Notation Partial Products Logical-AND.

Booth’s Recoding

• Maps Words With Digit Set [0,1] to Those With [-1,1]

Page 15: Multiplication. Multiplier Notation Partial Products Logical-AND.

Sequential Multiplication

A 1011 (-510) X 1101 (-310) Y 0111 (recoded)(-1) Add –A 0101Shift 00101(+1) Add +A 1011 11011Shift 111011(-1) Add –A 0101 001111Shift 0001111 (+1510)

Page 16: Multiplication. Multiplier Notation Partial Products Logical-AND.

Booth Multiplier Example

Page 17: Multiplication. Multiplier Notation Partial Products Logical-AND.

Booth’s Recoding Drawbacks

• Number of add/sub Operations are Variable• Some Inefficiencies

EXAMPLE 001010101(0) 011111111

• Can Use Modified Booth’s Recoding to Prevent• Will Look at This in Later Class

Page 18: Multiplication. Multiplier Notation Partial Products Logical-AND.

Sign Extension• Consider 6-bit 2’s Complement Number

s=0 Positive Value; s=1 Negative Value• Show Sign Extension Works:

4 3 2 1 0

9 8 7 6 5 4 3 2 1 04 3 2 1 0

49 8 7 6 5

0

49 9 5

0

45

0

2 2 2 2 2 2 2 2 2 2

2 (2 2 2 2 ) 2

2 (2 2 ) 2

2 2

ii

i

ii

i

ii

i

s s s s s p p p p p

s s s s s p p p p p

s s p

s s p

s p

• Definition of 2’s Complement

Page 19: Multiplication. Multiplier Notation Partial Products Logical-AND.

Sign Extension Example

A 010110 (+2210)X 001011 (+1110)Y 010101 (recoding) 11111101010 (neg. A) 0000000000 (0 A) 111101010 (neg. A) 00000000 (0 A) 0010110 (neg. A) 000000 (0 A) 00011110010 (24210)

Page 20: Multiplication. Multiplier Notation Partial Products Logical-AND.

Sign Extension Example

1 001010 (neg. A) 100000 (0 A) 001010 (neg. A) 100000 (0 A) 110110 (neg. A) 100000 (0 A) 00011110010 (24210)

• Same Trick as Before, Complement Original Sign Bit• Add 1 to Column 5

Page 21: Multiplication. Multiplier Notation Partial Products Logical-AND.

Methods for Fast Multiplication

• Reduce Number of Partial Products to be Added

– Group Multiplier Bits Together

– Higher Radix Multiplier

• Add the Partial Products Faster

Page 22: Multiplication. Multiplier Notation Partial Products Logical-AND.

Radix-r Shift and Add

Page 23: Multiplication. Multiplier Notation Partial Products Logical-AND.

Radix-4 Multiplication

• Shifter is Multi-bit

• No Longer a Simple AND of xi with a

• Need 4:1 MUX with 0, a, 2a, 3a as Inputs

Page 24: Multiplication. Multiplier Notation Partial Products Logical-AND.

Partial Product Selection

• 0, a and 2a are easy

• 3a=a+2a Requies an Adder!

• Need a Way to Compute 3a Efficiently

Page 25: Multiplication. Multiplier Notation Partial Products Logical-AND.

Example With 3a Availability

Page 26: Multiplication. Multiplier Notation Partial Products Logical-AND.

Computing 3a

• One Way is to Precompute 3a and Store in Register Initially

• Another Way is When 3a Occurs Add -a

• Send Carry of 1 to Next into Next Radix-4 Digit of Multiplier

• Causes Incoming Multiple to be [0,4] Versus [0,3]

– 4 Because incoming carry to 112 Causes Digit 1002

• Multiples 0, 1, 2 Handled Easily

• Multiple 3 Converted to –1 With Outgoing Carry of 1

• Multiple 4 Converted to 0 With Outgoing Carry of 1

• Requires Extra Cycle of Computation Since MSD May Have Carry

Page 27: Multiplication. Multiplier Notation Partial Products Logical-AND.

Example With 3a Availability

Page 28: Multiplication. Multiplier Notation Partial Products Logical-AND.

Using Radices >4

• Could Also Use Radices of 8, 16, ...

• Bit Groupings of Size 3, 4, ...

• Multiple Generation Hardware Becomes More Complex

• Must Precompute 3a, 5a, 7a, ....

• Or Use 3a With a Carry Scheme

• Carry Scheme Converts Multipliers 5a, 6a, 7a

to –3a, -2a, -a, etc.

• Carry Digit in This Form Becomes a 1

Page 29: Multiplication. Multiplier Notation Partial Products Logical-AND.

Booth Recoding

• Modern Arithmetic Circuits DO NOT Apply

Booth Recoding Directly

• Useful in Understanding Higher-radix Versions of

Booth Recoding

• No Consecutive 1’s or –1’s Occur Using Previously Seen

Booth Recoding

• Booth Recoding in Radix-4 Results in the Following:– Only Multiples of a or 2a are Required– These are Easily Obtained Using Shifting and Complementation

Page 30: Multiplication. Multiplier Notation Partial Products Logical-AND.

Modified Booth Recoding

• Booth Recoding Results From xi and xi-1

• Radix-4 Multiplier Digits Implies Booth Recoding

Based on xi+1, xi and xi-1

• Similar to Classical Booth Recoding, Modified Booth

Recoding Encodes Multipliers into [-2,2]

Page 31: Multiplication. Multiplier Notation Partial Products Logical-AND.

Modified Booth Recoding

Page 32: Multiplication. Multiplier Notation Partial Products Logical-AND.

Example Modified Booth Recoding

Page 33: Multiplication. Multiplier Notation Partial Products Logical-AND.

Example Multiplication with MBR

Page 34: Multiplication. Multiplier Notation Partial Products Logical-AND.

Hardware MBR Example