Negative decimal values – Rockwell Automation 1747-PT1, D1747NP002 Hand-Held Terminal User Manual
Page 450

Appendix B
Number Systems, Hex Mask
B–2
Other examples:
16 bit pattern = 0000 1001 0000 1110
2
=
2
11
+ 2
8
+ 2
3
+ 2
2
+ 2
1
= 2048
+
256
+
8
+
4
+
2
= 2318
16 bit pattern = 0010 0011 0010 1000
2
=
2
13
+ 2
9
+ 2
8
+ 2
5
+ 2
3
= 8192
+
512
+
256
+
32
+
8
= 9000
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 figure below all positions are
1, and the value is 32767 – 32768 = –1.
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
1
1
1 1
1
1
1 1
1
1
1 1
1
1
1 1
16384
8192
4096
2048
1024
512
256
128
64
32
16
8
4
2
1
32767
1x2
15
= 32768
This position is always 1 for negative numbers.
+
The negative binary number may be converted to decimal as follows:
16 bit pattern = 1111111111111111
2
=
( 2
14
+ 2
13
+ 2
12
+ 2
11
+ 2
10
+ 2
9
+ 2
8
+ 2
7
+ 2
6
+ 2
5
+ 2
4
+ 2
3
+ 2
2
+ 2
1
+ 2
0
) – 2
15
= ( 16384
+
8192
+
4096
+
2048
+
1024
+
512
+
256
+
128
+
64
+
32
+
16
+
8
+
4
+
2
+
0 )
–
32768
=
32767
–
32768
=
–1