Digital Design for Multiplication

Similar documents
Digital Logic Design. Basics Combinational Circuits Sequential Circuits. Pu-Jen Cheng

Binary Adders: Half Adders and Full Adders

exclusive-or and Binary Adder R eouven Elbaz reouven@uwaterloo.ca Office room: DC3576

CHAPTER 3 Boolean Algebra and Digital Logic

FORDHAM UNIVERSITY CISC Dept. of Computer and Info. Science Spring, The Binary Adder

RN-coding of Numbers: New Insights and Some Applications

Gates, Circuits, and Boolean Algebra

Implementation of Modified Booth Algorithm (Radix 4) and its Comparison with Booth Algorithm (Radix-2)

Introduction. The Quine-McCluskey Method Handout 5 January 21, CSEE E6861y Prof. Steven Nowick

3.Basic Gate Combinations

BOOLEAN ALGEBRA & LOGIC GATES

Adder.PPT(10/1/2009) 5.1. Lecture 13. Adder Circuits

Chapter 4 Register Transfer and Microoperations. Section 4.1 Register Transfer Language

Logic in Computer Science: Logic Gates

RN-Codings: New Insights and Some Applications

To convert an arbitrary power of 2 into its English equivalent, remember the rules of exponential arithmetic:

Systems I: Computer Organization and Architecture

COMP 250 Fall 2012 lecture 2 binary representations Sept. 11, 2012

DEPARTMENT OF INFORMATION TECHNLOGY

Circuit Analysis using the Node and Mesh Methods

Computer Science 281 Binary and Hexadecimal Review

CSE140 Homework #7 - Solution

2.0 Chapter Overview. 2.1 Boolean Algebra

POLYNOMIAL FUNCTIONS

Let s put together a Manual Processor

Lab 1: Full Adder 0.0

DIGITAL-TO-ANALOGUE AND ANALOGUE-TO-DIGITAL CONVERSION

United States Naval Academy Electrical and Computer Engineering Department. EC262 Exam 1

COMBINATIONAL CIRCUITS

Karnaugh Maps & Combinational Logic Design. ECE 152A Winter 2012

Section 10.4 Vectors

BINARY CODED DECIMAL: B.C.D.

Systems I: Computer Organization and Architecture

Greatest Common Factor and Least Common Multiple

FORDHAM UNIVERSITY CISC Dept. of Computer and Info. Science Spring, Lab 2. The Full-Adder

Lecture 5: Gate Logic Logic Optimization

C H A P T E R. Logic Circuits

2x + y = 3. Since the second equation is precisely the same as the first equation, it is enough to find x and y satisfying the system

CSEE 3827: Fundamentals of Computer Systems. Standard Forms and Simplification with Karnaugh Maps

Partial Fractions. Combining fractions over a common denominator is a familiar operation from algebra:

NEW adder cells are useful for designing larger circuits despite increase in transistor count by four per cell.

Operation Count; Numerical Linear Algebra

Multiplying and Dividing Algebraic Fractions

Take-Home Exercise. z y x. Erik Jonsson School of Engineering and Computer Science. The University of Texas at Dallas

Factoring Whole Numbers

Section 1.1 Linear Equations: Slope and Equations of Lines

earlier in the semester: The Full adder above adds two bits and the output is at the end. So if we do this eight times, we would have an 8-bit adder.

Section 1.5 Exponents, Square Roots, and the Order of Operations

FRACTIONS OPERATIONS

CD4008BM CD4008BC 4-Bit Full Adder

CS 61C: Great Ideas in Computer Architecture Finite State Machines. Machine Interpreta4on

Karnaugh Maps. Circuit-wise, this leads to a minimal two-level implementation

Current California Math Standards Balanced Equations

=

CSE140: Midterm 1 Solution and Rubric

4/1/2017. PS. Sequences and Series FROM 9.2 AND 9.3 IN THE BOOK AS WELL AS FROM OTHER SOURCES. TODAY IS NATIONAL MANATEE APPRECIATION DAY

An Efficient RNS to Binary Converter Using the Moduli Set {2n + 1, 2n, 2n 1}

INTEGRATED CIRCUITS. For a complete data sheet, please also download:

Flip-Flops, Registers, Counters, and a Simple Processor

Chapter 07: Instruction Level Parallelism VLIW, Vector, Array and Multithreaded Processors. Lesson 05: Array Processors

VHDL Test Bench Tutorial

Boolean Algebra Part 1

6 Series Parallel Circuits

Digital Electronics Detailed Outline

The Point-Slope Form

Formal Languages and Automata Theory - Regular Expressions and Finite Automata -

Quotient Rings and Field Extensions

Using Logic to Design Computer Components

CS101 Lecture 26: Low Level Programming. John Magee 30 July 2013 Some material copyright Jones and Bartlett. Overview/Questions

1-bit Full Adder. Adders. The expressions for the sum and carry lead to the following unified implementation:

Mathematical Induction

MC14008B. 4-Bit Full Adder

Gates & Boolean Algebra. Boolean Operators. Combinational Logic. Introduction

Guide to Leaving Certificate Mathematics Ordinary Level

DERIVATIVES AS MATRICES; CHAIN RULE

Determine If An Equation Represents a Function

Discrete Mathematics and Probability Theory Fall 2009 Satish Rao, David Tse Note 10

Understanding Logic Design

EXCEL SOLVER TUTORIAL

Multipliers. Introduction


Figure 8-1 Four Possible Results of Adding Two Bits

ECE410 Design Project Spring 2008 Design and Characterization of a CMOS 8-bit Microprocessor Data Path

General Framework for an Iterative Solution of Ax b. Jacobi s Method

CS311 Lecture: Sequential Circuits

Circuits and Boolean Expressions

Series and Parallel Resistive Circuits

Welcome to Basic Math Skills!

December 4, 2013 MATH 171 BASIC LINEAR ALGEBRA B. KITCHENS

INTERSECTION MATH And more! James Tanton

Unit 1 Number Sense. In this unit, students will study repeating decimals, percents, fractions, decimals, and proportions.

Session 29 Scientific Notation and Laws of Exponents. If you have ever taken a Chemistry class, you may have encountered the following numbers:

Basic Logic Gates Richard E. Haskell

Lecture 12: More on Registers, Multiplexers, Decoders, Comparators and Wot- Nots

Automata and Computability. Solutions to Exercises

for the Bill Hanlon

6.3 Conditional Probability and Independence

Divide: Paper & Pencil. Computer Architecture ALU Design : Division and Floating Point. Divide algorithm. DIVIDE HARDWARE Version 1

Sistemas Digitais I LESI - 2º ano

3 Some Integer Functions

Transcription:

Digital Design for Multiplication Norman Matloff October 15, 2003 c 2003, N.S. Matloff 1 Overview A cottage industry exists in developing fast digital logic to perform arithmetic computations. Fast addition, for example, can be accomplished via carry lookahead adders. Multiplication, which presents much more of a challenge than addition, is our focus here. A plethora of different digital algorithms for multiplication have been developed. As a sampling of them, we present two such methods here. 2 Example Consider for example the multiplication of two 4-bit strings using the pencil and paper" method: x1101 0000 -- 10001111 The four rows 0000 are called partial products. To sum them, we could use three 8-bit adders. The first adder would compute +0000-0 1

and the second adder would compute + - 100001 (The inputs to these adders would simply copy or 0000 to the appropriate places.) The third adder would compute the sum of the outputs of the first two adders. The first two additions would be done simultaneously with each other. If we using registers or some other method, we could even dispense with the third adder, reusing the first adder for the third addition. If we wish to multiply two 8-bit strings, we would have eight rows of partial products, and would again sum them simultaneously in pairs, using four adders. We would then have four sums, and would break them into two pairs to be summed, etc. In general, to multiply two n-bit strings, we would have an O(log 2 n)-stage process. This, however, would be slow, even using carry lookahead adders, and even accounting for the fact that we are doing a number of things in parallel. So, how can we speed up the process? 3 Direct Simultaneous Computation This method is similar to the idea of carry lookahead. In the latter, we anticipate the carries, instead of waiting for them to propagate. The same is true here. Instead of waiting for sums and carries, we use a formula which will allow us to compute things ahead of time. We could actually try to derive a formula, as in the case of carry lookahead, but it is easier simply to write down the truth table and then simplify the sum-of-products expression implied by the table, using Karnaugh or other methods. 1 Here is how to do it for 2-bit strings. Denote the multiplicand, multiplier and product by (A 1, A 0 ), (B 1, B 0 ) and (P 3, P 2, P 1, P 0 ), respectively. Then the truth table is shown in Table 1. For example, the row in Table 2 corresponds to 3 2 = 6. Now remember, the P i here are the output functions, each of which will need to be implemented in digital logic. We can see, for instance, that P 2 = A 1 Ā 0 B 1 B0 + A 1 Ā 0 B 1 B 0 + A 1 A 0 B 1 B0 Table 3 shows the corresponding Karnaugh map. From that, you can see that the simplification for P 2 is P 2 = A 1 B 1 B0 + A 1 Ā 0 B 1 The complete set of simplified expressions for the product bits is 1 Our example here will be small enough to be able to use Karnaugh, but for larger bit strings we would need to use more advanced circuit simplification methods. 2

A 1 A 0 B 1 B 0 P 3 P 2 P 1 P 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 1 0 0 0 1 0 1 1 0 0 0 1 0 0 1 1 1 0 0 1 1 1 0 0 0 0 0 0 0 1 0 0 1 0 0 1 0 1 0 1 0 0 1 0 0 1 0 1 1 0 1 1 0 1 1 0 0 0 0 0 0 1 1 0 1 0 0 1 1 1 1 1 0 0 1 1 0 1 1 1 1 1 0 0 1 Table 1: Truth Table for 2-Bit Multiplication 1 1 1 0 0 1 1 0 Table 2: Table Entry for 3 2 = 6 B 1, B 0 A 1, A 0 00 01 11 10 00 0 0 0 0 01 0 0 0 0 11 0 0 0 1 10 0 0 1 1 Table 3: Karnaugh Map for P 2 3

P 0 = A 0 B 0, P 1 = Ā1A 0 B 1 + A 1 A 0 B0 + A 1 B1 B 0 + A 1 Ā 0 B 0, P 2 = A 1 B 1 B0 + A 1 Ā 0 B 1, P 3 = A 1 A 0 B 1 B 0 4 The Carry-Save Method In the example in Section 2, one problem is that we were only adding two partial products at a time. One way to speed things up would be to add three partial products or at least three items of some kind at a time. This is the goal of the carry-save method of multiplication. 2 Where will we get an adder capable of adding three summands? Actually, we already have one, in the form of Full Adder (FA) components. If you recall, an FA has three inputs, rather than two: It not only has inputs for the two bits to be added together, but also a third input which is meant for the carry-in from the previous bit. Then as long as we can deal with carries in some alternative way, we can use the carry-in input for our third summand. Then for example we could use a block of eight FAs as a device for summing three summands as long as we find some way to deal with carries, since we re using the carry-in inputs for one of the summands instead of for carries. Well, then, how do we handle the carries? The answer is to postpone adding them. To see how this is done, consider the following example, done using the ordinary pencil and paper way: 11 0111 10001 where the 11 row consists of carries. Now, here is another way to do it, in which we generate carries but postpone using them: 0111 1101 bitwise sums 0010 bitwise carries 10001 Note the line labeled bitwise carries. In it, each bit shows the carry that would result from the addition of the two bits in the previous bit position. For example, the rightmost 0 in the 0010 bitwise carries string above is the carry from the rightmost bit position in the original sum, as seen underscored by asterisks: 2 It can also be used for addition. 4

0111 0010 bitwise carries Similarly, the 1 in the bitwise carries string is the carry resulting from the second-to-the-right bit position, as underscored with carats. Now, how do we make use of this carry postponement? To see how, think of multiplying two 6-bit strings. That produces six partial products, which we will call Partial1, Partial2,..., Partial6. Since we want to make use of our ability to add groups of three terms, we will alway add three terms at a time in the following steps: add together Partial1, Partial2 and Partial3, resulting in a sum we will call Sum1 and a carry string called Carry1 add Partial4, Partial5 and Partial6, producing Sum2 and Carry2 add Sum1, Carry1 and Sum2, producing Sum3 and Carry3 add Carry2, Sum3 and Carry3, producing Sum4 and Carry4 add Sum4 and Carry4 using conventional techniques Clearly, the order used here is not unique. Also, various steps can be taken to get the best performance; e.g. as much parallel computation as possible should be done. 5