Skip to content

Main content

Bitmask Exact One Lane Flag Tool

Count nonzero fixed-width lanes, with the first lane at the supplied most-significant end.

Loading tool…

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

  1. Enter word, laneWidth. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. 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 fieldMeaning and unitsAccepted input
wordBinary text divided into left-to-right lanes; lane order follows the written string.Required. Text; maximum UTF-16 length 8192.
laneWidthLane WidthRequired. Safe integer; minimum 1; maximum 8192.
Output fieldInterpretationReturned shape
nonzeroLanesNonzero LanesRequired. Safe integer.
exactlyOneExactly OneRequired. Boolean.
json
{
  "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

  1. Calculation and input contract: bitwise/bitmask-exact-one-lane-flag — tool.io

Similar or alternative tools