5.2.5 Negative values
Selection
Complement
Sign + value
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
2
1
0
-1
-2
-3
Printed in the Federal Republic of Germany
07/23/2024
Description
–Max. value/2 to +Max. value/2 – 1
Sign=1 Max. value/2 – 1 to Sign=0 Max. value/2 – 1
Binary + complement Binary + Sign BCD + Complement
0x0002
0x0001
0x0000
0xFFFF
0xFFFE
0xFFFD
TR-ECE-BA-DGB-0141 v06
0x0002
0x0002
0x0001
0x0001
0x0000
0x0000
0x8001
0x9999
0x8002
0x9998
0x8003
0x9997
BCD + Sign
0x0002
0x0001
0x0000
0x8001
0x8002
0x8003
TR-Electronic GmbH 2018, All Rights Reserved
Page 57 of 64