PartialProductGenerator constructor
- Logic multiplicand,
- Logic multiplier,
- RadixEncoder radixEncoder, {
- bool signed = false,
- Logic? selectSigned,
Construct a PartialProductGenerator -- the partial product matrix
Implementation
PartialProductGenerator(
Logic multiplicand, Logic multiplier, RadixEncoder radixEncoder,
{this.signed = false, this.selectSigned}) {
if (signed && (selectSigned != null)) {
throw RohdHclException('sign reconfiguration requires signed=false');
}
encoder = MultiplierEncoder(multiplier, radixEncoder,
selectSigned: selectSigned, signed: signed);
selector = MultiplicandSelector(radixEncoder.radix, multiplicand,
selectSigned: selectSigned, signed: signed);
if (multiplicand.width < selector.shift) {
throw RohdHclException('multiplicand width must be greater than '
'${selector.shift}');
}
if (multiplier.width < (selector.shift + (signed ? 1 : 0))) {
throw RohdHclException('multiplier width must be greater than '
'${selector.shift + (signed ? 1 : 0)}');
}
_build();
signExtend();
}