OneHotToBinary constructor
By default, creates an instance of a CaseOneHotToBinary for smaller widths and a TreeOneHotToBinary for larger widths.
Implementation
factory OneHotToBinary(Logic onehot,
{bool generateError = false, String name = 'one_hot_to_binary'}) {
final isSmall = onehot.width <= 8;
if (!isSmall && generateError) {
throw RohdHclException(
'Tree implementation does not generate error signal.');
}
return isSmall
? CaseOneHotToBinary(onehot, generateError: generateError, name: name)
: TreeOneHotToBinary(onehot, name: name);
}