CPS3340 - Computer Architecture Assignment 4: Multiplication, Division, Floating Point.

Slides:



Advertisements
Similar presentations
Spring 2013 Advising Starts this week! CS2710 Computer Organization1.
Advertisements

Lecture 11 Oct 12 Circuits for floating-point operations addition multiplication division (only sketchy)
Computer Organization CS224 Fall 2012 Lesson 19. Floating-Point Example  What number is represented by the single-precision float …00 
Computer Engineering FloatingPoint page 1 Floating Point Number system corresponding to the decimal notation 1,837 * 10 significand exponent A great number.
Lecture 16: Computer Arithmetic Today’s topic –Floating point numbers –IEEE 754 representations –FP arithmetic Reminder –HW 4 due Monday 1.
Princess Sumaya Univ. Computer Engineering Dept. Chapter 3:
Princess Sumaya Univ. Computer Engineering Dept. Chapter 3: IT Students.
Datorteknik FloatingPoint bild 1 Floating point Number system corresponding to the decimal notation 1,837 * 10 significand exponent a great number of corresponding.
Floating Point Numbers
Faculty of Computer Science © 2006 CMPUT 229 Floating Point Representation Operating with Real Numbers.
COMP3221: Microprocessors and Embedded Systems Lecture 14: Floating Point Numbers Lecturer: Hui Wu Session 2, 2004.
1 Lecture 9: Floating Point Today’s topics:  Division  IEEE 754 representations  FP arithmetic Reminder: assignment 4 will be posted later today.
CS 447 – Computer Architecture Lecture 3 Computer Arithmetic (2)
Computer ArchitectureFall 2007 © September 5, 2007 Karem Sakallah CS 447 – Computer Architecture.
CMPE12cCyrus Bazeghi 1 What do floating-point numbers represent? Rational numbers with non-repeating expansions in the given base within the specified.
Solutions and Examples 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)#
COE 308: Computer Architecture (T032) Dr. Marwan Abu-Amara Integer & Floating-Point Arithmetic (cont.) (Appendix A, Computer Architecture: A Quantitative.
Integer Arithmetic Floating Point Representation Floating Point Arithmetic Topics.
Floating Point Numbers
COMPUTER ARCHITECTURE & OPERATIONS I Instructor: Hao Ji.
COE 308: Computer Architecture (T041) Dr. Marwan Abu-Amara Integer & Floating-Point Arithmetic (Appendix A, Computer Architecture: A Quantitative Approach,
ECEN 248 Integer Multiplication, Number Format Adopted from Copyright 2002 David H. Albonesi and the University of Rochester.
Computer ArchitectureFall 2008 © August 27, CS 447 – Computer Architecture Lecture 4 Computer Arithmetic (2)
1 CS37: Computer Architecture Spring Term, 2005 Instructor: Kate Forbes-Riley
Computer Science 210 Computer Organization Floating Point Representation.
ECE232: Hardware Organization and Design
1/8/ L24 IEEE Floating Point Basics Copyright Joanne DeGroat, ECE, OSU1 IEEE Floating Point The IEEE Floating Point Standard and execution.
S. Rawat I.I.T. Kanpur. Floating-point representation IEEE numbers are stored using a kind of scientific notation. ± mantissa * 2 exponent We can represent.
Floating Point (a brief look) We need a way to represent –numbers with fractions, e.g., –very small numbers, e.g., –very large numbers,
CPS3340 COMPUTER ARCHITECTURE Fall Semester, /14/2013 Lecture 16: Floating Point Instructor: Ashraf Yaseen DEPARTMENT OF MATH & COMPUTER SCIENCE.
Lecture 9: Floating Point
Floating Point Representation for non-integral numbers – Including very small and very large numbers Like scientific notation – –2.34 × –
Lecture 12: Integer Arithmetic and Floating Point CS 2011 Fall 2014, Dr. Rozier.
Integer & Floating Point Representations CDA 3101 Discussion Session 05.
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.
1 Number Systems Lecture 10 Digital Design and Computer Architecture Harris & Harris Morgan Kaufmann / Elsevier, 2007.
Princess Sumaya Univ. Computer Engineering Dept. Chapter 3:
Floating-Point Representation We can store integers and characters easily in binary, but what about fractions? ¼ =.25 = 2.5 * *
Lecture notes Reading: Section 3.4, 3.5, 3.6 Multiplication
Computer Engineering FloatingPoint page 1 Floating Point Number system corresponding to the decimal notation 1,837 * 10 significand exponent A great number.
Chapter 3 Arithmetic for Computers. Chapter 3 — Arithmetic for Computers — 2 Arithmetic for Computers Operations on integers Addition and subtraction.
Floating Point Numbers Representation, Operations, and Accuracy CS223 Digital Design.
CS 232: Computer Architecture II Prof. Laxmikant (Sanjay) Kale Floating point arithmetic.
King Fahd University of Petroleum and Minerals King Fahd University of Petroleum and Minerals Computer Engineering Department Computer Engineering Department.
COMPUTER ORGANIZATION ARITHMETIC YASSER MOHAMMAD.
Floating Point Representations
Morgan Kaufmann Publishers Arithmetic for Computers
Floating Point Representations
Computer Architecture & Operations I
Morgan Kaufmann Publishers Arithmetic for Computers
Floating Point Operations
Floating Point Number system corresponding to the decimal notation
CS 232: Computer Architecture II
Expressible Numbers.
CS/COE0447 Computer Organization & Assembly Language
Arithmetic for Computers
Outline Introduction Floating Point Arithmetic Adder Multiplier.
CSCI206 - Computer Organization & Programming
Floating Point Arithmetic
Computer Arithmetic Multiplication, Floating Point
ECEG-3202 Computer Architecture and Organization
Morgan Kaufmann Publishers Arithmetic for Computers
GCSE COMPUTER SCIENCE Topic 3 - Data 3.3 Logical and Arithmetic Shifts.
Floating Point Arithmetic
Lecture 9: Shift, Mult, Div Fixed & Floating Point
Presentation transcript:

CPS Computer Architecture Assignment 4: Multiplication, Division, Floating Point

A = 50, B = 11, A*B = IterationStepMultiplier (Mr)Multiplicand (Md)Product (P) 0Initial Values  P=P+Md Shift Left Md Shift Right Mr  P=P+ Md Shift Left Md Shift Right Mr  No Op Shift Left Md Shift Right Mr  P=P+ Md Shift Left Md Shift Right Mr  No Op Shift Left Md Shift Right Mr  No Op Shift Left Md Shift Right Mr

A = 50, B = 11, A/B = IterationStepQuotient (Q)Divisor (D)Remainder (R) 0Initial Values R=R-D R<0  +D, sll Q, Q 0 = Shift Right D R=R-D R<0  +D, sll Q, Q 0 = Shift Right D R=R-D R<0  +D, sll Q, Q 0 = Shift Right D R=R-D R<0  +D, sll Q, Q 0 = Shift Right D R=R-D R>=0  sll Q, Q 0 = Shift Right D R=R-D R<0  +D, sll Q, Q 0 = Shift Right D R=R-D R<0  +D, sll Q, Q 0 = Shift Right D

IEEE 754 single precision format x 10^0 = x 2^0 Normalization : move binary point 5 to the left x 2^5 S = 0 (positive) Fraction = Exponent = = 132 = Final bit pattern: x 10^0 = x 2^0 normalize, move binary point 17 to the left x 2^17 sign = positive, S=0 Fraction: exp = = 144 Final bit pattern:

IEEE 754 double precision format x 10^0 = x 2^0 normalize, move binary point 5 to the left x 2^5 sign = positive, exp = = 1028 Final bit pattern: x 10^0 = x 2^0 normalize, move binary point 17 to the left x 2^17 sign = positive, exp = = 1040 Final bit pattern:

Binary to FP S = 1 Fraction = …00 2 Exponent = = 125 x = (–1) 1 × ( ) × 2 (125 – 127) = (–1) × × 2 -2 = –

FP Multiplication A=0.75, B= , A*B = 0.11*2 0 X * *2 -1 X *2 3 (normalize) 1.Add exponents: -1+3=2 2.Multiply significands × = Normalize result & check for over/underflow × 2 2 (no change) 4.Round and renormalize if necessary × 2 2 (no change) 5.Determine sign: +value × –value  –ve – × 2 2 = – x 2 0 = –

8D ) What decimal number does the bit pattern represent if it is an integer? = ) What decimal number does the bit pattern represent if it is an unsigned integer? ) If the bit pattern is in an instruction register, what MIPS instruction will be executed? lw $t0, 8($t1)

4) What decimal number does the bit pattern represent if it is a floating point number? Use the IEEE 754 standard S = 1 Fraction = 01010… Exponent = = 26 x = (–1) 1 × ( … ) × 2 (26 – 127) = –1 × ( ) × = – / /2 2 1/2 4 1/2 20