The basic Fredkin gate is a
controlled swap gate (CSWAP gate) that
maps three inputs onto three outputs . The
C input is mapped directly to the
C output. If
C = 0, no swap is performed; maps to , and maps to . Otherwise, the two outputs are swapped so that maps to , and maps to . It is easy to see that this circuit is reversible, i.e., "undoes" itself when run backwards. A generalized
n ×
n Fredkin gate passes its first
n − 2 inputs unchanged to the corresponding outputs and swaps its last two outputs if and only if the first
n − 2 inputs are all 1. • Controlled-swap logic: The Fredkin gate, a three-bit controlled-SWAP gate, operates by conditionally swapping two target bits based on the state of a control bit. If the control bit is 1, the gate swaps the target bits; if 0, the bits pass through unchanged. \begin{bmatrix} 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 \\ \end{bmatrix} • Reversible computing: The gate is reversible, meaning that no information is lost during computation. This property aligns with principles of conservative logic, preserving data and reducing energy dissipation. This corresponds nicely to the
conservation of mass in physics and helps to show that the model is not wasteful. ==Truth functions with AND, OR, XOR, and NOT==