CompoundAdder constructor
Takes in input a
and input b
and return the sum as well as
sumP1 which is sum plus 1.
The width of input a
and b
must be the same, both sum and
sumP1 are one wider than the inputs.
Implementation
CompoundAdder(super.a, super.b,
{Logic? carryIn,
super.name = 'compound_adder',
super.definitionName = 'compound_adder'}) {
if (a.width != b.width) {
throw RohdHclException('inputs of a and b should have same width.');
}
if (carryIn != null) {
throw RohdHclException("we don't support carryIn");
}
addOutput('sumP1', width: a.width + 1);
}