Simten

Examples

Interactive circuit examples from half adder to Fibonacci generator

Half Adder

Two bits → sum + carry. The simplest arithmetic circuit. Toggle the switches to see how AND computes carry and XOR computes sum.

Compiling...
Half Adder
Toggle the switches to see sum and carry

Full Adder

Three bits (a + b + carry in) → sum + carry out. Reuses HalfAdder as a composite — the simulator expands it to primitives automatically.

Compiling...
Full Adder
Toggle switches — notice how carry-in affects the output

Counter

Increments on each clock cycle. A register feeds its output through an adder that adds 1, and the result loops back. Step the clock to watch it count.

Compiling...
8-Bit Counter
Step the clock to watch it count up (wraps at 0xFF)

Fibonacci Generator

Two registers and one adder produce the Fibonacci sequence every clock tick. A DFlipFlop seed trick injects +1 on the first tick only.

Compiling...
Fibonacci Generator
Step to see: 1, 1, 2, 3, 5, 8, 13, 21, 34, 55... (wraps at 8-bit)

Design Patterns

Combinational — no state, no clock. Outputs computed directly from inputs. Examples: gates, adders, muxes, ALUs.

Sequential — has state and clock. State updates on rising clock edge, outputs reflect current state. Examples: counters, registers, shift registers.

Hierarchical composition — build complex circuits from simpler ones. FullAdder from HalfAdder, ALU from Adder+Mux, CPU from ALU+RegisterFile+Memory.

Feedback loops — connect a node's output back to its input through a register. The register breaks the combinational loop by introducing a one-cycle delay. This is how counters, state machines, and CPUs work.

On this page