Skip to content

Subcircuit (reusable block): meaning and examples

A subcircuit is a named, reusable block of logic with its own inputs and output, defined once and used inside other formulas. A model pins it to a version, so later edits to the block do not silently change the rules using it.

Any formula can be packaged as a subcircuit: give it a name, declare its inputs, and the name becomes an operator that other formulas can call with their own arguments. Logically a subcircuit call is just substitution: replacing the call with the block's body, arguments in place of inputs, gives an ordinary formula, and the subcircuit-expansion law performs exactly that replacement. Subcircuits add no expressive power; what they add is structure, a single place where a shared piece of logic lives and is named.

A worked example in words: a half adder has the sum A XOR B. Package the sum as a block xor2 with inputs a and b. A full adder's sum is then xor2(xor2(A, B), Cin), two calls to the one block, and expanding both calls gives (A XOR B) XOR Cin. If the block is later rewritten as (a AND NOT b) OR (NOT a AND b), the adder's table does not change, because the two bodies are equivalent; the equivalence check on the block is the test that makes the rewrite safe.

Subcircuits are the hardware designer's modules and the programmer's functions: a majority voter, a comparator or an eligibility sub-rule written once and reused. Pinning to a version matters because a shared block is a shared point of failure, and a model that names the version it was checked against stays reproducible. The term is confused with a sub-expression (an unnamed part of one formula) and with a reference to another output, which shares a value rather than a definition.

The common slip

Editing a shared block and assuming every model that uses it has been re-checked. A model pins the version it was checked against, so it keeps the old behaviour until someone updates the pin, and the update is the moment to re-run the checks. A block changed in place is a change to every caller.

Questions

Does a subcircuit change the truth table of the formula that calls it?

No. The call expands to the block's body with the arguments substituted, and the expanded formula has the table it would have had written out in full. The subcircuit-expansion law on the laws pages shows that expansion as an equivalence.

Can a subcircuit call itself?

No. Combinational logic has no loops, and a block that referred to itself would have no finite expansion. Blocks may call other blocks, as long as the chain of calls ends.

Related

See also

Glossary

Generated from the Tangibool engine, semantics tangibool-semantics/1, engine 1.0.0, build . Every table, map, simplification and verdict on these pages was computed by the Tangibool engine when the site was built, and every claim was re-checked by the same exact checker the app uses. Limits are stated where they apply. © 2026 Foreranger LTD.