LeadingZeroAnticipateCarry constructor
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!);
}