Description
Split priority into preemption and subpriority using implementedBits - preemptionBits low bits for the latter.
A register mask selects bits within a fixed width. Read-clear and write-one-to-clear semantics describe state transitions that differ from ordinary assignment.
Split priority into preemption and subpriority using implementedBits - preemptionBits low bits for the latter.
When to use this tool
Use Interrupt Priority Preemption Bit Split when you need a deterministic fixed-width field or register-state calculation.
How to use the tool and how it works
- Enter priority, implementedBits, preemptionBits. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read preemption, subpriority. Use the output convention below.
Split priority into preemption and subpriority using implementedBits - preemptionBits low bits for the latter.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| priority | Priority | Required. Safe integer; minimum 0. |
| implementedBits | Implemented Bits | Required. Safe integer; minimum 1; maximum 8. |
| preemptionBits | Preemption Bits | Required. Safe integer; minimum 0. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| preemption | Preemption | Required. Safe integer. |
| subpriority | Subpriority | Required. Safe integer. |
{
"input": {
"priority": 13,
"implementedBits": 4,
"preemptionBits": 2
},
"output": {
"preemption": 3,
"subpriority": 1
}
} Limitations and assumptions
- Inputs are logical priority bits rather than a left-aligned register byte; the grouping and implemented width are supplied.
- Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
- Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Numeric signed-zero results are exported as zero.
Alternative or Complementary methods
Use the device's access semantics and account for concurrent hardware changes before applying a register operation.
References
Similar or alternative tools
- NVIC Priority Field Left Shift
Left-align a logical priority with implementedBits in an eight-bit field by multiplying it by 2^(8 - implementedBits).
- Interrupt Nesting Depth Margin
A lower numeric candidate preempts the last active priority; increase depth only when it would preempt and subtract from depthLimit for depthMargin.