CompoundAdder constructor

CompoundAdder(
  1. Logic a,
  2. Logic b, {
  3. Logic? carryIn,
  4. String name = 'compound_adder',
  5. String? definitionName = 'compound_adder',
})

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);
}