Digital Signal Processing Reference
In-Depth Information
Beispiel 16-1 Gleitkommaformat
Für die natürliche Zahl 100 ergibt sich zu (16.4) zunächst die Zerlegung
0
6
100
1
2
1
0.5625
(16.7)
und daraus das zugehörige Bitmuster
100
0 100 ' 0000 ' 01011001' 0000...0000
f
d
(16.8)
s
e
6 1023
M
0.5625
Für die negative Dezimalzahl -0.40625 führt die Zerlegung (16.4) auf
1
2
(16.9)
0.40625
1
2
1
0.625
und das zugehörige Bitmuster ist
0.40625
1 011'1111'1101 1010 ' 0000...0000
f
d
(16.10)
s
e
2 1023
M
0.625
MATLAB am PC verwendet das Format IEEE 754-1985, das bestimmte Bitmuster für Aus-
nahmen reserviert, wie zum Beispiel Inf für den positiven Überlauf (
), -Inf für den nega-
tiven Überlauf (
) und NaN für Not a Number. Letzteres resultiert als Ergebnis für undefi-
nierte Ausdrücke, wie der Division von 0/0 . Um die Ausnahmen anzuzeigen, ist der maximal
mögliche Exponent e max = 2 8 1 = 255 bzw. 2 11 1 = 2047 reserviert, siehe Tabelle 16-1.
Tabelle 16-1 Codierung von Gleitkommazahlen (IEEE 754-1985)
Typ
Exponent
M f
Mantisse
Bias
Reelle Zahl mit E = e
s
E
Normalisiert 1
1
+
e < e max
f m , …, f 0
1 + M f
12 1
M
f
s
E
12
M
Denormalisiert
0, …, 0
f m , …, f 0
M f
min
f
0 2
0, …, 0
0, …, 0
0
NaN
e max
1, …, 1
Inf , -Inf 2
e max
0, …, 0
1 Signifikant: 1 + M f
2 0 und -0 werden ebenso wie Inf und -Inf durch das Vorzeichenbit s = 0 bzw.
1 unterschieden
Formate
m
e max
E min
Bias
E max = e max
1
Bias
Single Precision
22
255
126
127
127
Double Precision
51
2047
1022
1023
1023
Search WWH ::




Custom Search