signExtend method
- int newWidth
override
Returns a new Logic width width newWidth
where new bits added are sign
bits as the most significant bits. The sign is determined using two's
complement, so it takes the most significant bit of the original signal
and extends with that.
The newWidth
must be greater than or equal to the current width or
an exception will be thrown.
Implementation
@override
Logic signExtend(int newWidth) => packed.signExtend(newWidth);