Division and Modulo 15 Q A = Dividend B = Divisor Q = Quotient = A/B

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
Table 7.1 Verilog Operators.
4.1 Friendly Numbers SRB 22.
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,
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.
Remainder and Factor Theorems
Division Algorithms By: Jessica Nastasi.
361 div.1 Computer Architecture ECE 361 Lecture 7: ALU Design : Division.
1 Lecture 8: Binary Multiplication & Division Today’s topics:  Addition/Subtraction  Multiplication  Division Reminder: get started early on assignment.
Addition Subtraction Multiplication Division
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.
Multiplication of signed-operands
Lesson 5-4 Example Example 2 Find 14 ÷ 4. Show the remainder. 1.Rewrite the problem in vertical format.
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.
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.
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,
4.3 The Remainder and Factor Theorems Objective: Find the factors of polynomials using the Remainder and Factor Theorems.
Warm up Objective: To divide polynomials Lesson 6-7 Polynomial Long Division.
COE 308: Computer Architecture (T032) Dr. Marwan Abu-Amara Integer & Floating-Point Arithmetic (Appendix A, Computer Architecture: A Quantitative Approach,
Department of Communication Engineering, NCTU 1 Unit 4 Arithmetic and Logic Units.
Warm Up Multiply: (2x + 1)(x – 3) What is the end behavior of this polynomial? What are the zeros of this polynomial?
CDA 3101 Spring 2016 Introduction to Computer Organization
Division Quotient Divisor Dividend – – Remainder.
Integer Operations Computer Organization and Assembly Language: Module 5.
Logarithms Common Logarithms Integer Logarithms Negative Logarithms Log of a Product Log of a Quotient Log of an Exponential Natural Logarithms.
1 Lecture 5Multiplication and Division ECE 0142 Computer Organization.
Overview Logistics Last lecture Today HW5 due today
Computer System Design Lecture 3
More Binary Arithmetic - Multiplication
Dividing Polynomials A review of long division:
Multiplication and Division basics
Warm-up 6-4.
MIPS mul/div instructions
Part II : Lecture III By Wannarat.
Dividing Polynomials Long Division A little review:
Aim: How do we divide a polynomial by a binomial?
Arithmetic and Logic Units
CDA 3101 Summer 2007 Introduction to Computer Organization
Digital Systems Section 14 Registers. Digital Systems Section 14 Registers.
Behavioral Modeling in Verilog
Standard Algorithm By: Ally, Zoey, and Maha.
Division of Whole Numbers
CSCI206 - Computer Organization & Programming
Topic 3c Integer Multiply and Divide
Unit 1. Day 7..
DIVISION AS SHARING.
Computation in Other Bases
Polynomial Long Division
Addition Subtraction Multiplication Division
More Maths Programming Guides.
Dividison & Overflow Given a dividend X and a divisor D, generate a quotient Q and a remainder R X = Q  D + R (with R  D-1) X = Q  D + R  Q 
October 15 Chapter 4 – Multiplication/Division Go to the State Fair!
Register-Transfer Level Components in Verilog
divide dividend divisor inverse operations quotient
October 5 Register to vote! Go to the State Fair! (15-24 October)
Division Opposite of multiplication.
Dividing Integers ÷ = + ÷ = + ÷ = + ÷ =.
Division with Remainders
Keeper 11 Honors Algebra II
Chapter 1 Whole Numbers.
1 Lecture 5Multiplication and Division ECE 0142 Computer Organization.
Presentation transcript:

Division and Modulo 15 Q A = Dividend B = Divisor Q = Quotient = A/B R = Remainder B 9 140 A 9 50 45 5 R Unsigned, integer division R = A mod B Shift-Subtract Algorithm Dividend shifts left each step Subtract if B is less than Dividend so far

Divider/Modulo (Div/Mod) Component 1001 10001100 00001111 10001 10000 1110 101 Shift-Subtract algorithm If Divisor is less that Dividend Subtract Assign Quotient bit to 1

Hints on Verilog Implementation Behavioral verilog not Structural verilog Don’t use assign statements, just always and initial blocks Multi-bit values will be defined as vectors (A, B, etc.) Inputs and outputs (A, B, Q, R) are wires by default Cannot assign values to inputs, should not read values from outputs Outputs should only be assigned once in a block Should use registers inside the behavior, not wires << is shift left and >> is shift right You can use a for loop