Lemonergy · Studio block

Set bit

Sets a selected bit of an unsigned 32-bit word.

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

Behavior

y = word OR (1 << bit). The worked example connects this operation to signals in Lemonergy Studio.

Interface

Set bit interfaceInputs or arguments on the left, observed outputs on the right. Conserving terminals appear below the component. The tables give units and behavior.Set bitStudio blockin0out0
Original Lemonergy interface view. Lines identify ports; they are not a completed simulation circuit.
Ports and observed outputs
NameDirectionUnitMeaning
in0input1Word; u32 scalar.
out0output1Result; u32 scalar.

Parameters

Defaults are initial model values. Select values for your own model and operating conditions.

Configuration fields
ParameterUnitDefaultMeaning and limits
Bit index
params[0]
13Zero-based bit, 0–31.

Equations and rules

  • y = word OR (1 << bit)

Worked example

Set bit — worked example

Word = 1. Result at 0 s = 9.

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

Explore the recorded outputs

Set bit recorded example

Set bit
Set bit against timeRecorded synthetic simulation values. Time in seconds; output in —.8.508.750.2590.59.250.759.51—Time (s)
Set bit: 9 — 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

Set bit — worked example

Sets a selected bit of an unsigned 32-bit word.

  1. Set bit: y = word OR (1 << bit). 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

  • 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)