BUS_IN has input pins only (left side), BUS_OUT has output pins
only (right side). No internal connections between them — BUS_OUT
reads values directly from its paired BUS_IN via busPairId. The
bus cable between them is purely visual, representing the grouped
signal bundle.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Hold Shift and drag across wires to create a BUS gate that groups
them together. The cut line shows a live preview with wire count.
BUS gates are pass-through (each input maps to its output) and
render as a thin cyan bar with ports on each side.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Major fixes for custom components when used in the main circuit:
- Add outputValues[] array for multi-output component gates, so each
output port carries its own independent value
- readSourcePort() reads the correct port value from source gates
instead of always reading gate.value
- evaluateComponent() now uses iterative fixed-point evaluation
(matching main evaluateAll) instead of a simple 10-pass loop
- Store inputIds/outputIds in component definition for consistent
port-to-gate mapping across save/load
- Renderer reads per-port values for connection color and port glow
- Added debug logs for component save and evaluation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace single-pass recursive evaluation with iterative fixed-point
evaluation that runs multiple passes until all gate values stabilize.
Crucially, gate values are NO LONGER reset to 0 before evaluation,
which preserves latch/flip-flop memory state.
Add console logs for toggle, wire, and evaluation stability debugging.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Redesigned toolbar with I/O, Gates, and Components sections
- Component editor: sub-canvas mode to design reusable chips
- Save/Cancel with main circuit state preservation
- Components persist in localStorage
- Custom components render as purple chips with dynamic I/O ports
- Component evaluation simulates internal circuit as black box
- Toolbar height increased to 56px for section labels
- All height references updated consistently
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- INPUT/CLOCK gates can now be dragged (click-without-move = toggle,
click-and-drag = move). Uses 4px movement threshold.
- Waveform only records samples on intentional actions (INPUT toggle,
manual step, simulation tick), not on gate placement/movement/connections.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>