Skip to content

Main content

Packed BCD Positive Sign Nibble Tool

Write the conventional C positive signed or F unsigned packed-decimal sign nibble under an explicit policy.

Loading tool…

Description

Accept policy signed-preferred or unsigned.

Packed binary-coded decimal assigns one decimal digit to each four-bit nibble and may reserve a trailing nibble for a sign. Sign conventions vary by format, so a digit pair and a signed decimal record are different encodings.

Accept policy signed-preferred or unsigned.

When to use this tool

Use Packed BCD Positive Sign Nibble when inspecting one packed-decimal digit or declared sign-nibble convention.

How to use the tool and how it works

  1. Enter policy. 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 nibble, hex. Use the output convention below.

Accept policy signed-preferred or unsigned. Return nibble and lowercase hex as 12/c for signed-preferred and 15/f for unsigned.1

Input fieldMeaning and unitsAccepted input
policyPolicyRequired. Text; one of "signed-preferred", "unsigned"; maximum UTF-16 length 8192.
Output fieldInterpretationReturned shape
nibbleNibbleRequired. Safe integer.
hexHexRequired. Text; maximum UTF-16 length 8192.
json
{
  "input": {
    "policy": "signed-preferred"
  },
  "output": {
    "nibble": 12,
    "hex": "c"
  }
}

Limitations and assumptions

  • This selects one positive packed-decimal sign convention, not a whole BCD value or a guarantee of compatibility with another decimal format.
  • 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.

Alternative or Complementary methods

Use the complete record format to establish digit count, sign policy, byte layout and compatibility.

References

  1. Calculation and input contract: encode/packed-bcd-positive-sign-nibble — tool.io

Similar or alternative tools