EasyManua.ls Logo

LS Industrial Systems XBC-E Series - 2) Expression of integer numbers

LS Industrial Systems XBC-E Series
542 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Appendix 1 Numeric System & Data Structure
XBC E-Type Main Unit Appendix 1-6 Ver. 1
2) Expression of integer numbers
XGB instructions are based on negative operation system (Signed).
If the highest bit (MSB) is 0, it is a positive number; if it is 1, it is a negative number.
The highest bit expressing a negative or a positive number is called the Sign bit.
Since the position of MSB is different in 16 bits and 32 bits, pay attention to the position of Sign bit.
In case of 16 bits
In case of 32 bits
3) Expression of negative number
Ex.) How to mark 0001
(1) Take out the negative sign and mark 0001. (b15=1)
b15 b0
1 0 ~ 0 1
(2) Reverse the result of (1). (b15 = excepted)
b15 b0
1 1 ~ 1 0
(3) Add +1 to the result of (2).
b15 b0
1 1 ~ 0 1
-0001 = hFFFF

Table of Contents

Related product manuals