Hey Guys,
I am doing some changes on an older omron CJ2M plc using CX programmer. I am adding an ethernet device that is actually using a Two's Complement method. This is the first time I have ever seen this and it is very odd. Any suggestions to convert this to a regular signed dint?
The first digit is a sign, but when the sign is high everything is negitive and off by one.
EX.
5
0000 0101
-5
11111011
For the -5 you have to invert the bits then add 1.
Here is a calculator to show how it works:
https://www.exploringbinary.com/twos-complement-converter/
Please help!
I am doing some changes on an older omron CJ2M plc using CX programmer. I am adding an ethernet device that is actually using a Two's Complement method. This is the first time I have ever seen this and it is very odd. Any suggestions to convert this to a regular signed dint?
The first digit is a sign, but when the sign is high everything is negitive and off by one.
EX.
5
0000 0101
-5
11111011
For the -5 you have to invert the bits then add 1.
Here is a calculator to show how it works:
https://www.exploringbinary.com/twos-complement-converter/
Please help!