negate method

FixedPoint negate()

Negate the FixedPoint.

Implementation

FixedPoint negate() {
  final val = ~this + 1;
  return FixedPoint._(
      Logic(width: integer.width)..gets(val.getRange(fractionWidth)),
      Logic(width: fraction.width)..gets(val.slice(fractionWidth - 1, 0)),
      signed);
}