Publication 1763-RM001C-EN-P - October 2009
580
Number Systems
Negative Decimal Values
The 2s complement notation is used. The far left position is always 1 for
negative values. The equivalent decimal value of the binary number is
obtained by subtracting the value of the far left position, 32768, from the
sum of the values of the other positions. In the following figure, the value
is 32767 - 32768 = -1. All positions are 1.
Another example:
1111 1000 0010 0011 =
(2
14
+2
13
+2
12
+2
11
+2
5
+2
1
+2
0
) - 215 =
(16384+8192+4096+2048+32+2+1) - 32768 =
30755 - 32768 = -2013.
An often easier way to calculate a value is to locate the last 1 in the string
of 1s beginning at the left, and subtract its value from the total value of
positions to the right of that position. For example,
1111 1111 0001 1010 = (24+23+21) - 28 = (16+8+2) - 256 = -230.
1x2
14
= 16384
1x2
13
= 8192
1x2
12
= 4096
1x2
11
= 2048
1x2
10
= 1024
1x2
9
= 512
1x2
8
= 256
1x2
7
= 128
1x2
6
= 64
1x2
5
= 32
1x2
4
= 16
1x2
3
= 8
1x2
2
= 4
1x2
1
= 2
1x2
0
= 1
0 1 1 1
1 1 1 1
1 1 1 1
1 1 1 1
32767
0x2
15
= 0 This position is always zero for positive numbers.
efesotomasyon.com - Allen Bradley,Rockwell,plc,servo,drive