CSCI206 - Computer Organization & Programming

Slides:



Advertisements
Similar presentations
Division & Divisibility. a divides b if a is not zero there is a m such that a.m = b a is a factor of b b is a multiple of a a|b Division.
Advertisements

Multiplication and Division
Cosc 2150: Computer Organization Chapter 9, Part 2 Integer multiplication and division.
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.
Remainder and Factor Theorems
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.
4-8 Example 2 Divide. Multiply to make the divisor a whole number.
Binary Addition Rules Adding Binary Numbers = = 1
Integer Multiplication and DivisionICS 233 – KFUPM © Muhamed Mudawar slide 1 Multiplicand and HI are sign-extended  Sign is the sign of the result Signed.
1 Lecture 8: Binary Multiplication & Division Today’s topics:  Addition/Subtraction  Multiplication  Division Reminder: get started early on assignment.
1 Lecture 4: Arithmetic for Computers (Part 5) CS 447 Jason Bakos.
DIGITAL SYSTEMS TCE1111 Representation and Arithmetic Operations with Signed Numbers Week 6 and 7 (Lecture 1 of 2)
division algorithm Before we study divisibility, we must remember the division algorithm. r dividend = (divisor ⋅ quotient) + remainder.
EXAMPLE 1 Use polynomial long division
Integer Conversion Between Decimal and Binary Bases Conversion of decimal to binary more complicated Task accomplished by –Repeated division of decimal.
Multiplication of signed-operands
When dividing a decimal by a whole number, place the decimal point in the quotient directly above the decimal point in the dividend. Then divide as you.
L4-3 Notes: Dividing Decimals by Whole Numbers
Ch 11.5 Dividing Polynomials
5. Divide 4723 by 5. Long Division: Steps in Dividing Whole Numbers Example: 4716  5 STEPS 1. The dividend is The divisor is 5. Write.
Lecture notes Reading: Section 3.4, 3.5, 3.6 Multiplication
Dividing Decimals by a Whole Number 3.6 ÷ 3.
Partial Quotient Method In this division algorithm the children record on the right side of the problem. The first thing they do is divide. They ask themselves.
Csci 136 Computer Architecture II – Multiplication and Division
Mohamed Younis CMCS 411, Computer Architecture 1 CMSC Computer Architecture Lecture 11 Performing Division March 5,
Warm up Objective: To divide polynomials Lesson 6-7 Polynomial Long Division.
Addition, Subtraction, Multiplication, Division by a whole number, and Division by a decimal.
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.
Dividing Review SWBAT use division to find quotients; use divisibility rules to predict remainders; estimate quotients; divide whole numbers in thousand.
CDA 3101 Spring 2016 Introduction to Computer Organization
Division Quotient Divisor Dividend – – Remainder.
Integer Operations Computer Organization and Assembly Language: Module 5.
1 Lecture 5Multiplication and Division ECE 0142 Computer Organization.
More Binary Arithmetic - Multiplication
Computer Architecture & Operations I
Interesting Integers – Part Dos
Multiplication and Division basics
Warm-up 6-4.
Computer Architecture & Operations I
Lecture 9: Floating Point
CSCI206 - Computer Organization & Programming
Morgan Kaufmann Publishers
Long Division With 2 Digit Divisor
Lecture 8: Binary Multiplication & Division
CDA 3101 Summer 2007 Introduction to Computer Organization
Lecture 8: Addition, Multiplication & Division
Lecture 8: Addition, Multiplication & Division
Unit 1. Day 7..
Computer Organization and Design
DIVISION AS SHARING.
Computation in Other Bases
Unit 1. Day 8..
October 15 Chapter 4 – Multiplication/Division Go to the State Fair!
Short Division.
Multiplying and Dividing Integers
divide dividend divisor inverse operations quotient
October 5 Register to vote! Go to the State Fair! (15-24 October)
Division Opposite of multiplication.
Quotient: is the answer to dividing
Radix –Two Division Most complex of the four arithmetic operations (addition, subtraction, multiplication and division). Requires the most in terms of.
1 Lecture 5Multiplication and Division ECE 0142 Computer Organization.
Presentation transcript:

CSCI206 - Computer Organization & Programming Integer Divide zyBook: 10.4

Division: Similar to multiplication Algorithm: subtract and shift...

Signed Division Same as signed multiply divide absolute values resulting sign bit: Quotient and remainder have the same sign

The Divider Same hardware as multiply! Setup divisor in left half of divisor register (64 bit for now) remainder register initialized with dividend in right half e.g., 1001010 would occupy 0100 1010

The Divider

0111 / 0010 = ???? R ???? Example 1

0111 / 0010 = 0011 R 0001 2’s comp of 0010 0000 is 1110 0000 2’s comp of 0001 0000 is 1111 0000 2’s comp of 0000 1000 is 1111 1000 2’s comp of 0000 0100 is 1111 1100 2’s comp of 0000 0010 is 1111 1110

same as optimized multiply hardware Optimized Divider same as optimized multiply hardware Algorithm HI(Remainder) = 0 LO(Remainder) = Dividend repeat N times: Remainder <<= 1 HI(Remainder) -= Divisor if HI(Remainder) > 0 Remainder[0] = 1 else HI(Remainder) += Divisor Remainder[0] = 0

Example with optimized divider 2’s comp 0010 = 1110 Iteration Step Divisor Rem/Quotient Initial values 0010 0000 0111 1 Rem << 1 0000 1110 HI(Rem) -= Div 1110 1110 Rem < 0, Rem+Div, Rem[0] = 0 2 0001 1100 1111 1100 3 0011 1000 0001 1000 Rem >= 0, Rem[0] = 1 0001 1001 4 0011 0010 0001 0010 Rem>=0, Rem[0] = 1 0001 0011 The values in read are quotient, the left part of Rem is the remainder.

Compared with hand-operation in decimal numbers Remainder 00000 10970 10970 dividend Quotient ______ 23 |10970 _00476_ 23 |10970 -092 0177 -161 0160 138 22 00000 10970 00023 divisor 00001 09700 00476 00001 09700 quotient 00010 97000 00022 remainder 00010 97000 00109 70000 00017 70004 109-4*23=17 00177 00040 00016 00047 177-7*23=16 00160 00470 Quotient Remainder 00022 00476 160-6*23=22