CSE 246: Computer Arithmetic Algorithms and Hardware Design Instructor: Prof. Chung-Kuan Cheng Winter 2004 Lecture 10 Thursday 02/19/02.

Slides:



Advertisements
Similar presentations
Kuliah Rangkaian Digital Kuliah 7: Unit Aritmatika
Advertisements

Spring 2013 Advising Starts this week! CS2710 Computer Organization1.
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 
Topics covered: Floating point arithmetic CSE243: Introduction to Computer Architecture and Hardware/Software Interface.
ECIV 201 Computational Methods for Civil Engineers Richard P. Ray, Ph.D., P.E. Error Analysis.
1 Lecture 9: Floating Point Today’s topics:  Division  IEEE 754 representations  FP arithmetic Reminder: assignment 4 will be posted later today.
CSE 246: Computer Arithmetic Algorithms and Hardware Design Instructor: Prof. Chung-Kuan Cheng Lecture 5.
EE 382 Processor DesignWinter 98/99Michael Flynn 1 AT Arithmetic Most concern has gone into creating fast implementation of (especially) FP Arith. Under.
1 CSE1301 Computer Programming Lecture 30: Real Number Representation.
CSE1301 Computer Programming Lecture 33: Real Number Representation
CSE 246: Computer Arithmetic Algorithms and Hardware Design Instructor: Prof. Chung-Kuan Cheng Winter 2004 Lecture 4.
Copyright 2008 Koren ECE666/Koren Part.9b.1 Israel Koren Spring 2008 UNIVERSITY OF MASSACHUSETTS Dept. of Electrical & Computer Engineering Digital Computer.
CSE 246: Computer Arithmetic Algorithms and Hardware Design Instructor: Prof. Chung-Kuan Cheng Fall 2006 Lecture 11 Cordic, Log, Square, Exponential Functions.
CSE 246: Computer Arithmetic Algorithms and Hardware Design Instructor: Prof. Chung-Kuan Cheng Fall 2006 Lecture 10 Floating Point Number Rounding, Polynomial.
1 Combined LNS Adder/Subtractors for DCT Hardware Jie Ruan & Mark G. Arnold.
CSE 246: Computer Arithmetic Algorithms and Hardware Design Instructor: Prof. Chung-Kuan Cheng Winter 2004 Lecture 9.
CSE 246: Computer Arithmetic Algorithms and Hardware Design Instructor: Prof. Chung-Kuan Cheng Fall 2006 Lecture 9: Floating Point Numbers.
CSE 378 Floating-point1 How to represent real numbers In decimal scientific notation –sign –fraction –base (i.e., 10) to some power Most of the time, usual.
CSE 246: Computer Arithmetic Algorithms and Hardware Design Instructor: Prof. Chung-Kuan Cheng Lecture 4.
CSE 246: Computer Arithmetic Algorithms and Hardware Design Instructor: Prof. Chung-Kuan Cheng Fall 2006 Lecture 8: Division.
1 ECE369 Chapter 3. 2 ECE369 Multiplication More complicated than addition –Accomplished via shifting and addition More time and more area.
CSE 246: Computer Arithmetic Algorithms and Hardware Design Instructor: Prof. Chung-Kuan Cheng Winter 2004 Lecture 8.
CSE 246: Computer Arithmetic Algorithms and Hardware Design Instructor: Prof. Chung-Kuan Cheng Winter 2004 Lecture 7.
1 Lecture 4: Arithmetic for Computers (Part 4) CS 447 Jason Bakos.
Computer Arithmetic Integers: signed / unsigned (can overflow) Fixed point (can overflow) Floating point (can overflow, underflow) (Boolean / Character)
Ch. 21. Square-rootingSlide 1 VI Function Evaluation Topics in This Part Chapter 21 Square-Rooting Methods Chapter 22 The CORDIC Algorithms Chapter 23.
3-1 Chapter 3 - Arithmetic Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring Computer Architecture.
MA/CSSE 473 Day 03 Asymptotics A Closer Look at Arithmetic With another student, try to write a precise, formal definition of “t(n) is in O(g(n))”
Chapter 1 Scientific Computing Approximation in Scientific Computing (1.2) January 12, 2010.
Calculating with Significant Figures
CPS3340 COMPUTER ARCHITECTURE Fall Semester, /14/2013 Lecture 16: Floating Point Instructor: Ashraf Yaseen DEPARTMENT OF MATH & COMPUTER SCIENCE.
07/19/2005 Arithmetic / Logic Unit – ALU Design Presentation F CSE : Introduction to Computer Architecture Slides by Gojko Babić.
Computer Arithmetic II Instructor: Mozafar Bag-Mohammadi Spring 2006 University of Ilam.
Digital Kommunikationselektronik TNE027 Lecture 2 1 FA x n –1 c n c n1- y n1– s n1– FA x 1 c 2 y 1 s 1 c 1 x 0 y 0 s 0 c 0 MSB positionLSB position Ripple-Carry.
BINARY SHIFT Multiplication and Division. Binary Shift  As you know a computer can only add, not subtract. For the same token it can still only add,
Computer Arithmetic II Instructor: Mozafar Bag-Mohammadi Ilam University.
Lecture 12: Integer Arithmetic and Floating Point CS 2011 Fall 2014, Dr. Rozier.
Algebraic Operations. Goals Add and subtract algebraic expressions and simplify like terms by applying commutative, associative, and distributive properties.
Lecture notes Reading: Section 3.4, 3.5, 3.6 Multiplication
IT253: Computer Organization
Floating Point Numbers Representation, Operations, and Accuracy CS223 Digital Design.
CSE 246: Computer Arithmetic Algorithms and Hardware Design Instructor: Prof. Chung-Kuan Cheng Fall 2006 Lecture 7 Division.
CS 232: Computer Architecture II Prof. Laxmikant (Sanjay) Kale Floating point arithmetic.
Adding and Subtracting Polynomials Section 7.1. Bellwork.
CompSci Today’s topics Computer Hardware Electric Circuits Designing an Adder Upcoming Computer Communications ( Great Ideas Chapter 10) Reading.
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.
CH.3 Floating Point Hardware and Algorithms 3/10/
Lecture 6: Floating Point Number Representation Information Representation: Floating Point Number Representation Lecture # 7.
ELEC692 VLSI Signal Processing Architecture Lecture 12 Numerical Strength Reduction.
Addition and multiplication1 Arithmetic is the most basic thing you can do with a computer, but it’s not as easy as you might expect! These next few lectures.
Computer Architecture & Operations I
7-1 Multiplication Properties of Exponents
Morgan Kaufmann Publishers
Floating Point Operations
CS 232: Computer Architecture II
Chapter 6 Floating Point
Arithmetic for Computers
Outline Introduction Floating Point Arithmetic Adder Multiplier.
CSE 575 Computer Arithmetic Spring 2003 Mary Jane Irwin (www. cse. psu
ECE/CS 552: Floating Point
Adding Subtracting Multiplying Polynomials
CSCI206 - Computer Organization & Programming
Computer Organization and Design
How to represent real numbers
How to represent real numbers
Topic 6: Bitwise Instructions
Warm-Up Add or subtract. 1) (5x2 + 4x + 2) + (-2x + 7 – 3x2)
ECE 352 Digital System Fundamentals
CSE 140: Computer Arithmetic Algorithms and Hardware Design
Presentation transcript:

CSE 246: Computer Arithmetic Algorithms and Hardware Design Instructor: Prof. Chung-Kuan Cheng Winter 2004 Lecture 10 Thursday 02/19/02

CSE 2462 Topics:  Rounding F.P. Numbers  Ch. 11 (all)

CSE 2463 Rounding the numbers Why we need the Sticky bit Round bit Guard bit

CSE 2464 Example x x2 -3 Normalize according to exponent x x x2 4 Renormalize x2 3 Result = x2 3 Take 5 bits after decimal Round bit Sticky Bit

CSE 2465 Example x x2 -1 Normalize according to exponent x x x2 3 Renormalize x2 2 Result = x2 2 Take 5 bits after decimal Round bit Bit on the boundary Non-zero => round-up

CSE 2466 Theory behind it gr round guard Other bits OR Sticky bit  When shifting right, don ’ t need to remember anything more than 3 bits below This is a necessary and sufficient condition  The most we ever normalize is by just 1 bit after a subtraction, since all numbers are exponent- normalized before the operation

CSE 2467 Chapter 11  Polynomial Approximation of Functions

CSE 2468 Taylor Series f(x) = f(x 0 ) + Example: sin(x) = x – x^3/3! + x^5/5! – x^7/7!+ …

CSE 2469 Taylor Series Given: P N (x) = = c 0 +x(c 1 +x(c 2 + … +x(c N-1 +xc N ))))) R(N) =c N R(i-1) =c i-1 +xR(i) … P N (X) =R(0) How to calculate value of function? Group common factors …. N multiples and adds Recursively

CSE Taylor Series  1 adder => do it in series  Given more components => can we go faster?  Take N = 7 as example c 7 x 7 +c 6 x 6 +c 5 x 5 +c 4 x 4 +c 3 x 3 +c 2 x 2 +c 1 x 1 +c 0 How to accelerate?

CSE Taylor Series c 7 x 7 +c 6 x 6 +c 5 x 5 +c 4 x 4 +c 3 x 3 +c 2 x 2 +c 1 x 1 +c 0 But this is not much better. Still have overhead of 3 stages to generate x^7 + x x xxxx x Carry-save =constant time Log n x x2x2 x3x3 x4x4 x5x5 x6x6 x7x7

CSE Taylor Series c 7 x +c 6 c 5 x +c 4 x c 3 x +c 2 c 1 x +c 0 x 2( c 7 x +c 6 )+c 5 x +c 4 x x 2 (c 3 x +c 2 )+ c 1 x +c 0 x 4 [x 2( c 7 x +c 6 )+c 5 x +c 4 x]+x 2 (c 3 x +c 2 )+c 1 x +c 0 This is a bit faster. Only 2 stages But what is fastest way to produce result? & energy efficient? => minimize[# of multiplies] All this uses + ’ s and x ’ s. Need to get rid of them. => Let ’ s to try table look-up x x2x2 x4x4

CSE Taylor Series – Table look-up SRAM/DRAM => eat power ROM => better option f(x) = Suppose there is a table as a binary tree. Let x = x H + x L x 0 = x H Example X = x H = f(x H + x L ) = x L =

CSE Taylor Series – Table look-up 1 st order f(x H + x L ) ~= => Only 1 multiplication !!! x Table-1 Table-2 x + f(x H + x L ) xHxH xLxL f(x H ) f’(x H )

CSE Taylor Series  With extra order => 1 Extra table and 1 multiplier  If you wish to change the function, all you have to do is just change the content of the table  Problem? => Now it ’ s the size of the table! L / 2^L

CSE Taylor Series  Let ’ s reduce X into 3 sections (instead of the previous 2 (High and Low) ) x = x 1 +x 2 2 -k +x k => f( x) = f( x 1 +x 2 2 -k )+ x k + f ’ ( x 1 ) + Epsilon E ~= 2 -3k f(x) requires a 2 n x V n table 2 n : # of bits of x V n : # bits of f(x) 32bit x => 2^32 x 2^32 = 2^64 bits -> HUGE!! -> but do we really need all those # ’ s in the table??

CSE Taylor Series Let E = epsilon, [] = Lower limit x*y = (x+y)^2 / 4 – (x-y)^2 / 4 = ( [(x+y)/2] + E/2 )^2 - ( [(x-y)/2] + E/2 )^2 = [ (x+y)/2 ] ^ 2 - [ (x-y)/2 ] ^ 2 - E * y ……… x Content of lower bits determines lower bits of result, but not other bits !! ……… x^2 Table

CSE Taylor Series  2^n x V vs.2^n x (v-w ) + 2^L x w 2^n x v – (2^n x w - 2^L x w ) 2^n x v – w (2^n - 2^L ) Size of table is reduced by 2^n x v n /x v /f(x) 2^n x (v-w) n /x v-w / 2^L x w L / w / f(x)

CSE End of Ch. 11  Some parts of Ch. 11 (e.g. log ) will be covered part of Ch. 12 discussion