Installation manual

Publication 1747-RM001G-EN-P - November 2008
F-6 Number Systems
Binary Floating-point
Arithmetic
The SLC 5/03, OS301 and higher, SLC 5/04, and SLC 5/05 processors
support the use of floating-point. Use floating-point when you want to
manipulate numbers outside of the range 32768 to +32767 or for a resolution
finer than one unit. For example, 2.075. Floating-point arithmetic does not
support non-normalized, Not a Number (NaN), and infinity. The valid range
for a floating-point number is ±3.40282 x 10
38
to ±1.17550 x 10
-38
The following example shows the representation of a floating-point number
using the IEEE 754 standard for Single precision floating-point.
The following is the spatial representation of the 32 bits in the register.
When converting to floating-point arithmetic, the following must occur.
1. The sign bit must be set. If the number is positive, then the sign bit is 0
or Off. If the number is negative, then the sign bit is 1 or On.
2. The exponent must be normalized. Do this by always adding +127 to
the exponent.
3. The mantissa must be normalized. For example, the binary value of
1010.01 equals 1.01001
4. The fraction must be extracted from the mantissa. For example, the
fractional part of 1.01001 is .01001.
The 32-bit floating-point representation of 10.25 decimal equals:
0 10000010 01001000000000000000000
sign
bit
exponent fraction
sxxxxxxxxmmmmmmmmmmmmmmmmmmmmmmm
where:
s = sign
x = exponent
m = mantissa