5.3.3
Single-Precision Floating-Point Format
Figure 5–8. Single-Precision Floating-Point Format
The following examples illustrate the range and precision of the 'C32 short
floating-point format for external 16-bit data:
Most positive:
x = (2–2
Least positive
x = 1
Least negative:
x = (–1–2
Most negative:
x = (–2
Note that the floating-point instructions (such as LDF, MPYF, ADDF) and the
integer instructions (such as LDI, MPYI, ADDI) produce different results when
accessing the same memory location. The integer load instructions store the
value in the LSBs of the 'C32's registers. A bit field in the strobe control register
controls sign extension or zero fill of the MSBs of the integer value. On the other
hand, the floating-point load instructions store the value in the MSBs of the
'C32's registers. For example:
If AR1 = 4000h, R1 = 00 0000 0000h, the value stored at memory location
4000h is 0180h, and STRB0 is configured for a physical memory size and data
type size of 16 bits.
The result of: ADDI *AR1,R1
The result of: ADDF *AR1,R1 is R1 = 01 C0000000h (= – 3.0), since
In the single-precision format, the floating-point number is represented by an
8-bit exponent field ( e ) and a 2s-complement 24-bit mantissa field ( man ) with
an implied most significant nonsign bit (see Figure 5–8).
31
24 23
Exponent
Sign
Operations are performed with an implied binary point between bits 23 and 22.
When the implied most significant nonsign bit is made explicit, it is located to
the immediate left of the binary point. The floating-point number x is given by
the following:
e
x = 01.f
2
if s = 0
e
x = 10.f
2
if s = 1
x = 0
if e = – 128
–8
127
)
2
= 3.3961775
–127
2
= 5.8774717541
–8
–127
)
2
= –5.9004306
127
2
) = –3.4028236
is R1 = 00 0000 0180h, while
– 4.0 + 1.0 = – 3.0
22
Mantissa
Data Formats and Floating-Point Operation
Floating-Point Formats
38
10
–39
10
–39
10
38
10
Fraction
0
5-7
Need help?
Do you have a question about the TMS320C3x and is the answer not in the manual?