Parameterization via TRWinProg
TR-Electronic GmbH 2018, All Rights Reserved
Printed in the Federal Republic of Germany
Page 60 of 67
TR-ECE-BA-DGB-0141 v03
03/19/2021
Output left-justified
Programmed
Number of data bits
= 22
MSB
LSB MSB
LSB
1
– 22
23
24
25
26
1
– 22
23
24
25
26
P 2
21
– P 2
0
S1 S2 S3 S4
P 2
21
– P 2
0
S1 S2 S3 S4
Data word 1
Data word 2
5.2.5 Negative values
Selection
Description
Default
Complement
–Max. value/2 to +Max. value/2 – 1
X
Sign + value
Sign=1 Max. value/2
– 1 to Sign=0 Max. value/2 – 1
With negative numbers, the most significant position bit, which is used as the sign, is
set in both forms of representation. So that the number range isn't limited thereby, an
additional data bit is needed. The following table compares the complement
representation and signed representation for binary and BCD code with 16 bits:
Value
complement Sign BCD + Complement
BCD + Sign
2
0x0002
0x0002
0x0002
0x0002
1
0x0001
0x0001
0x0001
0x0001
0
0x0000
0x0000
0x0000
0x0000
-1
0xFFFF
0x8001
0x9999
0x8001
-2
0xFFFE
0x8002
0x9998
0x8002
-3
0xFFFD
0x8003
0x9997
0x8003