Chapter 8 Logic Instructions
The rule that Bit-string data are converted into Boolean data is as the following table shows.
The value of In corresponds to the value of Out
BYTE BOOL
WORD BOOL
DWORD BOOL
16#0000_0001~16#FFFF_FFFF
LWORD BOOL
16#0000_0000_0000_0001~
16#FFFF_FFFF_FFFF_FFFF
TRUE
Bit string to Bit string
Bit-string data can be converted to Bit-string data. And some instructions are shown below.
There are two kinds of conversion for different types of bit-string data. One is the conversion of
the less-length data to the greater-length data. The other is the conversion of the greater-length
data to the less-length data.
The less-length data is converted to the greater-length data by writing the values of all bits of
the less-length data to corresponding bits of the greater-length data and setting the values of
the remaining bits of the greater-length data to 0.
See the following example that the Byte data in In is converted to the Word data in Out. The
values of Bit0~Bit7 of In are copied and pasted to Bit0~Bit7 of Out. And the values of Bit8~Bit15
of Out are set to 0.
The greater-length data are converted to the less-length data by revising the values of all bits of
the less-length data into the values of the corresponding bits of the greater-length data and the
values of the remaining bits of the greater-length data are not converted and have no impact on
the conversion.
See the following example that the Word data In is converted to the Byte data Out. The values
of Bit0~Bit7 of In are copied and pasted to Bit0~Bit7 of Out. And the values of Bit8~Bit15 of In
are not converted and have no impact on the conversion.
BYTE_TO_WORD
EN ENO
OutIn
10101101
00000000
Bit0Bit7
In
Out
Fill 0
The less-length data are converted
to the greater-length data
10101101
Bit8Bit15
BYTE
WORD
8-153