OneHotToBinary.base constructor
Constructs a Module which decodes a one-hot number onehot
into a 2s
complement number binary by encoding the position of the '1'.
Implementation
OneHotToBinary.base(Logic onehot,
{this.generateError = false, super.name = 'one_hot_to_binary'}) {
onehot = addInput('onehot', onehot, width: onehot.width);
addOutput('binary', width: max(log2Ceil(onehot.width), 1));
if (generateError) {
addOutput('error');
}
}