3 . I n s t r u c t i o n S e t
M N050 03003E F or mo re infor ma tio n vi sit:
w w w. e a t o n . c o m
3-23
S
exponent
mantissa
8-bit
23-bit
b31
Sign bit
0: positive
1: negative
b0
The range of a 32-bit floating point value is from ±2
-126
to
±2
+128
, i.e. from ±1.1755×10
-38
to
±3.4028×10
+38
.
Example 1: using 32-bit floating point to represent decimal number 23
Step 1: convert 23 to binary number: 23.0=10111
Step 2: Normalizing the binary: 10111=1.0111 × 2
4
,
0111 is mantissa and 4 is an exponent.
Step 3: get exponent: E
∵
-B=4
→
E-127=4 E=131=10000011
∴
2
Step 4: We can now combine the sign, exponent, and normalized mantissa into the binary IEEE
short real representation.
0 100
0001
1 011
1000
0000
0000
0000
0000
2
=41B80000
16
Example 2: using 32-bit floating point to represent decimal number –23
The conversion steps are the same as decimal number 23. Only need to modify sign bit from 0 to 1
to get value.
1 100
0001
1 011
1000
0000
0000
0000
0000
2
=C1B80000
16
ELC also uses two registers with continuous number to store binary floating point. The following is
the example that uses register (D1, D0) to store binary floating point.
S
E7
E6
E5
E1
E0 A22 A21 A20
A6
A5
A4
A3
A2
A1
A0
b0
b1
b2
b3
b4
b5
b6
b20
b21
b22
b23
b24
b28
b29
b30
b31
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
7
6
5
1
0
-1
-2
-3
-17
-18
-19
-20
-21
-22
-23
D1(b15~b0)
D0(b15~b0)
E0~E7=0 or 1
A0~A22=0 or 1
8 bits of exponent
23 bits of constant
sign bit (0: positive 1:negative)
When b0~b31 is 0, the content is 0.
Decimal Floating Point
1.
Binary floating point is not practical for most applications, therefore, binary floating point
format can be converted to decimal floating point format for performing floating point math..
2.
Decimal floating point values are stored in two consecutive registers. The least significant
register is where the constant value (mantissa) is stored and the upper register is where the
exponent is stored.
For example, using registers (D1, D0) to store a decimal floating point value.
Decimal floating point = [constant D0] X 10
[exponent D1 ]
constant D0 = ±1,000~±9,999, exponent D1 = - 41~+35
Содержание ELC-PB
Страница 1: ......
Страница 5: ...For more information visit www eaton com MN05003003E iv...
Страница 29: ...ELC Programming Manual For more information visit www eaton com MN05003003E 1 24 MEMO...
Страница 502: ...3 Instruction Set MN05003003E For more information visit www eaton com 3 333...
Страница 601: ...ELC Programming Manual For more information visit www eaton com MN05003003E 3 432...
Страница 625: ...ELC Programming Manual For more information visit www eaton com MN05003003E 3 456...