in logic circuits, the toffoli gate (also ccnot gate), invented by tommaso toffoli, is a universal reversible logic gate, which means that any reversible circuit can be constructed from toffoli gates. it is also known as the "controlled-controlled-not" gate, which describes its action. it has 3-bit inputs and outputs; if the first two bits are both set to 1, it inverts the third bit, otherwise all bits stay the same.