Computer Arithmetic. MATH 375 Numerical Analysis. J. Robert Buchanan. Fall Department of Mathematics. J. Robert Buchanan Computer Arithmetic

Size: px
Start display at page:

Download "Computer Arithmetic. MATH 375 Numerical Analysis. J. Robert Buchanan. Fall Department of Mathematics. J. Robert Buchanan Computer Arithmetic"

Transcription

1 Computer Arithmetic MATH 375 Numerical Analysis J. Robert Buchanan Department of Mathematics Fall 2013

2 Machine Numbers When performing arithmetic on a computer (laptop, desktop, mainframe, cell phone, etc.) we will primarily work with two types of numbers: Integers: whole numbers in a specified range. Floating point: approximations to real numbers.

3 2 s Complement Integers Suppose an integer is represented using n bits (e.g., n = 32) bits in 2 s complement format. Index the bits from right to left. Bit (2 31 ) If the ith bit is set, the quantity in the ith column is added.

4 Example (1 of 2) Sign x = = = 35

5 Example (2 of 2) Sign x = (2 31 ) = =

6 Range of Integers 1 What are the smallest and largest integers which can be represented in 32-bit 2 s complement format?

7 Range of Integers 1 What are the smallest and largest integers which can be represented in 32-bit 2 s complement format? min 32 = (2 31 ) = max 32 = 30 i=0 2 i =

8 Range of Integers 1 What are the smallest and largest integers which can be represented in 32-bit 2 s complement format? min 32 = (2 31 ) = max 32 = 30 i=0 2 i = What are the smallest and largest integers which can be represented in 64-bit 2 s complement format?

9 Range of Integers 1 What are the smallest and largest integers which can be represented in 32-bit 2 s complement format? min 32 = (2 31 ) = max 32 = 30 i=0 2 i = What are the smallest and largest integers which can be represented in 64-bit 2 s complement format? min 64 = (2 63 ) = max 64 = 62 i=0 2 i =

10 Floating Point Numbers Consider representing a real number like π in some binary format.

11 Floating Point Numbers Consider representing a real number like π in some binary format. π is transcendental (non-repeating, non-terminating decimal number)

12 Floating Point Numbers Consider representing a real number like π in some binary format. π is transcendental (non-repeating, non-terminating decimal number) In any finite number of binary digits, π can only be approximated by some rational number. There will be round-off error.

13 Floating Point Numbers Consider representing a real number like π in some binary format. π is transcendental (non-repeating, non-terminating decimal number) In any finite number of binary digits, π can only be approximated by some rational number. There will be round-off error. Round-off error will be present when representing any real number which is not a power of 2.

14 Binary Floating Point Format The Institute for Electrical and Electronic Engineers (IEEE) published the Binary Floating Point Arithmetic Standard which specified storage and transmission formats for floating point numbers and algorithms for rounding arithmetic operations. Consider the 64-bit representation. s: sign bit c: characteristic, 11-bit exponent with base 2, according to IEEE , 1 c 2046 always f : mantissa, 52-bit binary fraction x = ( 1) s 2 c 1023 (1 + f )

15 Example s c f This number is positive since ( 1) 0 = 1. c = = = 1029 [ ] 1 1 [ ] 1 4 [ ] 1 5 [ ] 1 6 [ ] 1 7 f = ( x = ( 1) ) = = [ ] 1 9 =

16 Interval of Real Numbers The previous example actually represents an interval of numbers. Consider the next smaller and next larger floating point numbers. s c f x s = x = x l =

17 Interval of Real Numbers The previous example actually represents an interval of numbers. Consider the next smaller and next larger floating point numbers. s c f x s = x = x l = Upon rounding x represents all real numbers in the interval [ , ).

18 Floating Point Limits Smallest, non-zero positive floating point number: Largest floating point number:

19 Floating Point Limits Smallest, non-zero positive floating point number: ɛ = ( 1) (1 + 0) Largest floating point number:

20 Floating Point Limits Smallest, non-zero positive floating point number: ɛ = ( 1) (1 + 0) Largest floating point number: = ( 1) ( )

21 Decimal (Base-10) Floating Point Numbers We will express floating point numbers in base-10 form for simplicity. If x is a non-zero real number, then x can be represented as ±0.d 1 d 2... d k 1 d k d k n where 1 d 1 9 and 0 d k 9 for k > 1.

22 Decimal (Base-10) Floating Point Numbers We will express floating point numbers in base-10 form for simplicity. If x is a non-zero real number, then x can be represented as ±0.d 1 d 2... d k 1 d k d k n where 1 d 1 9 and 0 d k 9 for k > 1. The k-digit decimal machine number corresponding to x will be denoted fl (x) and is determined by rounding. To round we may perform chopping by ignoring all the decimal digits beyond the k th, fl (0.d 1 d 2... d k 1 d k d k n ) = 0.d 1 d 2... d k 1 d k 10 n or we may perform rounding in the kth decimal place. fl (0.d 1 d 2... d k 1 d k d k n ) = 0.δ 1 δ 2... δ k 1 δ k 10 n

23 Example Example Determine the 5-digit representations for e using 1 chopping, 2 rounding.

24 Example Example Determine the 5-digit representations for e using e chopping, 2 rounding.

25 Example Example Determine the 5-digit representations for e using e chopping, fl (e) = rounding.

26 Example Example Determine the 5-digit representations for e using e chopping, fl (e) = rounding. fl (e) =

27 Approximation Errors Definition Suppose that ˆp is an approximation to p. The absolute error is p ˆp. p ˆp The relative error is provided p 0. p

28 Approximation Errors Definition Suppose that ˆp is an approximation to p. The absolute error is p ˆp. p ˆp The relative error is provided p 0. p Remark: the relative error is generally preferred as a measure of accuracy, since it takes into consideration, the magnitude of the number being approximated.

29 Example Example Determine the absolute and relative error present in each of the 5-digit approximations to e.

30 Example Example Determine the absolute and relative error present in each of the 5-digit approximations to e. Chopping ê = : e ê and Rounding ê = : e ê and e ê e e ê e

31 Significant Digits Definition The number ˆp is said to approximate p to t significant digits if t is the largest non-negative integer for which p ˆp p 5 10 t.

32 Example Suppose that ˆp agrees with p to 5 significant digits. p ˆp 0.01 ( , ) 0.1 ( , ) 1 ( , ) 10 (9.9995, ) 100 (99.995, ) 1000 (999.95, )

33 Chopping and Relative Error x fl (x) x = 0.d 1 d 2... d k 1 d k d k n 0.d 1 d 2... d k 1 d k 10 n 0.d 1 d 2... d k 1 d k d k n = 0.d k n k 0.d 1 d 2... d k 1 d k d k n = 0.d k d 1 d 2... d k 1 d k d k k k = 10 k+1

34 Machine Arithmetic The performance of basic arithmetic operations on a computing device also results in approximations. We will define the following machine arithmetic operations: x y = fl (fl (x) + fl (y)) x y = fl (fl (x) fl (y)) x y = fl (fl (x) fl (y)) x y = fl (fl (x) fl (y))

35 Example Using 5-digit chopping arithmetic with x = 2/3 and y = 3/7, compute the following quantities and the errors involved in their calculation. Operation Result Actual Abs. Err. Rel. Err. x y x y x y x y

36 Example Using 5-digit chopping arithmetic with x = 2/3 and y = 3/7, compute the following quantities and the errors involved in their calculation. Operation Result Actual Abs. Err. Rel. Err. x y x y x y x y

37 Example Using 5-digit chopping arithmetic with x = 2/3 and y = 3/7, compute the following quantities and the errors involved in their calculation. Operation Result Actual Abs. Err. Rel. Err. x y x y x y x y

38 Example Using 5-digit chopping arithmetic with x = 2/3 and y = 3/7, compute the following quantities and the errors involved in their calculation. Operation Result Actual Abs. Err. Rel. Err. x y x y x y x y

39 Example Using 5-digit chopping arithmetic with x = 2/3 and y = 3/7, compute the following quantities and the errors involved in their calculation. Operation Result Actual Abs. Err. Rel. Err. x y x y x y x y

40 Example Using 5-digit chopping arithmetic with x = 2/3 and y = 3/7, compute the following quantities and the errors involved in their calculation. Operation Result Actual Abs. Err. Rel. Err. x y x y x y x y Remark: the relative errors are small, so the machines results can be trusted in these cases.

41 Example Suppose y = 3/7, v = , and w = Using 5-digit chopping arithmetic compute the following results and the associated errors. Operation Result Actual Abs. Err. Rel. Err. y v (y v) w

42 Example Suppose y = 3/7, v = , and w = Using 5-digit chopping arithmetic compute the following results and the associated errors. Operation Result Actual Abs. Err. Rel. Err. y v (y v) w

43 Example Suppose y = 3/7, v = , and w = Using 5-digit chopping arithmetic compute the following results and the associated errors. Operation Result Actual Abs. Err. Rel. Err. y v (y v) w

44 Example Suppose y = 3/7, v = , and w = Using 5-digit chopping arithmetic compute the following results and the associated errors. Operation Result Actual Abs. Err. Rel. Err. y v (y v) w Remark: in this example the subtraction of nearly equal quantities leads to larger relative errors.

45 Subtraction of Nearly Equal Quantities Suppose x > y and the k-digit representations of x and y are respectively fl (x) = 0.d 1 d 2... d p a p+1 a p+2... a k 10 n fl (y) = 0.d 1 d 2... d p b p+1 b p+2... b k 10 n.

46 Subtraction of Nearly Equal Quantities Suppose x > y and the k-digit representations of x and y are respectively fl (x) = 0.d 1 d 2... d p a p+1 a p+2... a k 10 n fl (y) = 0.d 1 d 2... d p b p+1 b p+2... b k 10 n. Since the first p decimal digits of x and y are the same, then where x y = 0.c p+1 c p+2... c k 10 n p 0.c p+1 c p+2... c k = 0.a p+1 a p+2... a k 0.b p+1 b p+2... b k.

47 Subtraction of Nearly Equal Quantities Suppose x > y and the k-digit representations of x and y are respectively fl (x) = 0.d 1 d 2... d p a p+1 a p+2... a k 10 n fl (y) = 0.d 1 d 2... d p b p+1 b p+2... b k 10 n. Since the first p decimal digits of x and y are the same, then where x y = 0.c p+1 c p+2... c k 10 n p 0.c p+1 c p+2... c k = 0.a p+1 a p+2... a k 0.b p+1 b p+2... b k. Remark: the result x y has at most significance. digits of

48 Subtraction of Nearly Equal Quantities Suppose x > y and the k-digit representations of x and y are respectively fl (x) = 0.d 1 d 2... d p a p+1 a p+2... a k 10 n fl (y) = 0.d 1 d 2... d p b p+1 b p+2... b k 10 n. Since the first p decimal digits of x and y are the same, then where x y = 0.c p+1 c p+2... c k 10 n p 0.c p+1 c p+2... c k = 0.a p+1 a p+2... a k 0.b p+1 b p+2... b k. Remark: the result x y has at most k p digits of significance.

49 Subtraction of Nearly Equal Quantities Suppose x > y and the k-digit representations of x and y are respectively fl (x) = 0.d 1 d 2... d p a p+1 a p+2... a k 10 n fl (y) = 0.d 1 d 2... d p b p+1 b p+2... b k 10 n. Since the first p decimal digits of x and y are the same, then where x y = 0.c p+1 c p+2... c k 10 n p 0.c p+1 c p+2... c k = 0.a p+1 a p+2... a k 0.b p+1 b p+2... b k. Remark: the result x y has at most k p digits of significance. Any further calculations with x y will inherit only k p digits of significance.

50 Extended Example (1 of 5) Use 4-digit rounding arithmetic to solve the following quadratic equation. x x + 1 = 0

51 Extended Example (1 of 5) Use 4-digit rounding arithmetic to solve the following quadratic equation. x x + 1 = 0 If we solve the equation exactly we see that x and x

52 Extended Example (2 of 5) x 1 = b b 2 4ac 2a = b ( ) 2 ( )( )(0.10 2a = b a = b a = a = =

53 Extended Example (3 of 5) Absolute Error: = Relative Error: =

54 Extended Example (4 of 5) Suppose now we rationalize the quadratic formula so as to avoid the subtraction of nearly equal quantities. x 1 = b ( b 2 4ac b + ) b 2 4ac 2a b + b 2 4ac 2c = b + b 2 4ac = = =

55 Extended Example (5 of 5) Absolute Error: = 10 7 Relative Error: =

56 Re-arrangement of Calculations In addition to avoiding the subtraction of nearly equal results in calculations, it is generally a good idea to reduce the number of operations performed to obtain a desired result.

57 Re-arrangement of Calculations In addition to avoiding the subtraction of nearly equal results in calculations, it is generally a good idea to reduce the number of operations performed to obtain a desired result. Example Evaluate the polynomial p(x) = x 3 5.9x x at x = 7.14 using 3-digit arithmetic.

58 Re-arrangement of Calculations In addition to avoiding the subtraction of nearly equal results in calculations, it is generally a good idea to reduce the number of operations performed to obtain a desired result. Example Evaluate the polynomial p(x) = x 3 5.9x x at x = 7.14 using 3-digit arithmetic. For the sake of comparison, the exact value is p(7.14) =

59 Evaluation (1 of 2) Consider p(x) = x 3 5.9x x and intermediate results obtained using 3-digit chopping and 3-digit rounding arithmetic.

60 Evaluation (1 of 2) Consider p(x) = x 3 5.9x x and intermediate results obtained using 3-digit chopping and 3-digit rounding arithmetic. x x 2 x 3 5.9x 2 3.4x Chopping 0.714E E E E E02 Rounding 0.714E E E E E02

61 Evaluation (2 of 2) Chopping: Rounding: p(7.14) = Abs. Err. = = Rel. Err. = = p(7.14) = Abs. Err. = = Rel. Err. = =

62 Nested Polynomial Form We may reduce the number of arithmetic operations performed by re-writing the polynomial as p(x) = x 3 5.9x x = x (x(x 5.9) + 3.4)

63 Nested Polynomial Form We may reduce the number of arithmetic operations performed by re-writing the polynomial as p(x) = x 3 5.9x x = x (x(x 5.9) + 3.4) Evaluate p(7.14) using 3-digit chopping and rounding arithmetic.

64 Evaluation (Chopping) p(7.14) = 7.14 (7.14( ) + 3.4) = 7.14 (7.14(1.24) + 3.4) = 7.14( ) = 7.14(12.2) = = 89.8 Abs. Err. = = Rel. Err. = =

65 Evaluation (Rounding) p(7.14) = 7.14 (7.14( ) + 3.4) = 7.14 (7.14(1.24) + 3.4) = 7.14( ) = 7.14(12.3) = = 90.5 Abs. Err. = = Rel. Err. = =

66 Homework Read Section 1.2. Exercises: 1 5, 9, 11, 15, 17, 21, 24

Mathematical preliminaries and error analysis

Mathematical preliminaries and error analysis Mathematical preliminaries and error analysis Tsung-Ming Huang Department of Mathematics National Taiwan Normal University, Taiwan September 12, 2015 Outline 1 Round-off errors and computer arithmetic

More information

Notes for Chapter 1 of. Scientific Computing with Case Studies

Notes for Chapter 1 of. Scientific Computing with Case Studies Notes for Chapter 1 of Scientific Computing with Case Studies Dianne P. O Leary SIAM Press, 2008 Mathematical modeling Computer arithmetic Errors 1999-2008 Dianne P. O'Leary 1 Arithmetic and Error What

More information

Chapter 1: Introduction and mathematical preliminaries

Chapter 1: Introduction and mathematical preliminaries Chapter 1: Introduction and mathematical preliminaries Evy Kersalé September 26, 2011 Motivation Most of the mathematical problems you have encountered so far can be solved analytically. However, in real-life,

More information

Arithmetic and Error. How does error arise? How does error arise? Notes for Part 1 of CMSC 460

Arithmetic and Error. How does error arise? How does error arise? Notes for Part 1 of CMSC 460 Notes for Part 1 of CMSC 460 Dianne P. O Leary Preliminaries: Mathematical modeling Computer arithmetic Errors 1999-2006 Dianne P. O'Leary 1 Arithmetic and Error What we need to know about error: -- how

More information

Math 128A: Homework 2 Solutions

Math 128A: Homework 2 Solutions Math 128A: Homework 2 Solutions Due: June 28 1. In problems where high precision is not needed, the IEEE standard provides a specification for single precision numbers, which occupy 32 bits of storage.

More information

Floating Point Number Systems. Simon Fraser University Surrey Campus MACM 316 Spring 2005 Instructor: Ha Le

Floating Point Number Systems. Simon Fraser University Surrey Campus MACM 316 Spring 2005 Instructor: Ha Le Floating Point Number Systems Simon Fraser University Surrey Campus MACM 316 Spring 2005 Instructor: Ha Le 1 Overview Real number system Examples Absolute and relative errors Floating point numbers Roundoff

More information

How do computers represent numbers?

How do computers represent numbers? How do computers represent numbers? Tips & Tricks Week 1 Topics in Scientific Computing QMUL Semester A 2017/18 1/10 What does digital mean? The term DIGITAL refers to any device that operates on discrete

More information

Chapter 1 Mathematical Preliminaries and Error Analysis

Chapter 1 Mathematical Preliminaries and Error Analysis Chapter 1 Mathematical Preliminaries and Error Analysis Per-Olof Persson persson@berkeley.edu Department of Mathematics University of California, Berkeley Math 128A Numerical Analysis Limits and Continuity

More information

Interpolation and the Lagrange Polynomial

Interpolation and the Lagrange Polynomial Interpolation and the Lagrange Polynomial MATH 375 J. Robert Buchanan Department of Mathematics Fall 2013 Introduction We often choose polynomials to approximate other classes of functions. Theorem (Weierstrass

More information

Neville s Method. MATH 375 Numerical Analysis. J. Robert Buchanan. Fall Department of Mathematics. J. Robert Buchanan Neville s Method

Neville s Method. MATH 375 Numerical Analysis. J. Robert Buchanan. Fall Department of Mathematics. J. Robert Buchanan Neville s Method Neville s Method MATH 375 Numerical Analysis J. Robert Buchanan Department of Mathematics Fall 2013 Motivation We have learned how to approximate a function using Lagrange polynomials and how to estimate

More information

MATH Dr. Halimah Alshehri Dr. Halimah Alshehri

MATH Dr. Halimah Alshehri Dr. Halimah Alshehri MATH 1101 haalshehri@ksu.edu.sa 1 Introduction To Number Systems First Section: Binary System Second Section: Octal Number System Third Section: Hexadecimal System 2 Binary System 3 Binary System The binary

More information

Floating-point Computation

Floating-point Computation Chapter 2 Floating-point Computation 21 Positional Number System An integer N in a number system of base (or radix) β may be written as N = a n β n + a n 1 β n 1 + + a 1 β + a 0 = P n (β) where a i are

More information

Lecture Notes 7, Math/Comp 128, Math 250

Lecture Notes 7, Math/Comp 128, Math 250 Lecture Notes 7, Math/Comp 128, Math 250 Misha Kilmer Tufts University October 23, 2005 Floating Point Arithmetic We talked last time about how the computer represents floating point numbers. In a floating

More information

Chapter 4 Number Representations

Chapter 4 Number Representations Chapter 4 Number Representations SKEE2263 Digital Systems Mun im/ismahani/izam {munim@utm.my,e-izam@utm.my,ismahani@fke.utm.my} February 9, 2016 Table of Contents 1 Fundamentals 2 Signed Numbers 3 Fixed-Point

More information

Introduction CSE 541

Introduction CSE 541 Introduction CSE 541 1 Numerical methods Solving scientific/engineering problems using computers. Root finding, Chapter 3 Polynomial Interpolation, Chapter 4 Differentiation, Chapter 4 Integration, Chapters

More information

Chapter 1 Computer Arithmetic

Chapter 1 Computer Arithmetic Numerical Analysis (Math 9372) 2017-2016 Chapter 1 Computer Arithmetic 1.1 Introduction Numerical analysis is a way to solve mathematical problems by special procedures which use arithmetic operations

More information

ACM 106a: Lecture 1 Agenda

ACM 106a: Lecture 1 Agenda 1 ACM 106a: Lecture 1 Agenda Introduction to numerical linear algebra Common problems First examples Inexact computation What is this course about? 2 Typical numerical linear algebra problems Systems of

More information

Homework 2 Foundations of Computational Math 1 Fall 2018

Homework 2 Foundations of Computational Math 1 Fall 2018 Homework 2 Foundations of Computational Math 1 Fall 2018 Note that Problems 2 and 8 have coding in them. Problem 2 is a simple task while Problem 8 is very involved (and has in fact been given as a programming

More information

Chapter 1: Preliminaries and Error Analysis

Chapter 1: Preliminaries and Error Analysis Chapter 1: Error Analysis Peter W. White white@tarleton.edu Department of Tarleton State University Summer 2015 / Numerical Analysis Overview We All Remember Calculus Derivatives: limit definition, sum

More information

Numerical Analysis. Yutian LI. 2018/19 Term 1 CUHKSZ. Yutian LI (CUHKSZ) Numerical Analysis 2018/19 1 / 41

Numerical Analysis. Yutian LI. 2018/19 Term 1 CUHKSZ. Yutian LI (CUHKSZ) Numerical Analysis 2018/19 1 / 41 Numerical Analysis Yutian LI CUHKSZ 2018/19 Term 1 Yutian LI (CUHKSZ) Numerical Analysis 2018/19 1 / 41 Reference Books BF R. L. Burden and J. D. Faires, Numerical Analysis, 9th edition, Thomsom Brooks/Cole,

More information

Round-off Errors and Computer Arithmetic - (1.2)

Round-off Errors and Computer Arithmetic - (1.2) Round-off Errors and Comuter Arithmetic - (.). Round-off Errors: Round-off errors is roduced when a calculator or comuter is used to erform real number calculations. That is because the arithmetic erformed

More information

Midterm Review. Igor Yanovsky (Math 151A TA)

Midterm Review. Igor Yanovsky (Math 151A TA) Midterm Review Igor Yanovsky (Math 5A TA) Root-Finding Methods Rootfinding methods are designed to find a zero of a function f, that is, to find a value of x such that f(x) =0 Bisection Method To apply

More information

EAD 115. Numerical Solution of Engineering and Scientific Problems. David M. Rocke Department of Applied Science

EAD 115. Numerical Solution of Engineering and Scientific Problems. David M. Rocke Department of Applied Science EAD 115 Numerical Solution of Engineering and Scientific Problems David M. Rocke Department of Applied Science Computer Representation of Numbers Counting numbers (unsigned integers) are the numbers 0,

More information

Chapter 1 Mathematical Preliminaries and Error Analysis

Chapter 1 Mathematical Preliminaries and Error Analysis Numerical Analysis (Math 3313) 2019-2018 Chapter 1 Mathematical Preliminaries and Error Analysis Intended learning outcomes: Upon successful completion of this chapter, a student will be able to (1) list

More information

Introduction and mathematical preliminaries

Introduction and mathematical preliminaries Chapter Introduction and mathematical preliminaries Contents. Motivation..................................2 Finite-digit arithmetic.......................... 2.3 Errors in numerical calculations.....................

More information

Notes on floating point number, numerical computations and pitfalls

Notes on floating point number, numerical computations and pitfalls Notes on floating point number, numerical computations and pitfalls November 6, 212 1 Floating point numbers An n-digit floating point number in base β has the form x = ±(.d 1 d 2 d n ) β β e where.d 1

More information

Tu: 9/3/13 Math 471, Fall 2013, Section 001 Lecture 1

Tu: 9/3/13 Math 471, Fall 2013, Section 001 Lecture 1 Tu: 9/3/13 Math 71, Fall 2013, Section 001 Lecture 1 1 Course intro Notes : Take attendance. Instructor introduction. Handout : Course description. Note the exam days (and don t be absent). Bookmark the

More information

CME 302: NUMERICAL LINEAR ALGEBRA FALL 2005/06 LECTURE 5. Ax = b.

CME 302: NUMERICAL LINEAR ALGEBRA FALL 2005/06 LECTURE 5. Ax = b. CME 302: NUMERICAL LINEAR ALGEBRA FALL 2005/06 LECTURE 5 GENE H GOLUB Suppose we want to solve We actually have an approximation ξ such that 1 Perturbation Theory Ax = b x = ξ + e The question is, how

More information

Numerical Methods. Dr Dana Mackey. School of Mathematical Sciences Room A305 A Dana Mackey (DIT) Numerical Methods 1 / 12

Numerical Methods. Dr Dana Mackey. School of Mathematical Sciences Room A305 A   Dana Mackey (DIT) Numerical Methods 1 / 12 Numerical Methods Dr Dana Mackey School of Mathematical Sciences Room A305 A Email: Dana.Mackey@dit.ie Dana Mackey (DIT) Numerical Methods 1 / 12 Practical Information The typed notes will be available

More information

Number Representation and Waveform Quantization

Number Representation and Waveform Quantization 1 Number Representation and Waveform Quantization 1 Introduction This lab presents two important concepts for working with digital signals. The first section discusses how numbers are stored in memory.

More information

Numerical Analysis and Computing

Numerical Analysis and Computing Numerical Analysis and Computing Lecture Notes #02 Calculus Review; Computer Artihmetic and Finite Precision; and Convergence; Joe Mahaffy, mahaffy@math.sdsu.edu Department of Mathematics Dynamical Systems

More information

Limits and Continuity

Limits and Continuity Limits and Continuity MATH 151 Calculus for Management J. Robert Buchanan Department of Mathematics Fall 2018 Objectives After this lesson we will be able to: Determine the left-hand and right-hand limits

More information

QUADRATIC PROGRAMMING?

QUADRATIC PROGRAMMING? QUADRATIC PROGRAMMING? WILLIAM Y. SIT Department of Mathematics, The City College of The City University of New York, New York, NY 10031, USA E-mail: wyscc@cunyvm.cuny.edu This is a talk on how to program

More information

FLOATING POINT ARITHMETHIC - ERROR ANALYSIS

FLOATING POINT ARITHMETHIC - ERROR ANALYSIS FLOATING POINT ARITHMETHIC - ERROR ANALYSIS Brief review of floating point arithmetic Model of floating point arithmetic Notation, backward and forward errors Roundoff errors and floating-point arithmetic

More information

1 ERROR ANALYSIS IN COMPUTATION

1 ERROR ANALYSIS IN COMPUTATION 1 ERROR ANALYSIS IN COMPUTATION 1.2 Round-Off Errors & Computer Arithmetic (a) Computer Representation of Numbers Two types: integer mode (not used in MATLAB) floating-point mode x R ˆx F(β, t, l, u),

More information

Lecture 7. Floating point arithmetic and stability

Lecture 7. Floating point arithmetic and stability Lecture 7 Floating point arithmetic and stability 2.5 Machine representation of numbers Scientific notation: 23 }{{} }{{} } 3.14159265 {{} }{{} 10 sign mantissa base exponent (significand) s m β e A floating

More information

FLOATING POINT ARITHMETHIC - ERROR ANALYSIS

FLOATING POINT ARITHMETHIC - ERROR ANALYSIS FLOATING POINT ARITHMETHIC - ERROR ANALYSIS Brief review of floating point arithmetic Model of floating point arithmetic Notation, backward and forward errors 3-1 Roundoff errors and floating-point arithmetic

More information

Numbering Systems. Contents: Binary & Decimal. Converting From: B D, D B. Arithmetic operation on Binary.

Numbering Systems. Contents: Binary & Decimal. Converting From: B D, D B. Arithmetic operation on Binary. Numbering Systems Contents: Binary & Decimal. Converting From: B D, D B. Arithmetic operation on Binary. Addition & Subtraction using Octal & Hexadecimal 2 s Complement, Subtraction Using 2 s Complement.

More information

Review of Power Series

Review of Power Series Review of Power Series MATH 365 Ordinary Differential Equations J. Robert Buchanan Department of Mathematics Fall 2018 Introduction In addition to the techniques we have studied so far, we may use power

More information

PowerPoints organized by Dr. Michael R. Gustafson II, Duke University

PowerPoints organized by Dr. Michael R. Gustafson II, Duke University Part 1 Chapter 4 Roundoff and Truncation Errors PowerPoints organized by Dr. Michael R. Gustafson II, Duke University All images copyright The McGraw-Hill Companies, Inc. Permission required for reproduction

More information

Conversions between Decimal and Binary

Conversions between Decimal and Binary Conversions between Decimal and Binary Binary to Decimal Technique - use the definition of a number in a positional number system with base 2 - evaluate the definition formula ( the formula ) using decimal

More information

Number Systems III MA1S1. Tristan McLoughlin. December 4, 2013

Number Systems III MA1S1. Tristan McLoughlin. December 4, 2013 Number Systems III MA1S1 Tristan McLoughlin December 4, 2013 http://en.wikipedia.org/wiki/binary numeral system http://accu.org/index.php/articles/1558 http://www.binaryconvert.com http://en.wikipedia.org/wiki/ascii

More information

1.1 COMPUTER REPRESENTATION OF NUM- BERS, REPRESENTATION ERRORS

1.1 COMPUTER REPRESENTATION OF NUM- BERS, REPRESENTATION ERRORS Chapter 1 NUMBER REPRESENTATION, ERROR ANALYSIS 1.1 COMPUTER REPRESENTATION OF NUM- BERS, REPRESENTATION ERRORS Floating-point representation x t,r of a number x: x t,r = m t P cr, where: P - base (the

More information

Accelerating Convergence

Accelerating Convergence Accelerating Convergence MATH 375 Numerical Analysis J. Robert Buchanan Department of Mathematics Fall 2013 Motivation We have seen that most fixed-point methods for root finding converge only linearly

More information

Mathematics for Engineers. Numerical mathematics

Mathematics for Engineers. Numerical mathematics Mathematics for Engineers Numerical mathematics Integers Determine the largest representable integer with the intmax command. intmax ans = int32 2147483647 2147483647+1 ans = 2.1475e+09 Remark The set

More information

Secondary Math 3 Honors - Polynomial and Polynomial Functions Test Review

Secondary Math 3 Honors - Polynomial and Polynomial Functions Test Review Name: Class: Date: Secondary Math 3 Honors - Polynomial and Polynomial Functions Test Review 1 Write 3x 2 ( 2x 2 5x 3 ) in standard form State whether the function is even, odd, or neither Show your work

More information

The Euclidean Division Implemented with a Floating-Point Multiplication and a Floor

The Euclidean Division Implemented with a Floating-Point Multiplication and a Floor The Euclidean Division Implemented with a Floating-Point Multiplication and a Floor Vincent Lefèvre 11th July 2005 Abstract This paper is a complement of the research report The Euclidean division implemented

More information

ENGIN 112 Intro to Electrical and Computer Engineering

ENGIN 112 Intro to Electrical and Computer Engineering ENGIN 112 Intro to Electrical and Computer Engineering Lecture 3 More Number Systems Overview Hexadecimal numbers Related to binary and octal numbers Conversion between hexadecimal, octal and binary Value

More information

Chapter 4: Radicals and Complex Numbers

Chapter 4: Radicals and Complex Numbers Section 4.1: A Review of the Properties of Exponents #1-42: Simplify the expression. 1) x 2 x 3 2) z 4 z 2 3) a 3 a 4) b 2 b 5) 2 3 2 2 6) 3 2 3 7) x 2 x 3 x 8) y 4 y 2 y 9) 10) 11) 12) 13) 14) 15) 16)

More information

Functions: Polynomial, Rational, Exponential

Functions: Polynomial, Rational, Exponential Functions: Polynomial, Rational, Exponential MATH 151 Calculus for Management J. Robert Buchanan Department of Mathematics Spring 2014 Objectives In this lesson we will learn to: identify polynomial expressions,

More information

Numerical Mathematical Analysis

Numerical Mathematical Analysis Numerical Mathematical Analysis Numerical Mathematical Analysis Catalin Trenchea Department of Mathematics University of Pittsburgh September 20, 2010 Numerical Mathematical Analysis Math 1070 Numerical

More information

Solving Quadratic Equations

Solving Quadratic Equations Solving Quadratic Equations MATH 101 College Algebra J. Robert Buchanan Department of Mathematics Summer 2012 Objectives In this lesson we will learn to: solve quadratic equations by factoring, solve quadratic

More information

Elements of Floating-point Arithmetic

Elements of Floating-point Arithmetic Elements of Floating-point Arithmetic Sanzheng Qiao Department of Computing and Software McMaster University July, 2012 Outline 1 Floating-point Numbers Representations IEEE Floating-point Standards Underflow

More information

Math 110 (S & E) Textbook: Calculus Early Transcendentals by James Stewart, 7 th Edition

Math 110 (S & E) Textbook: Calculus Early Transcendentals by James Stewart, 7 th Edition Math 110 (S & E) Textbook: Calculus Early Transcendentals by James Stewart, 7 th Edition 1 Appendix A : Numbers, Inequalities, and Absolute Values Sets A set is a collection of objects with an important

More information

Numerical Methods in Physics and Astrophysics

Numerical Methods in Physics and Astrophysics Kostas Kokkotas 2 November 6, 2007 2 kostas.kokkotas@uni-tuebingen.de http://www.tat.physik.uni-tuebingen.de/kokkotas Kostas Kokkotas 3 Error Analysis Definition : Suppose that x is an approximation to

More information

1 Solutions to selected problems

1 Solutions to selected problems Solutions to selected problems Section., #a,c,d. a. p x = n for i = n : 0 p x = xp x + i end b. z = x, y = x for i = : n y = y + x i z = zy end c. y = (t x ), p t = a for i = : n y = y(t x i ) p t = p

More information

Jim Lambers MAT 610 Summer Session Lecture 2 Notes

Jim Lambers MAT 610 Summer Session Lecture 2 Notes Jim Lambers MAT 610 Summer Session 2009-10 Lecture 2 Notes These notes correspond to Sections 2.2-2.4 in the text. Vector Norms Given vectors x and y of length one, which are simply scalars x and y, the

More information

Sets and Functions. MATH 464/506, Real Analysis. J. Robert Buchanan. Summer Department of Mathematics. J. Robert Buchanan Sets and Functions

Sets and Functions. MATH 464/506, Real Analysis. J. Robert Buchanan. Summer Department of Mathematics. J. Robert Buchanan Sets and Functions Sets and Functions MATH 464/506, Real Analysis J. Robert Buchanan Department of Mathematics Summer 2007 Notation x A means that element x is a member of set A. x / A means that x is not a member of A.

More information

1 What is numerical analysis and scientific computing?

1 What is numerical analysis and scientific computing? Mathematical preliminaries 1 What is numerical analysis and scientific computing? Numerical analysis is the study of algorithms that use numerical approximation (as opposed to general symbolic manipulations)

More information

Reading Mathematical Expressions & Arithmetic Operations Expression Reads Note

Reading Mathematical Expressions & Arithmetic Operations Expression Reads Note Math 001 - Term 171 Reading Mathematical Expressions & Arithmetic Operations Expression Reads Note x A x belongs to A,x is in A Between an element and a set. A B A is a subset of B Between two sets. φ

More information

MTH303. Section 1.3: Error Analysis. R.Touma

MTH303. Section 1.3: Error Analysis. R.Touma MTH303 Section 1.3: Error Analysis R.Touma These lecture slides are not enough to understand the topics of the course; they could be used along with the textbook The numerical solution of a mathematical

More information

ALU (3) - Division Algorithms

ALU (3) - Division Algorithms HUMBOLDT-UNIVERSITÄT ZU BERLIN INSTITUT FÜR INFORMATIK Lecture 12 ALU (3) - Division Algorithms Sommersemester 2002 Leitung: Prof. Dr. Miroslaw Malek www.informatik.hu-berlin.de/rok/ca CA - XII - ALU(3)

More information

CHAPTER 1 REAL NUMBERS KEY POINTS

CHAPTER 1 REAL NUMBERS KEY POINTS CHAPTER 1 REAL NUMBERS 1. Euclid s division lemma : KEY POINTS For given positive integers a and b there exist unique whole numbers q and r satisfying the relation a = bq + r, 0 r < b. 2. Euclid s division

More information

Elements of Floating-point Arithmetic

Elements of Floating-point Arithmetic Elements of Floating-point Arithmetic Sanzheng Qiao Department of Computing and Software McMaster University July, 2012 Outline 1 Floating-point Numbers Representations IEEE Floating-point Standards Underflow

More information

Chapter 1 Error Analysis

Chapter 1 Error Analysis Chapter 1 Error Analysis Several sources of errors are important for numerical data processing: Experimental uncertainty: Input data from an experiment have a limited precision. Instead of the vector of

More information

Question Details SPreCalc [ ] Question Details SPreCalc MI. [ ]

Question Details SPreCalc [ ] Question Details SPreCalc MI. [ ] of 11 MATH 142 Chapter 1 Homework (4705314) Question 1234567891011121314151617181920212223242526272829303132333435363 Description This homework assignment covers Chapter 1: 1.1, 1.2, 1.3, 1.4, and 1.5...

More information

ECE 372 Microcontroller Design

ECE 372 Microcontroller Design Data Formats Humor There are 10 types of people in the world: Those who get binary and those who don t. 1 Information vs. Data Information An abstract description of facts, processes or perceptions How

More information

Binary floating point

Binary floating point Binary floating point Notes for 2017-02-03 Why do we study conditioning of problems? One reason is that we may have input data contaminated by noise, resulting in a bad solution even if the intermediate

More information

Equations in Quadratic Form

Equations in Quadratic Form Equations in Quadratic Form MATH 101 College Algebra J. Robert Buchanan Department of Mathematics Summer 2012 Objectives In this lesson we will learn to: make substitutions that allow equations to be written

More information

Spring Nikos Apostolakis

Spring Nikos Apostolakis Spring 07 Nikos Apostolakis Review of fractions Rational expressions are fractions with numerator and denominator polynomials. We need to remember how we work with fractions (a.k.a. rational numbers) before

More information

ECS 231 Computer Arithmetic 1 / 27

ECS 231 Computer Arithmetic 1 / 27 ECS 231 Computer Arithmetic 1 / 27 Outline 1 Floating-point numbers and representations 2 Floating-point arithmetic 3 Floating-point error analysis 4 Further reading 2 / 27 Outline 1 Floating-point numbers

More information

Exam 2 Review Chapters 4-5

Exam 2 Review Chapters 4-5 Math 365 Lecture Notes S. Nite 8/18/2012 Page 1 of 9 Integers and Number Theory Exam 2 Review Chapters 4-5 Divisibility Theorem 4-1 If d a, n I, then d (a n) Theorem 4-2 If d a, and d b, then d (a+b).

More information

Chapter 1: Foundations for Algebra

Chapter 1: Foundations for Algebra Chapter 1: Foundations for Algebra 1 Unit 1: Vocabulary 1) Natural Numbers 2) Whole Numbers 3) Integers 4) Rational Numbers 5) Irrational Numbers 6) Real Numbers 7) Terminating Decimal 8) Repeating Decimal

More information

CS412: Introduction to Numerical Methods

CS412: Introduction to Numerical Methods CS412: Introduction to Numerical Methods MIDTERM #1 2:30PM - 3:45PM, Tuesday, 03/10/2015 Instructions: This exam is a closed book and closed notes exam, i.e., you are not allowed to consult any textbook,

More information

COMPUTER ARITHMETIC. 13/05/2010 cryptography - math background pp. 1 / 162

COMPUTER ARITHMETIC. 13/05/2010 cryptography - math background pp. 1 / 162 COMPUTER ARITHMETIC 13/05/2010 cryptography - math background pp. 1 / 162 RECALL OF COMPUTER ARITHMETIC computers implement some types of arithmetic for instance, addition, subtratction, multiplication

More information

Ex code

Ex code Ex. 8.4 7-4-2-1 code Codeconverter 7-4-2-1-code to BCD-code. When encoding the digits 0... 9 sometimes in the past a code having weights 7-4-2-1 instead of the binary code weights 8-4-2-1 was used. In

More information

Chetek-Weyerhaeuser High School

Chetek-Weyerhaeuser High School Chetek-Weyerhaeuser High School Unit 1 Variables and Expressions Math RtI Units and s Math RtI A s 1. I can use mathematical properties to evaluate expressions. I can use mathematical properties to evaluate

More information

ALGEBRA+NUMBER THEORY +COMBINATORICS

ALGEBRA+NUMBER THEORY +COMBINATORICS ALGEBRA+NUMBER THEORY +COMBINATORICS COMP 321 McGill University These slides are mainly compiled from the following resources. - Professor Jaehyun Park slides CS 97SI - Top-coder tutorials. - Programming

More information

MAT 460: Numerical Analysis I. James V. Lambers

MAT 460: Numerical Analysis I. James V. Lambers MAT 460: Numerical Analysis I James V. Lambers January 31, 2013 2 Contents 1 Mathematical Preliminaries and Error Analysis 7 1.1 Introduction............................ 7 1.1.1 Error Analysis......................

More information

UNIT V FINITE WORD LENGTH EFFECTS IN DIGITAL FILTERS PART A 1. Define 1 s complement form? In 1,s complement form the positive number is represented as in the sign magnitude form. To obtain the negative

More information

Computing Machine-Efficient Polynomial Approximations

Computing Machine-Efficient Polynomial Approximations Computing Machine-Efficient Polynomial Approximations N. Brisebarre, S. Chevillard, G. Hanrot, J.-M. Muller, D. Stehlé, A. Tisserand and S. Torres Arénaire, LIP, É.N.S. Lyon Journées du GDR et du réseau

More information

1 Solutions to selected problems

1 Solutions to selected problems Solutions to selected problems Section., #a,c,d. a. p x = n for i = n : 0 p x = xp x + i end b. z = x, y = x for i = : n y = y + x i z = zy end c. y = (t x ), p t = a for i = : n y = y(t x i ) p t = p

More information

Finite Fields. SOLUTIONS Network Coding - Prof. Frank H.P. Fitzek

Finite Fields. SOLUTIONS Network Coding - Prof. Frank H.P. Fitzek Finite Fields In practice most finite field applications e.g. cryptography and error correcting codes utilizes a specific type of finite fields, namely the binary extension fields. The following exercises

More information

1 Computing System 2. 2 Data Representation Number Systems 22

1 Computing System 2. 2 Data Representation Number Systems 22 Chapter 4: Computing System & Data Representation Christian Jacob 1 Computing System 2 1.1 Abacus 3 2 Data Representation 19 3 Number Systems 22 3.1 Important Number Systems for Computers 24 3.2 Decimal

More information

Next, we include the several conversion from type to type.

Next, we include the several conversion from type to type. Number Conversions: Binary Decimal; Floating Points In order to communicate with a computer, we need, at some point, to speak the same language. The words of our language are made up of combinations of

More information

Chapter 4: Radicals and Complex Numbers

Chapter 4: Radicals and Complex Numbers Chapter : Radicals and Complex Numbers Section.1: A Review of the Properties of Exponents #1-: Simplify the expression. 1) x x ) z z ) a a ) b b ) 6) 7) x x x 8) y y y 9) x x y 10) y 8 b 11) b 7 y 1) y

More information

Series Solutions Near a Regular Singular Point

Series Solutions Near a Regular Singular Point Series Solutions Near a Regular Singular Point MATH 365 Ordinary Differential Equations J. Robert Buchanan Department of Mathematics Fall 2018 Background We will find a power series solution to the equation:

More information

NUMBERS AND CODES CHAPTER Numbers

NUMBERS AND CODES CHAPTER Numbers CHAPTER 2 NUMBERS AND CODES 2.1 Numbers When a number such as 101 is given, it is impossible to determine its numerical value. Some may say it is five. Others may say it is one hundred and one. Could it

More information

27 Wyner Math 2 Spring 2019

27 Wyner Math 2 Spring 2019 27 Wyner Math 2 Spring 2019 CHAPTER SIX: POLYNOMIALS Review January 25 Test February 8 Thorough understanding and fluency of the concepts and methods in this chapter is a cornerstone to success in the

More information

AIMS Exercise Set # 1

AIMS Exercise Set # 1 AIMS Exercise Set #. Determine the form of the single precision floating point arithmetic used in the computers at AIMS. What is the largest number that can be accurately represented? What is the smallest

More information

NUMERICAL METHODS C. Carl Gustav Jacob Jacobi 10.1 GAUSSIAN ELIMINATION WITH PARTIAL PIVOTING

NUMERICAL METHODS C. Carl Gustav Jacob Jacobi 10.1 GAUSSIAN ELIMINATION WITH PARTIAL PIVOTING 0. Gaussian Elimination with Partial Pivoting 0.2 Iterative Methods for Solving Linear Systems 0.3 Power Method for Approximating Eigenvalues 0.4 Applications of Numerical Methods Carl Gustav Jacob Jacobi

More information

2.29 Numerical Fluid Mechanics Fall 2011 Lecture 2

2.29 Numerical Fluid Mechanics Fall 2011 Lecture 2 2.29 Numerical Fluid Mechanics Fall 2011 Lecture 2 REVIEW Lecture 1 1. Syllabus, Goals and Objectives 2. Introduction to CFD 3. From mathematical models to numerical simulations (1D Sphere in 1D flow)

More information

Solutions to Assignment 1

Solutions to Assignment 1 Solutions to Assignment 1 Question 1. [Exercises 1.1, # 6] Use the division algorithm to prove that every odd integer is either of the form 4k + 1 or of the form 4k + 3 for some integer k. For each positive

More information

A. Graph the parabola. B. Where are the solutions to the equation, 0= x + 1? C. What does the Fundamental Theorem of Algebra say?

A. Graph the parabola. B. Where are the solutions to the equation, 0= x + 1? C. What does the Fundamental Theorem of Algebra say? Hart Interactive Honors Algebra 1 Lesson 6 M4+ Opening Exercises 1. Watch the YouTube video Imaginary Numbers Are Real [Part1: Introduction] by Welch Labs (https://www.youtube.com/watch?v=t647cgsuovu).

More information

14:332:231 DIGITAL LOGIC DESIGN. Why Binary Number System?

14:332:231 DIGITAL LOGIC DESIGN. Why Binary Number System? :33:3 DIGITAL LOGIC DESIGN Ivan Marsic, Rutgers University Electrical & Computer Engineering Fall 3 Lecture #: Binary Number System Complement Number Representation X Y Why Binary Number System? Because

More information

Mathematics Foundation for College. Lesson Number 1. Lesson Number 1 Page 1

Mathematics Foundation for College. Lesson Number 1. Lesson Number 1 Page 1 Mathematics Foundation for College Lesson Number 1 Lesson Number 1 Page 1 Lesson Number 1 Topics to be Covered in this Lesson Sets, number systems, axioms, arithmetic operations, prime numbers and divisibility,

More information

MATH ASSIGNMENT 03 SOLUTIONS

MATH ASSIGNMENT 03 SOLUTIONS MATH444.0 ASSIGNMENT 03 SOLUTIONS 4.3 Newton s method can be used to compute reciprocals, without division. To compute /R, let fx) = x R so that fx) = 0 when x = /R. Write down the Newton iteration for

More information

1 Floating point arithmetic

1 Floating point arithmetic Introduction to Floating Point Arithmetic Floating point arithmetic Floating point representation (scientific notation) of numbers, for example, takes the following form.346 0 sign fraction base exponent

More information

Numerical Algorithms. IE 496 Lecture 20

Numerical Algorithms. IE 496 Lecture 20 Numerical Algorithms IE 496 Lecture 20 Reading for This Lecture Primary Miller and Boxer, Pages 124-128 Forsythe and Mohler, Sections 1 and 2 Numerical Algorithms Numerical Analysis So far, we have looked

More information