Digital technology and semiconductor circuit design

IEEE-754 WebApp

Fixed-point arithmentics reach their limits when it comes to an exact represenation of numbers and values to many decimal places. Floating-point arithmetics, which was introduced by IEEE Standard 754 in 1989, significantly enlarge the representable numerical range. The -format consits of 32 Bits. The first Bit \(S\) represents the sign. The next 8 Bits describe the exponent \(E\). The remaining 21 places represent the Mantisse's value \(M_\text{f}\). The number \(x\) is calculated from the given Bit pattern $$ x = (-1)^S \cdot 2^{E-OS} \cdot (1 + M_\text{f}) $$ Here, the Offset of \(OS = 127\) is applied so that also negative numbers are allowed.

For the conversion of the number \(x\) = into the Single Precision-format, the binary represenatation of the integer part and of the fractional part is done seperately. (see calculation Integer part and Fractional part)

The result of the conversion is:
Integer part:
12310 = 11110112
Fractional part:
0.45610 = 0.011101001011111⋯2

The resulting number \(x_2= \)(1111011.0111⋯)2 has to be normalized. This means \(x_2\) has to be multiplied with the power of two 2\(-e\) = 26 whereby the comma is offset by six places to the left. Thus, in the normalized form, there is always a 1 before the comma. The first 23 digits of the fractional part are stored as Mantisse \(M_f\). The integer part is the same with 1. for every number in the normalzed form and does not have to be stored. The exponent's sign is taken into account with the Offset \(OS = 127\). The biased exponent \(E = OS + e\) (hier 13310 = 100001012) is stored.

Mantisse:
(123.456)10 = (1111011.1110110111)2
(1.1110110111101)2 · 26
biased exponent:
127 + (6) = 13310 = 100001012

Binary represenation:
0 | 10000101 | 111011011101001011111001 

Second variant

For the conversion of a number \(x\) = into the Single Precision-format first the Exponent \(e\) has to be normalized. The number \(x\) can be represented as \(x=M\cdot 2^e\). M is with \(e = \lfloor \log_2 x \rfloor\) a number between 1 and 2.

log2(123.456) = 6.9478rounded down: \(e = \) 6
\(x = \) 123.456 = 1.929 · 26

Here it is important to consider that negative exponents are rounded up according to their amount. The fractional part \(M_f\) of the Mantisse \(M\) can now be converted into the binary system. (see here) Further, the Offset \(OS=127\) is added to the exponent. This so-called biased exponent can also be transferred into the binary system.

Mantisse:
\(1 + M_f\) = (1.929)10
=
1 + (0.111011⋯)2

biased exponent:
\(E = OS + e\) = 127 + 6 = 13310
=
100001012


Binary represenation:
0 | 10000101 | 111011011101001011111001 
Nach oben scrollen