LeadingZeroAnticipateCarry constructor

LeadingZeroAnticipateCarry(
  1. Logic aSign,
  2. Logic a,
  3. Logic bSign,
  4. Logic b, {
  5. required Logic endAroundCarry,
  6. String name = 'leading_zero_anticipate_carry',
  7. String? definitionName,
})

Construct a leading-zero anticipate module that predicts the number of leading zeros in the addition or subtraction of a and b. Provide the endAroundCarry from the ones-complement operation to select the proper prediction pair. and output as leadingOne and validLeadOne.

Implementation

LeadingZeroAnticipateCarry(super.aSign, super.a, super.bSign, super.b,
    {required Logic endAroundCarry,
    super.name = 'leading_zero_anticipate_carry',
    String? definitionName})
    : super(definitionName: definitionName ?? 'LeadingDigitAnticipate') {
  endAroundCarry = addInput('endAroundCarry', endAroundCarry);

  leadingOne <=
      mux(endAroundCarry, leadOneEncoder.out, leadOneEncoderConverse.out);
  validLeadOne <=
      mux(endAroundCarry, leadOneEncoder.valid!,
          leadOneEncoderConverse.valid!);
}