Integer Multiplication and DivisionICS 233 – KFUPM © Muhamed Mudawar slide 1 Multiplicand and HI are sign-extended  Sign is the sign of the result Signed.

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.
Arithmetic Intro Computer Organization 1 Computer Science Dept Va Tech February 2008 © McQuain Algorithm for Integer Division The natural (by-hand)
Integer division Pencil and paper binary division (dividend)(divisor) 1000.
Division CPSC 321 Computer Architecture Andreas Klappenecker.
Lecture 15: Computer Arithmetic Today’s topic –Division 1.
CMPT 334 Computer Organization Chapter 3 Arithmetic for Computers [Adapted from Computer Organization and Design 5 th Edition, Patterson & Hennessy, ©
Lecture Objectives: 1)Perform binary division of two numbers. 2)Define dividend, divisor, quotient, and remainder. 3)Explain how division is accomplished.
Princess Sumaya Univ. Computer Engineering Dept. Chapter 3:
Princess Sumaya Univ. Computer Engineering Dept. Chapter 3: IT Students.
CML CML CS 230: Computer Organization and Assembly Language Aviral Shrivastava Department of Computer Science and Engineering School of Computing and Informatics.
CMP 101 Fundamentals of Computer and programming in C Rohit Khokher.
Chapter 3 Arithmetic for Computers. Multiplication More complicated than addition accomplished via shifting and addition More time and more area Let's.
361 div.1 Computer Architecture ECE 361 Lecture 7: ALU Design : Division.
Arithmetic IV CPSC 321 Andreas Klappenecker. Any Questions?
Integer Multiplication and Division ICS 233 Computer Architecture and Assembly Language Dr. Aiman El-Maleh College of Computer Sciences and Engineering.
Computer Organization Multiplication and Division Feb 2005 Reading: Portions of these slides are derived from: Textbook figures © 1998 Morgan Kaufmann.
Integer Multiplication and Division
1 Lecture 8: Binary Multiplication & Division Today’s topics:  Addition/Subtraction  Multiplication  Division Reminder: get started early on assignment.
DIGITAL SYSTEMS TCE1111 Representation and Arithmetic Operations with Signed Numbers Week 6 and 7 (Lecture 1 of 2)
1 Arithmetic and Logical Operations - Part II. Unsigned Numbers Addition in unsigned numbers is the same regardless of the base. Given a pair of bit sequences.
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
Chapter 3 Arithmetic for Computers (Integers). Florida A & M University - Department of Computer and Information Sciences Arithmetic for Computers Operations.
Conversion to Larger Number of Bits Ex: Immediate Field (signed 16 bit) to 32 bit Positive numbers have implied 0’s to the left. So, put 16 bit number.
Cs 152 l6 Multiply 1 DAP Fa 97 © U.C.B. ECE Computer Architecture Lecture Notes Multiply, Shift, Divide Shantanu Dutt Univ. of Illinois at.
Princess Sumaya Univ. Computer Engineering Dept. Chapter 3:
05/03/2009CA&O Lecture 8,9,10 By Engr. Umbreen sabir1 Computer Arithmetic Computer Engineering Department.
Integer Multiplication and Division
Lecture notes Reading: Section 3.4, 3.5, 3.6 Multiplication
Integer Multiplication and Division ICS 233 Computer Architecture and Assembly Language Dr. Aiman El-Maleh College of Computer Sciences and Engineering.
Csci 136 Computer Architecture II – Multiplication and Division
Mohamed Younis CMCS 411, Computer Architecture 1 CMSC Computer Architecture Lecture 11 Performing Division March 5,
EI 209 Chapter 3.1CSE, 2015 EI 209 Computer Organization Fall 2015 Chapter 3: Arithmetic for Computers Haojin Zhu ( )
Division Check for 0 divisor Long division approach – If divisor ≤ dividend bits 1 bit in quotient, subtract – Otherwise 0 bit in quotient, bring down.
ECE/CS 552: Integer Dividers
CDA 3101 Spring 2016 Introduction to Computer Organization
Division Quotient Divisor Dividend – – Remainder.
Lab 7. Given: Two’s complement integer A single precision floating-point.
Integer Multiplication and Division COE 301 Computer Organization Dr. Muhamed Mudawar College of Computer Sciences and Engineering King Fahd University.
Integer Operations Computer Organization and Assembly Language: Module 5.
Integer Multiplication and Division ICS 233 Computer Architecture & Assembly Language Prof. Muhamed Mudawar College of Computer Sciences and Engineering.
1 Lecture 5Multiplication and Division ECE 0142 Computer Organization.
More Binary Arithmetic - Multiplication
Computer Architecture & Operations I
Multiplication and Division basics
Computer Architecture & Operations I
Integer Multiplication and Division
MIPS mul/div instructions
CSCI206 - Computer Organization & Programming
Morgan Kaufmann Publishers
Lecture 8: Binary Multiplication & Division
Multiplication & Division
CDA 3101 Summer 2007 Introduction to Computer Organization
Lecture 8: Addition, Multiplication & Division
King Fahd University of Petroleum and Minerals
Lecture 8: Addition, Multiplication & Division
CSCI206 - Computer Organization & Programming
Topic 3c Integer Multiply and Divide
Computer Organization and Design
Logical Operations Boy who sow wild oats better hope for crop failure.
مظفر بگ محمدی دانشگاه ایلام
October 15 Chapter 4 – Multiplication/Division Go to the State Fair!
Logical Operations Boy who sow wild oats better hope for crop failure.
1 Lecture 5Multiplication and Division ECE 0142 Computer Organization.
Presentation transcript:

Integer Multiplication and DivisionICS 233 – KFUPM © Muhamed Mudawar slide 1 Multiplicand and HI are sign-extended  Sign is the sign of the result Signed Multiplication Hardware = 0 Start LO[0]? First 31 iterations: HI = HI + Multiplicand Last iteration: HI = HI – Multiplicand 32 nd Repetition? Done = 1 No Yes LO=Multiplier, HI=0 Shift Right Product = (HI, LO) 1 bit 32-bit ALU Control 64 bits 32 bits write add, sub LO[0] Multiplicand shift right 32 bits HILO 32 bits sign

Integer Multiplication and DivisionICS 233 – KFUPM © Muhamed Mudawar slide 2 Signed Multiplication Example  Consider: (-4) × (-3), Product =  Multiplicand and HI are sign-extended before addition  Last iteration: add 2's complement of Multiplicand Shift Product = (HI, LO) right 1 bit LO[0] = 0 => Do Nothing Shift Product = (HI, LO) right 1 bit Shift Product = (HI, LO) right 1 bit Shift Product = (HI, LO) right 1 bit Initialize (LO = Multiplier) MultiplicandProduct = HI, LOSignIteration LO[0] = 1 => ADD LO[0] = 1 => ADD LO[0] = 1 => SUB (ADD 2's compl) +

Integer Multiplication and DivisionICS 233 – KFUPM © Muhamed Mudawar slide 3 Division Hardware  Observation:  Shifting remainder left does the same as shifting the divisor right  Initialize:  Quotient = Dividend, Remainder = 0 Start Difference? 2.Remainder = Difference Set least significant bit of Quotient 32 nd Repetition? Done < 0≥ 0 No Yes 1.Shift (Remainder, Quotient) Left Difference = Remainder – Divisor shift left Divisor 32-bit ALU Quotient 32 bits write sub 32 bits Difference sign set lsb Remainder 32 bits Control

Integer Multiplication and DivisionICS 233 – KFUPM © Muhamed Mudawar slide 4 2: Diff Do Nothing Division Example  Example: / (4-bit dividend & divisor)  Quotient = and Remainder =  4-bit registers for Remainder and Divisor (4-bit ALU) 2: Rem = Diff, set lsb Quotient : Diff Do Nothing Initialize RemainderDifferenceQuotientIteration Divisor : SLL, Difference : SLL, Difference : SLL, Difference : SLL, Difference