Posit sign and unsigned magnitude #
Posit negation is two's complement over the complete encoded word. Field decoding works on the corresponding unsigned magnitude, so this module isolates the representation laws connecting the two views.
Negate a posit by taking the two's complement of its entire encoded word.
This operation fixes both zero and NaR and exchanges every positive finite code with its negative counterpart, exactly as specified by the posit encoding.
Instances For
Whether the encoded sign bit is set.
Instances For
Sign-bit inspection is unsigned comparison with the descriptor's sign mask.
An in-range word below the sign mask has a clear sign bit.
Unsigned magnitude word used to decode the regime and trailing fields.
Negative posit encodings are the two's complement of the corresponding positive word.
Instances For
A nonnegative in-range encoding is its own unsigned decoding magnitude.
Every posit other than NaR has unsigned magnitude strictly below the sign mask.
Every nonzero posit has nonzero unsigned magnitude.