The C2000 microprocessor with C28x+FPU architecture adds some registers and instructions to the original C28x fixed-point CPU to support IEEE single-precision floating-point operations. For programs written on fixed-point microprocessors, the floating-point C2000 is also fully compatible and does not require changes to the program. Floating-point processors have the following advantages over fixed-point processors: - Easier programming
- Better performance, for example, algorithms such as division, square root, FFT and IIR filtering have higher computational efficiency.
- The program is more robust.
Floating point numbers in IEEE754 format The single-precision floating point number of C28x+FPU follows the IEEE754 format. It includes: - 1-bit sign bit: 0 represents a positive number, 1 represents a negative number.
- 8-digit code
- 23-digit mantissa
[color=#000 000]31 | 30 23 | 220
| 符号位 | 阶码 | 尾数 |
表1:IEEE单精度浮点数 符号位S
| 阶码E
| 尾数M
| 值
| 0
| 0
| 0
| 正0
| 1
| 0
| 0
| 负0
| 0或1
| 0
| 非0
| 非规格化数(1)
| 0
| 1-254
| 0x00000-0x7FFFF
| 正常范围正数(2)
| 1
| 1-254
| 0x00000-0x7FFFF
| 正常范围负数(2)
| 0
| 255
| 0
| 正无穷大
| 1 | 255 | 0 | [backcolor= white]negative infinity | [size =4]0 or 1 | 255 | non-0 [/backcolor ] | Not a numerical value (NaN) [/td][/tr ] |
(1) The non-normalized value is very small, and the calculation formula is (-1)sx2(E -126)x0.M [backcolor= white](2) The formula for calculating the normal range value is (-1)sx2(E-127)x1.M [ Normal range values fall within the range of ± ~1.7 x 10 -38 to ± ~3.4 x 10 +38. As can be seen from Table 1, the IEEE754 standard includes: =white]Standard data formats and special values, such as non-numeric values (NaN) and infinity Standard Rounding modes and floating point operations Multiple platform support, including Texas Instruments C67x series chips. C2000 has made some simplifications to the standard. : - The status flag and comparison operation are not Distinguish between positive and negative 0
- Denormalized values are considered to be 0[ /color]
- Non-numeric values (NaN) are treated the same way as infinity.
The IEEE754 standard has five rounding modes, and C28x+FPU only supports two of them: [/ backcolor] --Truncation: decimal places Regardless of size, discard all [backcolor=white ]--Round to the nearest even number: In this mode, if the decimal place is less than 5, it will be discarded, and if it is greater than 5, it will be rounded up. If the decimal place is 5, it will be rounded to the nearest even number. Table 2 shows The impact of different rounding modes on data. The C28x+FPU compiler configures the microprocessor to round to even mode by default [1]. Table 2: Examples of different rounding modes Mode/ Actual value +11.5 +12.5 align=center]11.5 | 12.5 | Round to nearest Round to even + 12.0 + 12.0 ] 12.0 | 12.0 | Round to nearestRound away from 0 | +12.0 | +13.0 | 12.0 | 13.0 | Truncate | +11.0 | +12.0 | 11.0 | 12.0 | Round up | +12.0 | +13.0 | 11.0 | 12.0 | Round down | +11.0 | +12.0 | 12.0 | 13.0 |
|