omron — BAND operator

BAND operator BAND operator Syntax ...value BAND value... Function Perform the binary AND operation on two values. Usage Considerations The BAND operation is meaningful only when performed on integer values. Only the integer parts of real values are used. Any fractional parts are ignored. Details The BAND operator can be used to perform a binary AND operation on two values on a bit-by- bit basis, resulting in a real value. Specifically, the BAND operation consists of the following steps: 1. Convert the operands to sign-extended 32-bit integers, truncating any fractional part. 2. Perform a binary AND operation (see below). During the binary AND operation, 3.

Convert the result back to a real value. c = a BAND b the bits in the resultant C are determined by comparing the corresponding bits in the operands A and B as indicated in the following table. That is, a bit in the result will be 1 if the corresponding bit in both of the operands is 1. eV+Language Reference Guide, v2.x, 18319-000 Rev A Page 78 For each bit in: a b c 0 0 -> 0 0 1 -> 0 1 0 -> 0 1 1 -> 1