Arithmetic Intro Computer Organization 1 Computer Science Dept Va Tech February 2008 ©2006-08 McQuain Algorithm for Integer Division The natural (by-hand)

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

Mod arithmetic.
Multiplication and Division
4.1 Friendly Numbers SRB 22.
Iterative Integer Division Techniques Shantanu Dutt UIC.
Division Circuits Jan 2013 Shmuel Wimer Bar Ilan University, Engineering Faculty Technion, EE Faculty 1.
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.
Example 1 Dividing Integers Same sign, so quotient is positive. 5 = a. 8 – 40 – b. 14 – 2 = 7 – Different signs, so quotient is negative. c. 9 – 36 = 4.
CMP 101 Fundamentals of Computer and programming in C Rohit Khokher.
Integer Multiplication and DivisionICS 233 – KFUPM © Muhamed Mudawar slide 1 Multiplicand and HI are sign-extended  Sign is the sign of the result Signed.
361 div.1 Computer Architecture ECE 361 Lecture 7: ALU Design : Division.
Integer Multiplication and Division
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.
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)
division algorithm Before we study divisibility, we must remember the division algorithm. r dividend = (divisor ⋅ quotient) + remainder.
EXAMPLE 1 Use polynomial long division
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.
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.
WIKIPEDIA HAS MANY MORE DIVISIBILITY RULES. EXAMPLE Since 52=13(4) is divisible by 4, is divisible by 4 Since 452=56(8)+4 is not divisible.
Operators in Python. Arithmetic operators Some operators in Python will look familiar (+, -, *, /) Others are new to you (%, //, **) All of these do work.
16. Binary Numbers Programming in C++ Computer Science Dept Va Tech August, 1999 © Barnette ND, McQuain WD, Keenan MA 1 Binary Number System Base.
Ch 11.5 Dividing Polynomials
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.
Princess Sumaya Univ. Computer Engineering Dept. Chapter 3:
Integer Multiplication and Division
Lecture notes Reading: Section 3.4, 3.5, 3.6 Multiplication
IT253: Computer Organization
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,
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. Standards G4.1M.C2.PO4A. Use multiple strategies to divide whole numbers using 4-digit dividends and divisors from 1 to 12 with remainders.
ECE/CS 552: Integer Dividers
CDA 3101 Spring 2016 Introduction to Computer Organization
CSE 246: Computer Arithmetic Algorithms and Hardware Design Instructor: Prof. Chung-Kuan Cheng Fall 2006 Lecture 7 Division.
Division Quotient Divisor Dividend – – Remainder.
Arithmetic Intro Computer Organization 1 Computer Science Dept Va Tech February 2008 © McQuain Multiplication Design 1.0 Multiplicand Shift left.
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
Students will know that…
Negative Numbers.
Morgan Kaufmann Publishers
Morgan Kaufmann Publishers
Lecture 8: Binary Multiplication & Division
CDA 3101 Summer 2007 Introduction to Computer Organization
Lecture 8: Addition, Multiplication & Division
CSCI206 - Computer Organization & Programming
Topic 3c Integer Multiply and Divide
Unit 1. Day 7..
Computation in Other Bases
Math 801A: Mental Math – Multiplication and Division Strategies
October 15 Chapter 4 – Multiplication/Division Go to the State Fair!
Division and Modulo 15 Q A = Dividend B = Divisor Q = Quotient = A/B
divide dividend divisor inverse operations quotient
GCSE COMPUTER SCIENCE Topic 3 - Data 3.3 Logical and Arithmetic Shifts.
Radix –Two Division Most complex of the four arithmetic operations (addition, subtraction, multiplication and division). Requires the most in terms of.
Presentation transcript:

Arithmetic Intro Computer Organization 1 Computer Science Dept Va Tech February 2008 © McQuain Algorithm for Integer Division The natural (by-hand) algorithm for integer division is essentially an iterated subtract-and-shift. Recall that mathematics says: or: where:

Arithmetic Intro Computer Organization 2 Computer Science Dept Va Tech February 2008 © McQuain Division Illustrated 15 divided by 6: | ^^^^ 0000 < 0110 no go ^^^ ^ 0001 < 0110 no go ^^ ^^ 0011 < 0110 no go ^ ^^^ 0111 >= 0110 OK, set quotient bit and subtract ^^^^ 0011 < 0110 no go, and done divisor remainder quotient * # negative, retract, shift # negative, retract, shift # negative, retract, shift # OK, keep remainder, shift # negative, retract, shift

Arithmetic Intro Computer Organization 3 Computer Science Dept Va Tech February 2008 © McQuain Division Design 1.0 Divisor Shift right 64-bit ALU 64 bits Remainder Write 64 bits Quotient Shift left Control test 32 bits Look familiar??

Arithmetic Intro Computer Organization 4 Computer Science Dept Va Tech February 2008 © McQuain Division Design 2.0 Just as with multiplication, we can optimize the hardware to eliminate most of the 64-bit components used in the first design. Divisor 32-bit ALU Remainder Write Shift right Control test 32 bits 64 bits Shift left