LeadingZeroAnticipate constructor
Construct a leading-zero anticipate module that predicts the number of
leading zeros in the operation on a
and b
(ones-complement addition or
subtraction). Pairs of prediction outputs (leadingOne/validLeadOne and
leadingOneConverse/validLeadOneConverse) for the operation on a
and
b
inputs are produced. These appropriate prediction pair can be selected
outside the module by looking at the end-around-carry of a
ones-complement: Essentially, leadingOne should be used if a
b
(e.g., there is a carry output from a ones-complement subtraction of
a
and b
. leadingOneConverse should be used if b
>= a
during
subtraction.
Implementation
LeadingZeroAnticipate(super.aSign, super.a, super.bSign, super.b,
{super.name = 'leading_zero_anticipate',
super.reserveName,
super.reserveDefinitionName,
String? definitionName})
: super(definitionName: definitionName ?? 'LeadingDigitAnticipate') {
leadingOne <= leadOneEncoder.out;
validLeadOne <= leadOneEncoder.valid!;
addOutput('leadingOneConverse', width: leadOneEncoderConverse.out.width);
leadingOneConverse <= leadOneEncoderConverse.out;
addOutput('validLeadOneConverse');
validLeadOneConverse <= leadOneEncoderConverse.valid!;
}