October 5 Register to vote! Go to the State Fair! (15-24 October)

Slides:



Advertisements
Similar presentations
Multiplication and Division
Advertisements

Datorteknik IntegerMulDiv bild 1 MIPS mul/div instructions Multiply: mult $2,$3Hi, Lo = $2 x $3;64-bit signed product Multiply unsigned: multu$2,$3Hi,
CMPE 325 Computer Architecture II
Cosc 2150: Computer Organization Chapter 9, Part 2 Integer multiplication and division.
Prof. John Nestor ECE Department Lafayette College Easton, Pennsylvania ECE Computer Organization Lecture 8 - Multiplication.
Number Systems & Operations
Integer division Pencil and paper binary division (dividend)(divisor) 1000.
THE ARITHMETIC-LOGIC UNIT. BINARY HALF-ADDER BINARY HALF-ADDER condt Half adder InputOutput XYSC
Division CPSC 321 Computer Architecture Andreas Klappenecker.
CMPT 334 Computer Organization Chapter 3 Arithmetic for Computers [Adapted from Computer Organization and Design 5 th Edition, Patterson & Hennessy, ©
CML CML CS 230: Computer Organization and Assembly Language Aviral Shrivastava Department of Computer Science and Engineering School of Computing and Informatics.
Integer Multiplication and DivisionICS 233 – KFUPM © Muhamed Mudawar slide 1 Multiplicand and HI are sign-extended  Sign is the sign of the result Signed.
L10 – Multiplication Division 1 Comp 411 – Fall /19/2009 Binary Multipliers ×
Computer Organization Multiplication and Division Feb 2005 Reading: Portions of these slides are derived from: Textbook figures © 1998 Morgan Kaufmann.
EECC341 - Shaaban #1 Lec # 3 Winter Binary Multiplication Multiplication is achieved by adding a list of shifted multiplicands according.
CSE 246: Computer Arithmetic Algorithms and Hardware Design Instructor: Prof. Chung-Kuan Cheng Winter 2004 Lecture 7.
DIGITAL SYSTEMS TCE1111 Representation and Arithmetic Operations with Signed Numbers Week 6 and 7 (Lecture 1 of 2)
1 Lecture 4: Arithmetic for Computers (Part 4) CS 447 Jason Bakos.
EXAMPLE 1 Use polynomial long division
ECE 4110– Sequential Logic Design
Copyright 1995 by Coherence LTD., all rights reserved (Revised: Oct 97 by Rafi Lohev, Oct 99 by Yair Wiseman, Sep 04 Oren Kapah) IBM י ב מ 10-1 The ALU.
King Fahd University of Petroleum and Minerals King Fahd University of Petroleum and Minerals Computer Engineering Department Computer Engineering Department.
Multiplication of signed-operands
Lecture 6: Multiply, Shift, and Divide
Ch 11.5 Dividing Polynomials
Csci 136 Computer Architecture II – Multiplication and Division
Mohamed Younis CMCS 411, Computer Architecture 1 CMSC Computer Architecture Lecture 11 Performing Division March 5,
Division. Just as multiplication can be expressed as a series of additions, division can be seen as a series of subtractions. 21 ÷ 7 asks how many times.
Division Check for 0 divisor Long division approach – If divisor ≤ dividend bits 1 bit in quotient, subtract – Otherwise 0 bit in quotient, bring down.
The Steps… 1.Divide2. Multiply 3. Subtract4. Bring Down And an easy way to remember them… D ad M om S ister B rother.
Warm-Up Divide 1.) 560 ÷ 8 = 2.) 105 ÷ 3 =. Essential question: What are the steps to divide whole numbers? Name date period Long Division Quotient: The.
Division Quotient Divisor Dividend – – Remainder.
Integer Operations Computer Organization and Assembly Language: Module 5.
Multipliers. More complicated than addition accomplished via shifting and addition More time and more area Multiplication What should be the length of.
1 Lecture 5Multiplication and Division ECE 0142 Computer Organization.
Week 1(Number System) Muhammad Ammad uddin Logic Design Lab I (CEN211)
Computer System Design Lecture 3
More Binary Arithmetic - Multiplication
Computer Architecture & Operations I
Interesting Integers – Part Dos
Multiplication and Division basics
Computer Architecture & Operations I
MIPS mul/div instructions
CHAPTER 1 INTRODUCTION NUMBER SYSTEMS AND CONVERSION
Part II : Lecture III By Wannarat.
Division with Remainders
Morgan Kaufmann Publishers
Long Division With 2 Digit Divisor
Lecture 8: Binary Multiplication & Division
Multiplication & Division
King Fahd University of Petroleum and Minerals
CSCI206 - Computer Organization & Programming
Topic 3c Integer Multiply and Divide
Computer Organization and Design
DIVISION AS SHARING.
Partial Quotients Help Students build on multiplies of ten and find easy multiples of the divisor.
Computation in Other Bases
ECEG-3202 Computer Architecture and Organization
Multiplication More complicated than addition
مظفر بگ محمدی دانشگاه ایلام
Reading: Study Chapter (including Booth coding)
October 15 Chapter 4 – Multiplication/Division Go to the State Fair!
Partial Quotients Help Students build on multiplies of ten and find easy multiples of the divisor.
Montek Singh Mon, Mar 28, 2011 Lecture 11
Number Lines.
divide dividend divisor inverse operations quotient
Division of Real Numbers
1 Lecture 5Multiplication and Division ECE 0142 Computer Organization.
Long Division.
Presentation transcript:

October 5 Register to vote! Go to the State Fair! (15-24 October) Help with a user study! (Peter Parente parente@cs.unc.edu) How many struggling with Assignment 5,6,7? Questions? Chapter 4 – Multiplication/Division 10/5/2004 Comp 120 Fall 2004

Multiplication Facts N digit number TIMES a M digit number produces: ? 32 bit number TIMES a 32 bit number produces: ? an (N+M) digit number a 64 bit number 123 x 45 615 492 5535 101 x 11 1111 10/5/2004 Comp 120 Fall 2004

Multiplication: Implementation S t a r t D o n e 1 . T s t M u l i p r a A d m c h P g 2 S f b 3 M u l t i p l i e r = 1 M u l t i p l i e r = t N o : < 3 2 r e p e t i t i o n s 3 2 n d r e p e t i t i o n ? Y e s : 3 2 r e p e t i t i o n s 10/5/2004 Comp 120 Fall 2004

Second Version 10/5/2004 Comp 120 Fall 2004 S t a r t M u l t i p l i . T s t M u l i p r a A d m c h f P g 2 S b 3 3 2 b i t s M u l t i p l i e r = 1 M u l t i p l i e r = M u l t i p l i e r 3 2 - b i t A L U S h i f t r i g h t 3 2 b i t s S h i f t r i g h t P r o d u c t C o n t r o l t e s t W r i t e 6 4 b i t s i f t t h e M u l t i p l i e r r e g i s t e r r i g h t 1 b i t N o : < 3 2 r e p e t i t i o n s 3 2 n d r e p e t i t i o n ? Y e s : 3 2 r e p e t i t i o n s 10/5/2004 Comp 120 Fall 2004

Example for second version 0010 1100 0001 0110 0010 0001 0000 Test true shift right 4 0001 1000 0000 1100 0010 0001 Test false shift right 3 0011 0000 0001 1000 0101 0010 2 0010 0000 0001 0000 1011 0101 1 0000 0000 1011 Initial Product Multiplicand Multiplier Step Iteration 10/5/2004 Comp 120 Fall 2004

Final Version S t a r t D o n e 1 . T s t P r d u c a A m l i p h f g 2 S b 3 M u l t i p l i c a n d 3 2 b i t s P r o d u c t = 1 P r o d u c t = 3 2 - b i t A L U S h i f t r i g h t C o n t r o l P r o d u c t W r i t e t e s t 6 4 b i t s The trick is to use the lower half of the product to hold the multiplier during the operation. N o : < 3 2 r e p e t i t i o n s e p e t i t i o n ? Y e s : 3 2 r e p e t i t i o n s 10/5/2004 Comp 120 Fall 2004

What about the sign? Positive numbers are easy. How about negative numbers? 10/5/2004 Comp 120 Fall 2004

Faster Multiply See Booth coding in the book. A1 & B A0 & B A2 & B P32-P63 P2 P1 P0 P31 10/5/2004 Comp 120 Fall 2004

Division Start 1. Subtract Divisor from the Remainder leave the result in the Remainder >=0 <0 Test Remainder Restore Remainder by adding Divisor Shift Quotient to the left set its rightmost bit = 0 Shift Quotient to the left set its rightmost bit = 1 Shift Divisor Register right 1 bit Repeat 33 times 10/5/2004 Comp 120 Fall 2004