Lemonergy · Studio block

Pack Boolean bits

Packs Boolean values into an unsigned word, least significant bit first.

Implementation ID
native-bit-pack
Reviewed
2026-10-27

Behavior

word = Σᵢ bitᵢ × 2ⁱ. The worked example connects this operation to signals in Lemonergy Studio.

Interface

Pack Boolean bits interfaceInputs or arguments on the left, observed outputs on the right. Conserving terminals appear below the component. The tables give units and behavior.Pack Boolean bitsStudio blockin0out0
Original Lemonergy interface view. Lines identify ports; they are not a completed simulation circuit.
Ports and observed outputs
NameDirectionUnitMeaning
in0input1Bits; bool 4 array.
out0output1Word; u32 scalar.

Parameters

No configurable parameters for this component.

Equations and rules

  • word = Σᵢ bitᵢ × 2ⁱ

Worked example

Pack Boolean bits — worked example

Bits = [1,0,1,1]. Word at 0 s = 13.

Open Studio example after release →
Numerical checks for the bundled synthetic example
OutputTime (s)Expected valueUnitAbsolute tolerance
Word
out0
01311e-08

Explore the recorded outputs

Pack Boolean bits recorded example

Pack Boolean bits
Pack Boolean bits against timeRecorded synthetic simulation values. Time in seconds; output in —.12.35012.6750.25130.513.3250.7513.651—Time (s)
Pack Boolean bits: 13 — at 0 s

2 actual recorded samples. Lines are visual guides between samples. Synthetic example, not measured cell data.

Download the recorded samples (JSON) · Open this Studio example after release

Use in a workflow

Pack Boolean bits — worked example

Packs Boolean values into an unsigned word, least significant bit first.

  1. Pack Boolean bits: word = Σᵢ bitᵢ × 2ⁱ. The worked example connects this operation to signals in Lemonergy Studio.
    • Use the block reference for settings and connections.
    • Implementation tested locally; public release pending.
Open Studio example after release

Connected concepts

Limits and interpretation

  • Up to32 Boolean bits; least significant bit first; exact u32 output.
  • Shapes and element types are explicit. Values must be finite; automatic reshaping and unit conversion are not performed.

Reference basis

This software operation and its numerical conventions are defined by the public contract and worked example; no external research result is claimed.

Implementation sources

This reference follows the public interface and locally verified numerical checks for an upcoming release.

Contract: Lemonergy Studio public contract · Verification record: verification-2026-10-27

  • docs/glossary/native-block-verification.json

This implementation and its workflow uses (JSON) · Knowledge graph (JSON-LD)