Conversion between floating-point formats, 6 conversion between floating-point formats – Texas Instruments TMS320C3x User Manual

Page 117

Advertising
background image

Floating-Point Formats

5-12

5.3.6

Conversion Between Floating-Point Formats

Floating-point operations assume several different formats for inputs and out-
puts. These formats often require conversion from one floating-point format to
another (for example, short floating-point format to extended-precision floating-
point format). Format conversions occur automatically in hardware, with no
overhead, as a part of the floating-point operations. Examples of the four con-
versions are shown in Figure 5–10 through Figure 5–13. When a floating-point
format 0 is converted to a greater-precision format, it is always converted to a
valid representation of 0 in that format. In Figure 5–10 through Figure 5–13,
s = sign bit of the exponent, y = short mantissa, and x = short exponent.

Figure 5–10. Converting from Short Floating-Point Format to Single-Precision

Floating-Point Format

Short floating-point format

Single-precision floating-point format

y

y

0

0

y

x

s s

y

y

y

x

x

s

15

12

11

10

0

31

27

24

23

22

12

11

0

x

s s s

x x

In this format, the exponent field is sign extended, and the 12 LSBs of the mantissa
field are filled with 0s.

Figure 5–11. Converting from Short Floating-Point Format to Extended-Precision

Floating-Point Format

Short floating-point format

Extended-precision floating-point format

y

0

0

y

y

y

15

12

11

10

0

39

35

32

30

31

20 19

0

s s

x

x

s

x

s s s

y

y

x x x

The exponent field in this format is sign extended, and the 20 LSBs of the mantissa
field are filled with 0s.

Advertising