Wh plastic
I know this:

Real numbers (also called floating-point numbers) handled by floating-point components. The form is: (-1) s2e (b0b1B2 ... BP-1). Where s is the sign bit, 0 is positive and 1 is negative; E is an exponent (called rank code), which is the transformation between ..., expanded by weight, multiplied first and then added. 3. Conversion between binary numbers and hexadecimal numbers. 1, the method of converting binary numbers into hexadecimal numbers. . . . . . . . . .

Download this file here and learn! ~~

Any decimal number n can be written as

N= 10E。 Male (2.3)

Similarly, in a computer, any number n can be written as

N = average (2.4)

M: The mantissa is a pure decimal.

E: The exponent of the scale factor, called floating-point exponent, is an integer.

R: the cardinal number of the scale factor, which is the constant of the machine with binary count value. Generally r is 2,8 or 16.

Machine floating-point number consists of rank code, mantissa and its sign bit (mantissa: expressed by fixed-point decimal number, giving significant digits).

Numbers determine the representation accuracy of floating-point numbers; Rank code: expressed in integer form, indicating the position of decimal point in data and determining floating point.

The representation range of a number. ):

In a 32-bit floating-point number, s: the sign bit of the floating-point number, 1 bit, 0 represents a positive number, and 1 represents a negative number. M: mantissa, 23 digits,

It is expressed in decimal, and the decimal point is placed in front of the mantissa field. E: grade code. Implicit 8-bit rank symbol, that is, code shift is used.

Type to represent positive and negative exponents. The code shift method is convenient for the comparison of two exponents and the operation of order, because the value of the order code field is large.

Moreover, its index value is also large. In this way, when the exponent truth value e of floating-point number is changed into sequence code e, the exponent e should be added.

Fixed offset value127 (01111), that is, e = e+ 127.

[Example 1] If the binary storage format of floating-point number X is (4 1360000) 16, find the decimal value of its 32-bit floating-point number.

[Solution:]

After the hexadecimal number is expanded, the format of the binary number can be obtained as follows

Exponent e = rank code-127 =10000101111.

Including the mantissa of hidden bits1.m =1.0110000000000 =1.065438+.

So there is

x=(- 1)s× 1。 M×2e

=+( 1.0 1 10 1 1)×23=+ 10 1 1.0 1 1=( 1 1.375) 10

[Example 2] Decimal number 20.59375 is converted into binary format of 32-bit floating-point number for storage.

[Solution:]

First, the integer and decimal parts are converted into binary numbers respectively:

20.59375= 10 100. 100 1 1

Then move the decimal point so that it is between 1 and 2 digits.

10 100. 100 1 1 = 1.0 100 100 1 1×24 e = 4

So I got:

S=0,E=4+ 127= 13 1,M = 0 100 100 1 1

Finally, the binary storage format of 32-bit floating-point numbers is:

0 100 000 1 10 0 100 100 100 0000 0000 0000 =(4 1a4c 000) 16