30
The following table shows the corresponding decimal, 16-bit hexadecimal, and
32-bit hexadecimal values.
Decimal
16-bit Hex
32-bit Hex
2147483647
2147483646
.
.
.
32768
32767
32766
.
.
.
2
1
0
–1
–2
.
.
.
–32767
–32768
–32769
.
.
.
–2147483647
–2147483648
–––
–––
.
.
.
–––
7FFF
7FFE
.
.
.
0002
0001
0000
FFFF
FFFE
.
.
.
8001
8000
–––
.
.
.
–––
–––
7FFFFFFF
7FFFFFFE
.
.
.
00008000
00007FFF
00007FFE
.
.
.
00000002
00000001
00000000
FFFFFFFF
FFFFFFFE
.
.
.
FFFF8001
FFFF8000
FFFF7FFF
.
.
.
80000001
80000000
Positive signed binary data is identical to unsigned binary data (up to 32,767)
and can be converted using BIN(100). The following procedure converts nega-
tive decimal values between –32,768 and –1 to signed binary. In this example
–12345 is converted to CFC7.
Bit number
Contents
0
0
1
1
0
0
0
0
0
0
1
1
1
0
0
1
15
14
13
12
11
10
09
08
07
06
05
04
03
02
01
00
1. First take the absolute value (12345) and convert to unsigned binary:
Bit number
Contents
1
1
0
0
1
1
1
1
1
1
0
0
0
1
1
0
15
14
13
12
11
10
09
08
07
06
05
04
03
02
01
00
2. Next take the complement:
Bit number
Contents
1
1
0
0
1
1
1
1
1
1
0
0
0
1
1
1
15
14
13
12
11
10
09
08
07
06
05
04
03
02
01
00
3. Finally add one:
Reverse the procedure to convert negative signed binary data to decimal.
Converting Decimal to
Signed Binary
Data Area Structure
Section 3-2