Topic: DMD0018

Help File Version: 2.10.0.636

ENCO - Encode Bit Position


The Encode Bit Position instruction (ENCO) will locate the first bit that is ON in a 32-bit location starting at the least significant bit. For example, for the following bit string: "0000 0000 0000 0000 0001 0000 0000 0000" the Output Bit Position Value is 12. If the Bit Pattern has more than one bit position set to a "1", the position of the least significant "1" will be encoded.

 

 


Parameters:

Note: Use the F9 key or click the 'three dot box' at the right edge of the parameter field to open the Default Element Selection Tool (the Element Picker or the Element Browser) or use the Down-Arrow key (Auto-Complete) on any parameter field to see a complete list of the memory locations that are valid for that parameter of the instruction.

 

Bit Pattern specifies the numeric memory location that contains the source bit string. This can be any constant value or any readable numeric location.

 

Output Bit Position Value specifies a numeric memory location to store the bit position value. This can be any writable numeric location.

 


See Also:

DECO - Decode to Set Bit

 

ENCO - Encode Bit Position

 


Related Topics:

SUMBITS - Sum Bits

 

MATH - Count If Equal

 

MATH - << (Shift Left)

 


Rung Example: