Solutions and Examples. 2.36 or $t0, $zero, $zero# i = 0 li $t1, 101# $t1 = 101 for:beq $t0, $t1, exit# if (i==101) exit add $t2, $t0, $a1 lw $s1, 0($t2)#

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

4.1 Friendly Numbers SRB 22.
Arithmetic in Computers Chapter 4 Arithmetic in Computers2 Outline Data representation integers Unsigned integers Signed integers Floating-points.
Cosc 2150: Computer Organization Chapter 9, Part 2 Integer multiplication and division.
Dividing Polynomials.
÷ 2 0 = 1 0.
Integer division Pencil and paper binary division (dividend)(divisor) 1000.
5-4 Dividing Polynomials Long Division Today’s Objective: I can divide polynomials.
Division of Decimal Fractions. STEPS 1. Set up the divisor and dividend 2. Make the divisor a whole number my moving the decimal completely to the end.
Princess Sumaya Univ. Computer Engineering Dept. Chapter 3:
Princess Sumaya Univ. Computer Engineering Dept. Chapter 3: IT Students.
Binary Addition Rules Adding Binary Numbers = = 1
1 Lecture 9: Floating Point Today’s topics:  Division  IEEE 754 representations  FP arithmetic Reminder: assignment 4 will be posted later today.
Computer ArchitectureFall 2007 © September 5, 2007 Karem Sakallah CS 447 – Computer Architecture.
Integer Arithmetic Floating Point Representation Floating Point Arithmetic Topics.
1. Integer to ASCII string
COMPUTER ARCHITECTURE & OPERATIONS I Instructor: Hao Ji.
DIGITAL SYSTEMS TCE1111 Representation and Arithmetic Operations with Signed Numbers Week 6 and 7 (Lecture 1 of 2)
CPS Computer Architecture Assignment 4: Multiplication, Division, Floating Point.
division algorithm Before we study divisibility, we must remember the division algorithm. r dividend = (divisor ⋅ quotient) + remainder.
EXAMPLE 1 Use polynomial long division
Fractions Chapter Simplifying Fractions Restrictions Remember that you cannot divide by zero. You must restrict the variable by excluding any.
Chapter 6 Polynomial Functions and Inequalities. 6.1 Properties of Exponents Negative Exponents a -n = –Move the base with the negative exponent to the.
Chapter 2- Decimals.
Floating Point Representations CDA 3101 Discussion Session 02.
Multiplying and Dividing Polynomials Chapter 5 Sections
Dividing Polynomials  Depends on the situation.  Situation I: Polynomial Monomial  Solution is to divide each term in the numerator by the monomial.
Fixed and Floating Point Numbers Lesson 3 Ioan Despi.
Lesson 5-4 Example Example 2 Find 14 ÷ 4. Show the remainder. 1.Rewrite the problem in vertical format.
3.3: Dividing Polynomials: Remainder and Factor Theorems Long Division of Polynomials 1.Arrange the terms of both the dividend and the divisor in descending.
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:
Lecture notes Reading: Section 3.4, 3.5, 3.6 Multiplication
Dividing Decimals by a Whole Number 3.6 ÷ 3.
5.5: Apply Remainder and Factor Theorems (Dividing Polynomials) Learning Target: Learn to complete polynomial division using polynomial long division and.
Addition, Subtraction, Multiplication, Division by a whole number, and Division by a decimal.
CDA 3101 Spring 2016 Introduction to Computer Organization
5-4 Dividing Polynomials Synthetic Division
Lab 7. Given: Two’s complement integer A single precision floating-point.
Chapter 8 Computer Arithmetic. 8.1 Unsigned Notation Non-negative notation  It treats every number as either zero or a positive value  Range: 0 to 2.
By Wannarat Computer System Design Lecture 3 Wannarat Suntiamorntut.
Dividing Polynomials. Long Division of Polynomials Arrange the terms of both the dividend and the divisor in descending powers of any variable. Divide.
Multiply and Divide Fractions and Decimals. Mixed Numbers, Improper Fractions, and Reciprocals Mixed Number: A number made up of a fraction and a whole.
Quick Guide to Adding, Subtracting, Multiplying, and Dividing Decimals
Computer Arithmetic. Integer Representation Sign-magnitude representation ’s complement representation magnitudes
William Stallings Computer Organization and Architecture 8th Edition
More Binary Arithmetic - Multiplication
Computer Architecture & Operations I
Multiplication and Division basics
Lecture 9: Floating Point
Negative Numbers.
Morgan Kaufmann Publishers
With Remainder, Written Precisely!
Division Using “Lucky Seven”
DIVIDING POLYNOMIALS.
CDA 3101 Summer 2007 Introduction to Computer Organization
Decimal Operations.
Computation in Other Bases
ECEG-3202 Computer Architecture and Organization
#1 Dividing by a Whole Number
Unit 1. Day 8..
مظفر بگ محمدی دانشگاه ایلام
October 15 Chapter 4 – Multiplication/Division Go to the State Fair!
divide dividend divisor inverse operations quotient
Warm up.
Square Least number Add & Subtract.
Presentation transcript:

Solutions and Examples

2.36 or $t0, $zero, $zero# i = 0 li $t1, 101# $t1 = 101 for:beq $t0, $t1, exit# if (i==101) exit add $t2, $t0, $a1 lw $s1, 0($t2)# $s1=b[i] add $s1, $s1, $s0 # $s1=b[i]+c add $t2, $t0, $a0 sw $s1, 0($t2)# a[i]=$s1 addi $t0, $t0, 1# i=i+1 j for exit:

2.36 Number of instructions executed: *8 = 810 Memory data reference: 101 reads writes

3.27 Add & Sub (16 bits) x= # 91 y= # 13 a) addition x+y= # 104 b) subtraction -y= # 2’s complement x-y= # 78

3.27 Multiplication (16 bits) productmultiplier Init x* = Shift right x* = Shift right x* = Shift right x* = Shift right Final

3.27 Division (16 bits) remainder dividend & quotient Init –divisor = Restore Shift left –divisor = Restore Shift left Shift left –divisor = Restore

3.27 Division (cont’d) remainder dividend & quotient Shift left –divisor = Ok Shift left –divisor = Ok Shift left –divisor = Ok

3.42 Floating-point Addition X= ExponentFraction Y= ExponentFraction Srl: Srl: Srl: X+Y= IEEE:

3.42 FP Multiplication X= ExponentFraction Y= ExponentFraction X*Y= Exponent – = Fraction Normalize , exp= IEEE=