Floating-point numbers are also called "real numbers", and a floating-point number consists of three parts
- Sign Bit (S)
- Order Code
- Valid numbers
S: Order Code: Valid numbers
Floating-point numbers are represented by the science two-level system.
Three types of floating-point numbers:
- Short floating point (32bit): S (BIT31): Order Code (BIT30~BIT23): Valid number (BIT22~BIT0)
- Long floating point (64bit): S (BIT63): Order Code (BIT62~BIT52): Valid number (BIT51~BIT0)
- Temporary character point (80bit): S (bit79): Order Code (BIT78~BIT64): Valid number (BIT63~BIT0)
Floating-point conversion
1. Convert 10 binary to binary number
2. Normalize the binary number
3. Calculate the Order Code
4. Store this number in floating-point format
For example: floating point 100.2510, to a single-precision floating point number
1.100.25 = 1100100.01
2.1100100.01 = 1.10010001 x 2^6
3.110 + 0111111 = 10000101
4. Sign bit = 0
Order Code = 10000101
Valid number = 1001 0001 0000 0000 0000 000
Floating point (IEEE-754)