02.10.2019 Views

UploadFile_6417

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

262 Chapter 6 IMPLEMENTATION OF DISCRETE-TIME FILTERS<br />

function sm2oc converts a decimal sign-magnitude fraction into its one’scomplement<br />

format, while the function oc2sm performs the inverse operation.<br />

These functions are explored in Problem P6.24. Similarly, MATLAB<br />

functions sm2tc and tc2sm convert a decimal sign-magnitude fraction<br />

into its two’s-complement format and vice versa, respectively; they are<br />

explored in Problem P6.25.<br />

6.6.3 FLOATING-POINT ARITHMETIC<br />

In many applications, the range of numbers needed is very large. For<br />

example, in physics one might need, at the same time, the mass of the sun<br />

(e.g., 2.10 30 kg) and the mass of the electron (e.g., 9.10 −31 kg). These two<br />

numbers cover a range of over 10 60 .For fixed-point arithmetic, we would<br />

need 62-digit numbers (or 62-digit precision). However, even the mass of<br />

the sun is not accurately known with a precision of 5 digits, and there is<br />

almost no measurement in physics that could be made with a precision of<br />

62 digits. One could then imagine making all calculations with a precision<br />

of 62 digits and throwing away 50 or 60 of them before printing out the<br />

final results. This would be wasteful of both CPU time and memory space.<br />

So what is needed is a system for representing numbers in which the range<br />

of expressible numbers is independent of the number of significant digits.<br />

Decimal numbers The floating-point representation for a decimal<br />

number x is based on expressing the number in the scientific notation:<br />

x = ±M × 10 ±E<br />

where M is called the mantissa and E is the exponent. However, there<br />

are different possible representations of the same number, depending on<br />

the actual position of the decimal point—for example,<br />

1234 = 0.1234 × 10 4 =1.234 × 10 3 =12.34 × 10 2 = ···<br />

To fix this problem, a floating-point number is always stored using<br />

a unique representation, which has only one nonzero digit to the left<br />

of the decimal point. This representation of a floating-point number is<br />

called a normalized form. The normalized form of the preceding number<br />

is 1.234 × 10 3 ,because it is the only representation resulting in a unique<br />

nonzero digit to the left of the decimal point. The digit arrangement for<br />

the normalized form is given by<br />

sign of M<br />

ˆx =<br />

↓<br />

± x xx ···x<br />

} {{ }<br />

N-bit M<br />

sign of E<br />

↓<br />

± xx ···x<br />

} {{ }<br />

L-bit E<br />

(6.41)<br />

Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).<br />

Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!