Boolflow's I/O Primitives: Switches, Indicators, and Constants
← All articles

Boolflow's I/O Primitives: Switches, Indicators, and Constants

4 min

Getting a signal in: INPUT

INPUT is a manual switch — click it and its output toggles between 0 and 1. It's the one element in Boolflow driven by a person's own action rather than by another element's output. Every circuit worth testing needs at least one, since gates and registers can only ever react to a signal that comes from somewhere.

Reading a signal out: OUTPUT and LED

OUTPUT and LED both display whatever is wired into them rather than computing anything: OUTPUT reports the current value as 0, 1, or ? if genuinely unconnected, while LED renders the same information visually — lit for 1, dark for 0. Neither element passes a value forward to anything else; they exist purely so a person can read a signal the rest of the circuit is otherwise using internally. Wire an OUTPUT onto every signal you actually care about — an ALU's Zero flag, say — even when it never reaches a "real" output pin, precisely because there's otherwise no way to see it.

Fixed values: CONST0 and CONST1

CONST0 and CONST1 are the simplest possible elements: no inputs at all, and an output permanently fixed at 0 or 1. They matter whenever a design needs a literal constant wired in — tying a T flip-flop's T input to CONST1 so it toggles on every clock edge is exactly how a counter stage is built. Using CONST0/CONST1 instead of, say, an INPUT switch left in one position and never touched again documents that the value is meant to be fixed, not just left alone.

Debugging inline: PROBE

PROBE reads a signal without affecting the circuit at all — the same non-invasive role an oscilloscope probe plays on real hardware. Attach one to any wire mid-circuit, deep inside a block you didn't build yourself, to see its instantaneous value without rerouting anything or adding a permanent OUTPUT. It's the fastest way to answer "what is this internal wire actually carrying right now?" while a circuit isn't behaving the way you expected.

Wire up an INPUT, an OUTPUT, and a PROBE →