Unsigned Multiplication

Slides:



Advertisements
Similar presentations
1 Integer Multipliers. 2 Multipliers A must have circuit in most DSP applications A variety of multipliers exists that can be chosen based on their performance.
Advertisements

Multiplication and Shift Circuits Dec 2012 Shmuel Wimer Bar Ilan University, Engineering Faculty Technion, EE Faculty 1.
ECE2030 Introduction to Computer Engineering Lecture 13: Building Blocks for Combinational Logic (4) Shifters, Multipliers Prof. Hsien-Hsin Sean Lee School.
Using Carry-Save Adders For Radix- 4, Can Be Used to Generate 3a – No Booth’s Slight Delay Penalty from CSA – 3 Gates.
Copyright 2008 Koren ECE666/Koren Part.6b.1 Israel Koren Spring 2008 UNIVERSITY OF MASSACHUSETTS Dept. of Electrical & Computer Engineering Digital Computer.
EECS Components and Design Techniques for Digital Systems Lec 18 – Arithmetic II (Multiplication) David Culler Electrical Engineering and Computer.
Chapter 6 Arithmetic. Addition Carry in Carry out
ECE C03 Lecture 61 Lecture 6 Arithmetic Logic Circuits Hai Zhou ECE 303 Advanced Digital Design Spring 2002.
UNIVERSITY OF MASSACHUSETTS Dept
Chapter # 5: Arithmetic Circuits Contemporary Logic Design Randy H
Contemporary Logic Design Arithmetic Circuits © R.H. Katz Lecture #24: Arithmetic Circuits -1 Arithmetic Circuits (Part II) Randy H. Katz University of.
ECE 301 – Digital Electronics
Copyright 2008 Koren ECE666/Koren Part.6a.1 Israel Koren Spring 2008 UNIVERSITY OF MASSACHUSETTS Dept. of Electrical & Computer Engineering Digital Computer.
Chapter 5 Arithmetic Logic Functions. Page 2 This Chapter..  We will be looking at multi-valued arithmetic and logic functions  Bitwise AND, OR, EXOR,
Multiplication.
Arithmetic.
1 Bits are just bits (no inherent meaning) — conventions define relationship between bits and numbers Binary numbers (base 2)
ECE 4110– Sequential Logic Design
Aug Shift Operations Source: David Harris. Aug Shifter Implementation Regular layout, can be compact, use transmission gates to avoid threshold.
Chapter 6-2 Multiplier Multiplier Next Lecture Divider
Arithmetic Chapter 4.
Arithmetic Chapter 4.
Chapter # 5: Arithmetic Circuits
Reconfigurable Computing - Multipliers: Options in Circuit Design John Morris Chung-Ang University The University of Auckland ‘Iolanthe’ at 13 knots on.
Spring 2002EECS150 - Lec12-cl3 Page 1 EECS150 - Digital Design Lecture 12 - Combinational Logic Circuits Part 3 March 4, 2002 John Wawrzynek.
Multiplication of signed-operands
1 Chapter 7 Computer Arithmetic Smruti Ranjan Sarangi Computer Organisation and Architecture PowerPoint Slides PROPRIETARY MATERIAL. © 2014 The McGraw-Hill.
Combinational Circuits
Topics covered: Arithmetic CSE243: Introduction to Computer Architecture and Hardware/Software Interface.
ECE 331 – Digital System Design Multi-bit Adder Circuits, Adder/Subtractor Circuit, and Multiplier Circuit (Lecture #12)
ECE DIGITAL LOGIC LECTURE 15: COMBINATIONAL CIRCUITS Assistant Prof. Fareena Saqib Florida Institute of Technology Fall 2015, 10/20/2015.
UNIT 2. ADDITION & SUBTRACTION OF SIGNED NUMBERS.
Gunjeet Kaur Dronacharya Group of Institutions. Binary Adder-Subtractor A combinational circuit that performs the addition of two bits is called a half.
Full Adder Truth Table Conjugate Symmetry A B C CARRY SUM
Arithmetic UNIT-V.
Combinational Circuits
Integer Multiplication and Division
Sequential Multipliers
UNIVERSITY OF MASSACHUSETTS Dept
CSE 575 Computer Arithmetic Spring 2003 Mary Jane Irwin (www. cse. psu
Combinational Logic Logic circuits for digital systems may be combinational or sequential. A combinational circuit consists of input variables, logic gates,
Module-4 Arithmetic.
Multipliers Multipliers play an important role in today’s digital signal processing and various other applications. The common multiplication method is.
Summary Half-Adder Basic rules of binary addition are performed by a half adder, which has two binary inputs (A and B) and two binary outputs (Carry out.
Registers and Counters Register : A Group of Flip-Flops. N-Bit Register has N flip-flops. Each flip-flop stores 1-Bit Information. So N-Bit Register Stores.
CprE 583 – Reconfigurable Computing
ECE 434 Advanced Digital System L13
ECE 434 Advanced Digital System L12
Digital Building Blocks
CSE Winter 2001 – Arithmetic Unit - 1
UNIT-6 Arithmetic Course code: 10CS46 Prepared by :
King Fahd University of Petroleum and Minerals
Arithmetic Functions & Circuits
Arithmetic Circuits (Part I) Randy H
Subject Name: Fundamentals Of CMOS VLSI Subject Code: 10EC56
Integer Multipliers.
Overview Part 1 – Design Procedure Part 2 – Combinational Logic
Reading: Study Chapter (including Booth coding)
Montek Singh Mon, Mar 28, 2011 Lecture 11
UNIVERSITY OF MASSACHUSETTS Dept
Multiple function unit design
Overview Iterative combinational circuits Binary adders
UNIVERSITY OF MASSACHUSETTS Dept
Combinational Circuits
UNIVERSITY OF MASSACHUSETTS Dept
UNIVERSITY OF MASSACHUSETTS Dept
Booth Recoding: Advantages and Disadvantages
Number Representation
UNIVERSITY OF MASSACHUSETTS Dept
1 Lecture 5Multiplication and Division ECE 0142 Computer Organization.
Presentation transcript:

Unsigned Multiplication

Manual Multiplication Algorithm (13) Multiplicand M 1 (143) Product P (11) Multiplier Q ´ (a) Manual multiplication algorithm

Array Multiplication Multiplier Multiplicand m q p P artial product 3 2 1 q p 4 5 6 7 P artial product (PP0) PP1 PP2 PP3 PP4 = p , p , ... p 7 6 = Product Carry-in q i m j Bit of incoming partial product (PP ) Bit of outgoing partial product [PP( +1)] Carry-out T ypical cell F A (b) Array implementation

Another Version of 4×4 Array Multiplier

Array Multiplication What is the critical path (worst case signal propagation delay path)? Assuming that there are two gate delays from the inputs to the outputs of a full adder block, the path has a total of 6(n-1)-1 gate delays, including the initial AND gate delay in all cells, for the nn array. Any advantages/disadvantages?

Sequential Circuit Binary Multiplier Register A (initially 0) M Shift right 1 1 0 1 Initial configuration 0 0 0 0 1 0 1 1 C a a q q n - 1 n - 1 C A Q Multiplier Q 1 1 0 1 1 0 1 1 Add 0 1 1 0 1 1 0 1 Shift First cycle Add/Noadd control 1 0 0 1 1 1 1 0 1 Add 1 0 0 1 1 1 1 0 Shift Second cycle n -bit No add adder 1 0 0 1 1 1 1 0 0 1 0 0 1 1 1 1 Shift Third cycle Control MUX sequencer 1 0 0 0 1 1 1 1 1 Add Shift Fourth cycle 1 0 0 0 1 1 1 1 m m n - 1 Product Multiplicand M (b) Multiplication example (a) Register configuration

Signed Multiplication

Signed Multiplication Considering 2’s-complement signed operands, what will happen to (-13)(+11) if following the same method of unsigned multiplication? 1 1 1 ( - 13 ) 1 1 1 ( + 11 ) 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Sign extension is shown in blue 1 1 1 1 1 1 1 1 1 1 1 ( - 143 ) Figure 6.8. Sign extension of negative multiplicand.

Signed Multiplication For a negative multiplier, a straightforward solution is to form the 2’s-complement of both the multiplier and the multiplicand and proceed as in the case of a positive multiplier. This is possible because complementation of both operands does not change the value or the sign of the product. A technique that works equally well for both negative and positive multipliers – Booth algorithm.

Booth Algorithm Consider in a multiplication, the multiplier is positive 0011110, how many appropriately shifted versions of the multiplicand are added in a standard procedure? 1 1 1 1 + 1 + 1 + 1 + 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

Booth Algorithm Since 0011110 = 0100000 – 0000010, if we use the expression to the right, what will happen? 1 1 1 1 + 1 - 1 2's complement of 1 1 1 1 1 1 1 1 1 1 the multiplicand 1 1 1 1 1 1 1 1 1

Booth Algorithm In general, in the Booth scheme, -1 times the shifted multiplicand is selected when moving from 0 to 1, and +1 times the shifted multiplicand is selected when moving from 1 to 0, as the multiplier is scanned from right to left. 1 1 1 1 1 1 1 1 1 + 1 - 1 + 1 - 1 + 1 - 1 + 1 - 1 + 1 - 1 Figure 6.10. Booth recoding of a multiplier.

Booth Algorithm 1 1 1 ( + 13 ) 1 1 1 ´ 1 1 1 ( - 6 ) - 1 +1 - 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ( - 78 ) Figure 6.11. Booth multiplication with a negative multiplier.

Booth Algorithm Figure 6.12. Booth multiplier recoding table. V ersion of multiplicand selected by bit i Bit i Bit i - 1 × M 1 + 1 × M 1  1 × M 1 1 × M Figure 6.12. Booth multiplier recoding table.

Booth Algorithm Best case – a long string of 1’s (skipping over 1s) Worst case – 0’s and 1’s are alternating 1 1 1 1 1 1 1 1 Worst-case multiplier + 1 - 1 + 1 - 1 + 1 - 1 + 1 - 1 + 1 - 1 + 1 - 1 + 1 - 1 + 1 - 1 1 1 1 1 1 1 1 1 1 Ordinary multiplier - 1 + 1 - 1 + 1 - 1 + 1 - 1 1 1 1 1 1 1 1 1 Good multiplier + 1 - 1 + 1 - 1

Fast Multiplication

Bit-Pair Recoding of Multipliers Bit-pair recoding halves the maximum number of summands (versions of the multiplicand). Sign extension Implied 0 to right of LSB 1 1 1 1  1 + 1  1  1  2 (a) Example of bit-pair recoding derived from Booth recoding

Bit-Pair Recoding of Multipliers Multiplier bit-pair Multiplier bit on the right Multiplicand selected at position i i + 1 i i  1 ×M 1 + 1 ×M 1 + 1 ×M 1 1 + 2 ×M 1  2 ×M 1 1  1 ×M 1 1  1 ×M 1 1 1 ×M (b) Table of multiplicand selection decisions

Bit-Pair Recoding of Multipliers 1 1 1 - 1 + 1 - 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ( + 13 ) ´ 1 1 1 ( - 6 ) 1 1 1 1 1 1 ( - 78 ) 1 1 1 - 1 - 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Figure 6.15. Multiplication requiring only n/2 summands.

Carry-Save Addition of Summands (13) Multiplicand M 1 (143) Product P (11) Multiplier Q ´ (a) Manual multiplication algorithm

Carry-Save Addition of Summands Multiplier Multiplicand m 3 2 1 q p 4 5 6 7 P artial product (PP0) PP1 PP2 PP3 PP4 = p , p , ... p 7 6 = Product Carry-in q i m j Bit of incoming partial product (PP ) Bit of outgoing partial product [PP( +1)] Carry-out T ypical cell F A (b) Array implementation

Carry-Save Addition of Summands CSA speeds up the addition process.

Carry-Save Addition of Summands Figure 6.16. Ripple-carry and carry-save arrays for the multiplication operation M  Q = P for 4-bit operands.

Carry-Save Addition of Summands The delay through the carry-save array is somewhat less than delay through the ripple-carry array. This is because the S and C vector outputs from each row are produced in parallel in one full-adder delay. Consider the addition of many summands, we can: Group the summands in threes and perform carry-save addition on each of these groups in parallel to generate a set of S and C vectors in one full-adder delay Group all of the S and C vectors into threes, and perform carry-save addition on them, generating a further set of S and C vectors in one more full-adder delay Continue with this process until there are only two vectors remaining They can be added in a RCA or CLA to produce the desired product

Carry-Save Addition of Summands 1 1 1 1 (45) M X 1 1 1 1 1 1 (63) Q 1 1 1 1 A 1 1 1 1 B 1 1 1 1 C 1 1 1 1 D 1 1 1 1 E 1 1 1 1 F 1 1 1 1 1 1 (2,835) Product Figure 6.17. A multiplication example used to illustrate carry-save addition as shown in Figure 6.18.

1 1 1 1 M x 1 1 1 1 1 1 Q A 1 1 1 1 B 1 1 1 1 C 1 1 1 1 1 1 1 1 S 1 1 1 1 1 C 1 1 1 1 1 D 1 1 1 1 E 1 1 1 1 F S 1 1 1 1 2 1 1 1 1 C 2 1 1 1 1 S 1 1 1 1 1 C 1 1 1 1 1 S 2 1 1 1 1 1 1 S 3 1 1 1 C 3 1 1 1 1 C 2 1 1 1 1 1 1 1 S 4 + 1 1 1 C 4 1 1 1 1 1 1 Product Figure 6.18. The multiplication example from Figure 6.17 performed using carry-save addition.

Carry-Save Addition of Summands Figure 6.19. Schematic representation of the carry-save addition operations in Figure 6.18.

Carry-Save Addition of Summands When the number of summands is large, the time saved is proportionally much greater. Some omitted issues: Sign-extension Computation width of the final CLA/RCA Bit-pair recoding