addStopSignFlip method

void addStopSignFlip(
  1. List<Logic> addend,
  2. SignBit sign
)

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 (!signed) {
    addend.add(sign);
  } else {
    addend.last = SignBit(~addend.last, inverted: true);
  }
}