Description
Count nonzero fixed-width lanes in binary text.
Bit positions are usually counted from the least-significant bit, while a displayed binary string has its own left-to-right indexing convention. Masks, fields and parity predicates describe a selected region or pattern; local agreement does not validate a complete encoded record.
Count nonzero fixed-width lanes in binary text.
When to use this tool
Use Bitmask Exact One Lane Flag when checking the stated mask, field, parity or bit-index convention.
How to use the tool and how it works
- Enter word, laneWidth. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read nonzeroLanes, exactlyOne. Inspect exactlyOne before interpreting the associated values.
Count nonzero fixed-width lanes in binary text. Require nonempty binary word, laneWidth 1..8192 and exact divisibility of text length; partition left-to-right, count slices containing any one and flag exactlyOne.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| word | Binary text divided into left-to-right lanes; lane order follows the written string. | Required. Text; maximum UTF-16 length 8192. |
| laneWidth | Lane Width | Required. Safe integer; minimum 1; maximum 8192. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| nonzeroLanes | Nonzero Lanes | Required. Safe integer. |
| exactlyOne | Exactly One | Required. Boolean. |
{
"input": {
"word": "00001100",
"laneWidth": 4
},
"output": {
"nonzeroLanes": 1,
"exactlyOne": true
}
} Limitations and assumptions
- Lanes are text slices rather than inferred machine lanes; all-zero input is not exactly one nonzero lane.
- 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
Choose an explicit bit order, word width and missing-position policy; use the complete record format and appropriate parsing or checksum methods for full validation.
References
Similar or alternative tools
- Two Lane Shuffle Immediate Fields
Split an immediate into two low/high selector fields.
- Bitwise: Bitfield Width From Endpoints
Return field width from inclusive bit endpoints.