Example 1 (P46) What’s the binary form of x=2/3

Slides:



Advertisements
Similar presentations
التصميم المنطقي Second Course
Advertisements

INTEGERS.FDECIMALS.F DIGITS WHICH ARE RELEVANT IN AN INTEGER OR A DECIMAL.
1 CSE1301 Computer Programming Lecture 30: Real Number Representation.
Chapter 2 – Combinational Logic Circuits Part 1 – Gate Circuits and Boolean Equations Logic and Computer Design Fundamentals.
CSE1301 Computer Programming Lecture 33: Real Number Representation
Dr Damian Conway Room 132 Building 26
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.
Introduction to Computing CPSC 203 January 24, 2006 Heejin Lim Chapter 1 Chapter 2 (part of)
Chapter Chapter Goals Know the different types of numbers Describe positional notation.
1 Error Analysis Part 1 The Basics. 2 Key Concepts Analytical vs. numerical Methods Representation of floating-point numbers Concept of significant digits.
Chapter 02 Binary Values and Number Systems Nell Dale & John Lewis.
28/06/041 CSE-221 Digital Logic Design (DLD) Lecture-5: Canonical and Standard forms and Integrated Circuites.
Combinational Digital Circuits. Measurement Our world is an analog world. Measurements that we make of the physical objects around us are never in discrete.
Put two and two together to get 100 And still be right!!!
2.2 Errors. Why Study Errors First? Nearly all our modeling is done on digital computers (aside: what would a non-digital analog computer look like?)
Binary Real Numbers. Introduction Computers must be able to represent real numbers (numbers w/ fractions) Two different ways:  Fixed-point  Floating-point.
Chapter 1 Scientific Computing Approximation in Scientific Computing (1.2) January 12, 2010.
Chapter 1 Data Storage(3) Yonsei University 1 st Semester, 2015 Sanghyun Park.
MATH 685/CSI 700 Lecture Notes Lecture 1. Intro to Scientific Computing.
Introduction to Numerical Analysis I
5.2 Errrors. Why Study Errors First? Nearly all our modeling is done on digital computers (aside: what would a non-digital analog computer look like?)
Round-off Errors.
Chapter 2 Binary Values and Number Systems. 2 2 Natural Numbers Zero and any number obtained by repeatedly adding one to it. Examples: 100, 0, 45645,
Binary! Why do computers use binary? Easy to detect the state of a switch – they’re either on or off! Using another base makes.
Round-off Errors and Computer Arithmetic. The arithmetic performed by a calculator or computer is different from the arithmetic in algebra and calculus.
1 EG 32 Digital Electronics Thought for the day You learn from your mistakes..... So make as many as you can and you will eventually know everything.
Chapter 2 Number Systems: Decimal, Binary, and Hex.
Significant Figures Always record data as accurately as you can (as many sig. figs. as method allows) The last digit of the value that you record should.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Chapter 3.
IEEE Arithmetic UC Berkeley Fall 2004, E77 Copyright 2005, Andy Packard. This work is licensed under the Creative.
Universal college of engineering & technology. .By Harsh Patel)
Chapter 2 Binary Values and Number Systems Chapter Goals Distinguish among categories of numbers Describe positional notation Convert numbers in.
Rounding (Decimal Places) Round each number to the given number of decimal places.
Binary Numbers Computer Science 2. Why Binary Numbers? Early computers were analog –Numbers were stored as an intensity –E.g. 2.7 volts was 27, 3.4 volts.
Arithmetic in Binary. Addition A “Rule of Addition” is a statement of the form: = 8 How many such rules are there in Decimal?
Sources of Computational Errors FLP approximates exact computation with real numbers Two sources of errors to understand and counteract: 1. Representation.
Computer Studies Today Chapter 19 1 Chapter 19. Computer Studies Today Chapter 19 2 »Information stored in a computer is in two states: –ON –OFF.
Numerical Analysis CC413 Propagation of Errors. 2 In numerical methods, the calculations are not made with exact numbers. How do these inaccuracies propagate.
Binary Values. Numbers Natural Numbers Zero and any number obtained by repeatedly adding one to it. Examples: 100, 0, 45645, 32 Negative Numbers.
Binary Numbers. Decimal vs Binary = 1001 = 101 = 10 1 = on = 0 = off = On and off.
Introduction to Numerical Analysis I MATH/CMPSC 455 Loss of Significance.
WHAT IS BINARY? Binary is a number system that only uses two digits: 1 and 0. Any information that processed by a computer it is put into sequence of.
Introduction to Numerical Analysis I
Machine arithmetic and associated errors Introduction to error analysis Class II.
Programmable Logic Controller
Speaker: Fuw-Yi Yang 楊伏夷 伏夷非征番, 道德經 察政章(Chapter 58) 伏者潛藏也
Lecture 4 Nand, Nor Gates, CS147 Circuit Minimization and
Gate Circuits and Boolean Equations
CS 232: Computer Architecture II
Computer Architecture CST 250
Algorithms with numbers (1) CISC4080, Computer Algorithms
Chapter 2 ERROR ANALYSIS
Recall our hypothetical computer Marc-32
Systems Architecture I
Number Systems Base 2, 10, 16.
Floating Point Representation
Approximations and Round-Off Errors Chapter 3
The Distance Formula     Understand horizontal/vertical distance in a coordinate system as absolute value of the difference between coordinates;
Adders and Subtractors
Binary Numbers The Binary number system is derived from Base 2. In base 2 there are only 2 numerical options 0 and 1. The computer sees these as Off.
Numerical Analysis Lecture 2.
Systems Architecture I
Mathematical Preliminaries
Chapter 2: Floating point number systems and Round-off error
Space groups Start w/ 2s and 21s 222.
Chapter 1 / Error in Numerical Method
Binary.
靜夜思 床前明月光, 疑是地上霜。 舉頭望明月, 低頭思故鄉。 ~ 李白 李商隱.
Errors and Error Analysis Lecture 2
The Distance Formula     Understand horizontal/vertical distance in a coordinate system as absolute value of the difference between coordinates;
Presentation transcript:

Example 1 (P46) What’s the binary form of x=2/3 Example 1 (P46) What’s the binary form of x=2/3? What are two nearby machine numbers x- and x+ in the Marc-32? Which one is taken to be fl(x)? What are the absolute roundoff error and relative roundoff error in representing x by fl(x)?

 

Stored as machine numbers fl(a),fl(b),… Rounded off (舍入) Input numbers a,b,c,… Normalized (标准化) Stored as machine numbers fl(a),fl(b),… Rounded off (舍入) Do one arithmetic operation/calculation Obtain a number (result) e.g. fl(a)fl(b)

   

The computer with 5 decimal digits stores those results in rounded form as   The relative errors are respectively    

The computer with 5 decimal digits stores those results in rounded form as   The relative errors are respectively    

Denote  one of the four basic arithmetic operations:   ,  Assume x,y are machine numbers, then there is some constant  s.t. fl(xy) = [xy] (1+) where ||; here,  can be taken to be the unit roundoff error for the machine. In Marc-32, =2-24. Q: How to compute xy if x,y are not machine numbers?

If x,y are not machine numbers, then there is still some constant  s.t. fl(x) = x (1+1) fl(y) = y (1+2) fl(xy) = fl(fl(x)fl(y)) = (fl(x)fl(y)) (1+3) = [(x(1+1))  (y(1+2))](1+3) = (xy)(1+1+2+12) (1+3)  xy where |1|,|2|,|3|; still,  can be taken to be the unit roundoff error for the machine.

Q: How about compand arithmetic operations? Assume x,y,z  A={machine numbers of Marc-32}. fl(x(y+z)) = = [x fl(y+z)] (1+1) |1| 2-24 = [x (y+z) (1+2)] (1+1) |2| 2-24 = x (y+z) (1+2+1 +12)  x (y+z) (1+2+1) = x (y+z) (1+3) |3| ? Here 3=2+1

Find fl(x(y+z)) for x, y, z  A={machine numbers of Marc-32}.

Theorem on Relative Roundoff Error in Adding

Theorem on Relative Roundoff Error in Adding