Docsity

Floating Point Representation, Summaries of Electrical Engineering

Toggle sidebar
bg1
Problem: Find the best approximation of irrational numbers (e.g. 2.718, 3.14) using
IEEE 754 32-bit floating-point representation:
The notation 1.M is shorthand for appending the bits of the mantissa, from the most significant bit to
the least, after the binary point. IEEE 754 reserves the exponent code E = 0 for denormalized numbers
and the code E = 255 for infinities (positive and negative) as well as special values called Not a Number
(NaN) that indicate an error. (NaN is produced, for example, when you divide 0 by 0.)
Problem Statement:
Not all values can be expressed exactly using IEEE 754 floating point. In particular, values
that cannot be represented as a rational number whose denominator is a power of two cannot
be represented perfectly. For example, to represent 2.718, we would need to represent
2718
1000 =1359
500 using a rational number with a denominator that is a power of two. This is not
possible; the best we can do is approximate.
Hint: Find the value of M that minimizes, |(1 + ๐‘€ ร— 2โˆ’23)โˆ’ 1.359|. Why??
pf2

Partial preview of the text

Download Floating Point Representation and more Summaries Electrical Engineering in PDF only on Docsity!

Problem: Find the best approximation of irrational numbers (e.g. 2.718, 3.14) using

IEEE 754 32-bit floating-point representation:

The notation 1.M is shorthand for appending the bits of the mantissa, from the most significant bit to the least, after the binary point. IEEE 754 reserves the exponent code E = 0 for denormalized numbers and the code E = 255 for infinities (positive and negative) as well as special values called Not a Number (NaN) that indicate an error. (NaN is produced, for example, when you divide 0 by 0.)

Problem Statement:

Not all values can be expressed exactly using IEEE 754 floating point. In particular, values

that cannot be represented as a rational number whose denominator is a power of two cannot

be represented perfectly. For example, to represent 2.718, we would need to represent

2718 1000

1359 500

using a rational number with a denominator that is a power of two. This is not

possible; the best we can do is approximate.

Hint: Find the value of M that minimizes, |( 1 + ๐‘€ ร— 2 โˆ’^23 ) โˆ’ 1. 359 |. Why??