An Introduction to Reversible Circuits

A reversible computation does not change the information content of its input, and is a permutation of input bit-strings. Reversible logic has been studied since 1980, following a thermodynamic argument that every lost or duplicated bit causes energy loss [2]. When a computational system erases a bit of information, it must dissipate (ln2)kT energy, where k is the Boltzmann’s constant and T is the temperature. 1 Toffoli shows [12] that any finite mapping can be computed in three steps: (i) padding with zeros, (ii) permutation of bit-strings, and (iii) projection of some bit-strings onto others. Steps (i) and (iii) can be made particularly simple, and this technique can be viewed as performing an arbitrary computation by preand post-processing a reversible computation. To compactly represent permutations of bit-strings by logic circuits, Toffoli uses elementary reversible gates. Every reversible gate has as many inputs as outputs, and an output pin of a gate must drive exactly one input pin of another gate. Common elementary gates pass all of their inputs x1, . ,xk to outputs, except for one input y, where the return value isy⊕ (x1x2 . . .xk). The Controlled-NOT (CNOT) gate corresponds tok = 1, and the Toffoli gate (T) tok = 2. In a combinational (acyclic) reversible circuit, every circuit input can be traced to a circuit output, and such circuits are drawn by connecting horizontal “signal lines” with gates represented by vertical lines. Following Feynman, controlling inputsx1, . ,xk are indicated by• and controlled inputs y are indicated by⊕. Inverters (N gates) are shown with disconnected⊕. Different circuits can implement the same computation, e.g., the four-gate circuit in Figure 1 can be simplified to one gate. Three non-cancelling CNOTS on two lines implement a wire-swap. 2 Such circuit identities can be proven by exhaustive simulation or by more subtle algebraic arguments. Synthesis formulations for combinational reversible circuits may ask for a circuit that implements a given permutation, fully-specified by a table as in Figure 2 [7] or using the cycle notation [11]. Another popular formulation [6] specifies, for every input, only the most significant bit of the output, leaving other bits as don’t-cares. The latter kind of synthesis can be reduced to the two-level XOR-sum decomposition [13]. Some circuits, in addition to their inputs, use several temporary-storage lines (ancilla bits). 3 The circuit in Figure 1 whose truth table is shown in Figure 2 can be used as an illustration. Toffoli points out [12] that a circuit implementing an odd permutation must use at least one 1Ralph Merke from Xerox estimates that for T = 300 Kelvins (room temperature), this energy is about 2 . 9e−21 joules, i.e., roughly the kinetic energy of a single air molecule at room temperature. 2This identity is illustrated in Figure 2 of the paper “Scalable Simplification of Reversible Circuits” by Shende et al. in this IWLS handout. Conceptually, the identity is similar to exchanging the contents of two registers without additional memory by performing three XOR operations [10]. 3In applications one may also have input lines with constant 0 or 1. z z’ x y x’ y’ Figure 1: A 3× 3 reversible circuit with two Toffoli gates and two inverters. The circuit performs the same computation as one Controlled-NOT gate on lines y andz.