Skip to content

Main content

Yijing Hexagram Binary Encoder and Decoder

Encode six bottom-to-top yin=0/yang=1 lines with the bottom line as the least-significant bit and return the decoded witness; code is not King Wen numbering.

Loading tool…

Description

Encode six bottom-to-top binary lines as the sum of line[j]*2^j.

These tools represent a six-line figure as six binary values ordered from bottom to top, with yin represented by zero and yang by one. Three adjacent lines form a trigram. Binary encoding, line reversal, and changing selected lines are separate operations under this explicit representation.

Encode six bottom-to-top binary lines as the sum of line[j]*2^j.

When to use this tool

Use Yijing Hexagram Binary Encoder and Decoder when you need a reproducible binary line transformation with an inspectable output figure.

How to use the tool and how it works

  1. Enter lines. Keep parallel arrays aligned. 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 result. Expand result to inspect the returned fields.

Encode six bottom-to-top binary lines as the sum of line[j]*2^j. Return the numerical code, the supplied bits joined in bottom-to-top display order, and decodedLines as a round-trip witness inside result.1

Input fieldMeaning and unitsAccepted input
linesLinesRequired. Array of Finite number..
Output fieldInterpretationReturned shape
resultResultRequired. Object.
json
{
  "input": {
    "lines": [
      1,
      0,
      0,
      0,
      0,
      0
    ]
  },
  "output": {
    "result": {
      "code": 1,
      "bottomToTopBits": "100000",
      "decodedLines": [
        1,
        0,
        0,
        0,
        0,
        0
      ]
    }
  }
}

Limitations and assumptions

  • The leftmost character of bottomToTopBits represents the least significant bit, unlike ordinary most-significant-first binary notation. The code is not a King Wen sequence number.
  • Outputs are nested inside result. The field tables state structural bounds; the mechanics also specify cross-field constraints. Malformed inputs and unsupported domains cause errors. A successful false flag, empty branch value, or zero placeholder has the meaning stated above and is distinct from an input error.

Alternative or Complementary methods

Keep one explicit line-order and binary convention throughout. Use a separate attributed text or scholarly source when the task requires a figure name or interpretation.

References

  1. Calculation and input contract: yijing/hexagram-binary-codec — tool.io

Similar or alternative tools