FX Series Programmable Controllers

Devices in Detail 4

4.15.2Floating Point Format

Floating point format extends the abilities and ranges provided by Scientific Notation with the ability to represent fractional portions of whole numbers, for example;

Performing and displaying the calculation of 22 divided by 7 would yield the following results:

a)Normal FX operation using decimal (integers) numbers would equal 3 remainder 1

b)In floating point it would equal 3.14285 (approximately)

c)In Scientific format this calculation would be equal to 3142 10 -3

So it can be seen that a greater degree of accuracy is provided by floating point numbers, i.e. through the use of larger numerical ranges and the availability of more calculable digits. Hence, calculations using floating point data have some significant advantages. Decimal data can be converted in to floating point by using the FLT, float instruction (FNC 49). When this same instruction is used with the float fag M8023 set ON, floating point numbers can be converted back to decimal. see page 5-49 for more details.

The following points should be remembered about the use of Floating Point within appropriate FX units;

Floating point numbers, no matter what numerical value, will always occupy two consecu- tive data registers (or 32 bits).

Floating point values cannot be directly monitored, as they are stored in a special format recommended by the I.E.E.E (Institute of Electrical and Electronic Engineers) for personal and micro computer applications.

Floating point numbers have both mantissa and exponents (see Scientific Notation for an explanation of these terms). In the case of floating point exponents, only 8 bits are used.

Additionally there is a single sign bit for the mantissa. The remaining bits of the 32 bit value, i.e. 23 bits, are used to ‘describe’ the mantissa value.

 

 

FX Data Register Contruction

 

 

 

Data register ’D+1’

 

Data register ’D’

 

b15

 

(16 bits)

b0 b15

(16 bits)

b0

 

Exponet

Mantissa

 

 

(8 bits)

(23 bits)

 

Sign bit

Floating Point Format

 

 

 

 

Valid ranges for floating point numbers as used in FX Main Processing Units:

 

 

 

 

 

 

 

 

Description

Sign

Exponent

Mantissa

Remark

 

 

(bit pattern)

(bit pattern)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

11111111111111111111111

Largest number +/- 3.403 1038

 

 

 

0 or 1

11111110

11111111111111111111110

 

 

Normal Float

Accuracy: 7 significant figures

 

 

00000001

00000000000000000000001

 

 

 

 

Smallest number +/- 1.175 10-38

 

 

 

 

 

00000000000000000000000

 

 

 

 

 

 

 

 

 

Zero

0 or 1

00000000

00000000000000000000000

All digits are 0 (zero)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

4-45

Page 119
Image 119
Mitsubishi Electronics FX1S manual Floating Point Format