MotoHawk:Blocks:Find

From MotoHawk
Jump to navigationJump to search

Find First

This MotoHawk™ block, given a set of Booleans, finds the first one that is set to true, and puts out the index of that input, with index starting with 0.

Block ID

Find First

Library

MotoHawk_lib/Extra Development Blocks

Description

Find.PNG

If no input is set to true, the output is -1. The option, 'Input as Vector', performs the same operation on a vector of Booleans, instead of individual ports. When 'Input as Vector' is unchecked, the operation can be vectorized. When 'Input as Vector' is checked, set 'Number of Inputs' to -1, to let the vector width be dynamically determined by downstream blocks, or provide a number to constrain the size.

Block Parameters

Parameter Field Values Comments/Description
Number of Inputs Positive Integer Set number of input ports
Input as Vector Check box (enable) Select to perform same operation on a vector (array) of Boolean values).