Topic: DMD0020

Help File Version: 2.10.0.636

SUMBITS - Sum Bits


The Sum Bits (SUMBITS) instruction is used to count the number of bits in the Input Value location that are set to 1.

 

 


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.

 

Input Value is the numeric memory location (e.g. D0, WX7, etc.) or bit location with a numeric cast (e.g. C0:W, C8:B, X16:W, etc.), or constant value to scan. Bit locations with a cast operator must begin on the appropriate boundary, :B casts must begins on a Byte boundary, :W casts must begin on a Word boundary.

 

Output Value is a numeric memory location to store the number of 1's found in the Input Value. This can be any writable numeric memory location.

 


See Also:

SUMBITS - Sum Bits

 


Related Topics:

DECO - Decode to Set Bit

 

ENCO - Encode Bit Position

 

MATH - Count If Equal

 


Rung Example: