addStopSignFlip method
Helper function for sign extension routines:
For signed operands, flip the MSB, otherwise add this sign
bit.
Implementation
void addStopSignFlip(List<Logic> addend, SignBit sign) {
if (!signedMultiplicand) {
if (selectSignedMultiplicand == null) {
addend.add(sign);
} else {
addend.add(SignBit(mux(selectSignedMultiplicand!, ~addend.last, sign),
inverted: selectSignedMultiplicand != null));
}
} else {
addend.last = SignBit(~addend.last, inverted: true);
}
}