IQmath
Floating-Point Representation
IEEE Std. 754 Single Precision
IEEE Std. 754 Single Precision
Floating
Floating
-
-
Point
Point
s eeeeeeee fffffffffffffffffffffff
0
31 30
23 22
23 bit mantissa (fraction)
8 bit exponent
1 bit sign
Advantage
Advantage
⇒
⇒
Exponent gives large dynamic range
Exponent gives large dynamic range
Disadvantage
Disadvantage
⇒
⇒
Precision of a number depends on its exponent
Precision of a number depends on its exponent
Case 1:
if e = 255 and f = 0,
then v = NaN
Case 2:
if e = 255 and f = 0,
then v = [(-1)
s
]*infinity
Case 3:
Case 3:
if 0 < e < 255,
if 0 < e < 255,
then v = [(
then v = [(
-
-
1)
1)
s
s
]*[2
]*[2
(e
(e
-
-
127)
127)
]*(1.f)
]*(1.f)
Case 4:
Case 4:
if e = 0 and f = 0,
if e = 0 and f = 0,
then v = [(
then v = [(
-
-
1)
1)
s
s
]*[2
]*[2
(
(
-
-
126)
126)
]*(0.f)
]*(0.f)
Case 5:
if e = 0 and f = 0,
then v = [(-1)
s
]*0
/
/
/
Floating
Floating
-
-
Point does not Solve
Point does not Solve
Everything!
Everything!
Example:
x = 10.0
(0x41200000)
+ y = 0.000000238
(0x347F8CF1)
z = 10.000000238
RIGHT?
WRONG!
You cannot represent 10.000000238 with
single-precision floating point
0x412000000
= 10.000000000
10.000000238
⇐
can’t represent!
0x412000001
= 10.000000950
So z gets rounded down to 10.000000000
8 - 14
C28x - Numerical Concepts & IQmath
Summary of Contents for C28 Series
Page 64: ...Summary 3 16 C28x Peripheral Registers Header Files ...
Page 78: ...Interrupt Sources 4 14 C28x Reset and Interrupts ...
Page 218: ...Lab 9 DSP BIOS 9 22 C28x Using DSP BIOS ...
Page 244: ...Lab 10 Programming the Flash 10 26 C28x System Design ...
Page 273: ...Appendix A eZdsp F2812 C28x Appendix A eZdsp F2812 A 1 ...
Page 276: ...Appendix P2 Expansion Interface A 4 C28x Appendix A eZdsp F2812 ...
Page 277: ...Appendix P4 P8 P7 I O Interface C28x Appendix A eZdsp F2812 A 5 ...
Page 278: ...Appendix A 6 C28x Appendix A eZdsp F2812 ...
Page 279: ...Appendix P5 P9 Analog Interface C28x Appendix A eZdsp F2812 A 7 ...
Page 282: ...Appendix A 10 C28x Appendix A eZdsp F2812 TP1 TP2 Test Points ...