Adding 1 is a special case
A full adder chain computes A+B for two arbitrary N-bit numbers, but incrementing (adding exactly 1) only ever adds a constant โ and when one operand is fixed at 000...001, most of the gates inside each full adder's carry logic simplify away, leaving a cheaper chain built from XOR and AND gates alone.
The ripple-carry incrementer
Working it out bit by bit:
- Bit 0 always flips (0โ1 or 1โ1), and bit 0's carry-out is simply bit 0's own current value.
- Each following bit flips only if every less-significant bit was already 1 โ i.e. the carry has rippled all the way up from bit 0 โ exactly the 'carry into every column' behaviour of adding a single 1, and one gate cheaper per stage than a full adder.
Decrementers work the same way in reverse
A decrementer subtracts 1 using the same shortcut applied to two's-complement subtraction: each bit flips only if every less-significant bit was already 0. Boolflow ships both as ready-made INC4 and DEC4 blocks.
The program counter
A CPU's program counter is an ordinary loadable register with an INC4 wired from its output back into its own input: every clock cycle it either loads a jump target or increments its own current value by one โ exactly how instruction fetch advances through memory address by address. Wire a REG4's outputs through an INC4 and back into its own inputs in the circuit editor and it counts up by itself; add a MUX per bit in front of the REG4 inputs to choose between the incremented value and a jump target.