Tapered posit field decoding #
Posit field decoding recovers the variable-length regime, tapered exponent, fraction,
significand, and binary scale from a model word. The resulting DecodedFields structure is the
common proof-facing boundary for exact semantics and optimized arithmetic.
Count a leading run in exactly width low bits of value, starting at bit width - 1.
Instances For
A leading run cannot consume more bits than the width being inspected.
Inspecting a nonempty word from its actual first bit finds a nonempty run.
First regime bit in the magnitude payload.
Instances For
Number of equal leading regime bits.
Instances For
The tapered regime consumes at most the complete payload.
Every posit word has a nonempty leading regime run.
Whether an opposite regime-terminator bit is present.
Instances For
Bits available after the regime and its optional terminator.
Instances For
Regime and trailing fields together fit inside the payload.
Number of exponent bits actually present in this tapered encoding.
Instances For
Number of explicit fraction bits present in this tapered encoding.
Instances For
The explicit fraction is a subfield of the trailing payload.
Regime and explicit fraction together never exceed the payload.
Low explicit fraction field.
Instances For
Exponent bits physically present between the regime and fraction.
Instances For
Full exponent value after restoring unavailable low bits as zeros.
Exponent bits are consumed most-significant first. Tapering therefore removes low exponent bits, which is represented by this left shift.
Instances For
At most the descriptor's two standard exponent bits are physically present.
The restored standard exponent field is always below four.
Signed regime value k.
Instances For
Exact binary scale after accounting for the explicit fraction denominator.
Instances For
Every decoded posit scale is no smaller than -4 times its payload width.
At the minimum standard width, every word is zero, NaR, or one of the two encodings of unit magnitude. The latter therefore has dyadic scale zero.
This boundary case complements the uniform payload bound used in quire proofs for widths of at least three.
Complete decoded fields of a nonzero finite posit.
- negative : Bool
Sign of the represented finite value.
- regimeBit : Bool
First bit of the variable-length regime.
- regimeRunLength : ℕ
Number of repeated regime bits.
- regimeValue : ℤ
Signed regime value.
- usedExponentBits : ℕ
Number of exponent bits physically present.
- exponentField : ℕ
Exponent after omitted low bits are restored as zero.
- fractionBits : ℕ
Number of explicit fraction bits.
- fractionField : ℕ
Explicit fraction field.
- significand : ℕ
Positive integer significand, including its implicit leading bit.
- scale : ℤ
Binary exponent applied to
significand.
Instances For
Instances For
Instances For
Decode all fields of a nonzero finite posit word.
Instances For
A decoded posit significand fits within the complete posit word's width.
A decoded posit significand fits in the format payload.
The regime always consumes at least one payload bit, so the implicit leading significand bit
together with every explicit fraction bit occupies at most payloadBits positions.
Signed integer significand before applying the binary scale.
Instances For
Format-independent exact dyadic value represented by these decoded fields.
Integer kernels use this value after the posit decoder recovers the tapered fields. Other radix-two families use the same exact-number representation.
Instances For
Exact dyadic rational represented by these decoded fields.
Instances For
Expanding toDyadic exposes the decoded sign, significand, and binary scale unchanged.