LeadingZeroAnticipate constructor

LeadingZeroAnticipate(
  1. Logic aSign,
  2. Logic a,
  3. Logic bSign,
  4. Logic b, {
  5. String name = 'leading_zero_anticipate',
  6. bool reserveName = false,
  7. bool reserveDefinitionName = false,
  8. String? definitionName,
})

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