Texas Instruments TMS320C3x User Manual

Page 120

Advertising
background image

Floating-Point Conversion (IEEE Std. 754)

5-15

Data Formats and Floating-Point Operation

Figure 5–15. TMS320C3x Single-Precision 2s-Complement Floating-Point Format

e

f

31

23

22

0

24

s

Note:

Same format as for the ’C4x

In comparison, Figure 5–15 shows the the ‘C3x 2s-complement floating-point
format. In this format, two cases can be used to define value

v of a number:

1)

If

e = –128

then

v = 0

2)

If

e

–128

then

v = ss.f

2



2

e

where:

s = sign bit

e = the exponent field

f = the fraction field

For this representation,

e is treated as a 2s-complement integer. The fraction

and sign bit form a normalized 2s-complement mantissa.

Note:

Differentiating Symbols for IEEE and TMS320C3x Formats

To differentiate between the symbols that define these two formats, all IEEE
fields are subscripted with an IEEE (for example,

e

IEEE

,

s

IEEE

, and so forth).

Similarly, all 2s-complement fields are subscripted with 2 (that is,

e

2

,

s

2

,

f

2

).

5.4.1

Converting IEEE Format to 2s-Complement TMS320C3x Floating-Point Format

The most common conversion is the IEEE-to-2s-complement format. This
conversion is done according to rules in Table 5–1.

Table 5–1. Converting IEEE Format to 2s-Complement Floating-Point Format

If these values are present

Then these values equal

Description

Case

e

IEEE

s

IEEE

f

IEEE

e

2

s

2

f

2

max neg

1

1

255

1

any

7Fh

1

00 0000h

max pos

1

2

255

0

any

7Fh

0

7F FFFFh

3

0 < e

IEEE

< 255

0

f

IEEE

e

IEEE

– 7Fh

0

f

IEEE

4

0 < e

IEEE

< 255

1

0

e

IEEE

– 7Fh

1

f

IEEE

+ 1

5

0 < e

IEEE

<255

1

0

e

IEEE

– 80h

1

0

zero

6

0

any

any

80h

0

00 0000h

† f IEEE = 1s complement of fIEEE

Advertising