Reversible Logic Circuits Indranil Nandy
Reversible Logic Circuits Indranil Nandy
4
Reversible Logic
-Bennett (1973)
5
An irreversible computer can always be made
reversible
– Logical Reversibility of Computation : Bennett (1973)
Bennett showed :
An irreversible computer can always be made
reversible by having it save all the information it
would otherwise throw away. For example. the
machine might be given an extra tape (initially
blank) on which it could record each operation
as it was being performed
6
Lead to Reversible Logic Gate & Circuit
10
Toffoli’s Gate
a b c x y z
0 0 0 0 0 0
0 0 1 0 0 1
0 1 0 0 1 0
0 1 1 0 1 1
1 0 0 1 0 0
K=1:
The 1-CNOT, performs the operation (y,x) →(y,x XOR y).
It is referred as a controlled-NOT or CNOT or C.
K=2:
The 2-CNOT is normally called a TOFFOLI (T) gate.
It performs the operation (z,y,x) → (z,y,x XOR yz).
SWAP Gate :
We will also be using another reversible gate, called the SWAP (S)
gate.
It is a 2×2 gate which exchanges the inputs; that is, (x,y) → (y,x). 13
Fredkin’s Gate :
output lines corresponding to a, b and c are x, y and z respectively.
a b c x y z
0 0 0 0 0 0
0 0 1 0 1 0
0 1 0 0 0 1
0 1 1 0 1 1
1 0 0 1 0 0
1 0 1 1 0 1
From the truth table of Fredkin’s gate 1 1 0 1 1 0
.it is clear that it is a reversible gate
There exists a one-to-one mapping 1 1 1 1 1 1
from the input vectors to the output
vectors. More over, the output is
.balanced 14
Fredkin’s Gate (contd.) :
The functions computed by the outputs of
Fredkin’s Gate can be interpreted as follows :
X=a
Y = if a then c else b
Z = if a then b else c
16
Definition :
Reversible Logic Circuit :
19
How to represent a reversible circuit truth table?
(contd.)
20
How to encode a reversible circuit?
21
More definitions :
Let, L be a (reversible) gate library. Then the following
definitions are defined on gate library L.
L-Circuit :
An L-circuit is a circuit composed only of gates from L
L-constructible :
A permutation p Є S2n is L-constructible if it can be
computed by an n×n L-circuit
Equivalent Circuits :
Pairs of circuits computing the same function are called
Equivalent Circuits.
22
Equivalence (contd.) :
Pairs of circuits computing the same function are very useful, since we can substitute one
for the other. On the right, we see similarly that three C gates can be used to replace
the S gate appearing in the middle circuit of Figure 3b. If allowed by the physical
implementation, the S gate may itself be replaced with a wire swap. This, however, is
not possible in some forms of quantum computation. Figure a therefore shows us that
the C and S gates in the CNTS gate library can be removed without losing
computational power. We will still use the CNTS gate library in synthesis to reduce
gate counts and potentially speed up synthesis. This is motivated by the above
Figure, which shows how to replace four gates with one C gate, and thus up to 12
gates with one S gate.
23
Temporary Storage :
The top n−k lines transfer n−k signals, collectively designated Y, to the
corresponding wires on the other side of the circuit.
The signals Y are arbitrary, in the sense that the circuit K must assume nothing
about them to make its computation.
Therefore, the output on the bottom k wires must be only a function of their
input values X and not of the “ancilla” bits Y, hence the bottom output is
denoted f (X).
While the signals Y must leave the circuit holding the same values they entered
it with, their values may be changed during the computation as long as they
are restored by the end.
These wires usually serve as an essential workspace for computing f (X) and
hence, is called Temporary Storage.
An example of this can be found in the previous Figure a: the C gate on the
right needs two wires, but if we simulate it with two N gates and two T gates,
we need a third wire. The signal applied to the top wire emerges unaltered.
24
Universal Reversible Gate :
Let L be a reversible gate library. Then L is
universal if for all k and all permutations p Є
S2k , there exists some l such that some L-
constructible circuit computes p using l
wires of temporary storage.
28
Testable Reversible Gate : R3
29
R1 can implement all boolean functions :
R1 can transfer a signal at input a to output u by setting input c to 0
OR AND
30
Testable Logic Block
A testable logic block can be formed by cascading R1 and R2 as
shown in the following figure.
In this configuration gate R2 is used to check on-line whether there is a
fault in R1 or in itself. If R1 is fault free, its parity output q and the
parity output s of R2 should be complementary, otherwise the
presence of a fault is assumed
31
Two pair rail checker
A two pair two-rail checker
constructed using gate
R3 is shown in the Fig.
It is composed of eight
R3 gates. The error
checking functions of
the two pair rail checker
are as follows:
e1 = x0y1 + y0x1
e2 = x0x1 + y0y1
Where x0/y0 and x1/ y1
are complementary.
33
Observations
Every reversible gate can be described by a permutation.
34
Conclusion
Many modern computational problems are inherently
reversible in nature, meaning that information present in
the input must be conserved by the computation and be
recoverable from the output. Some fields where such
problems arise include cryptography, digital signal
processing, and communications.
35
References :
Logical Reversibility of Computation : C.H. Bennett (1973)
36
37
Paper :Logical Reversibility of
Computation
-Bennett (1973)
The usual general-purpose computing automaton (e.g., a
Turing machine) is logically irreversible - its transition
function lacks a single-valued inverse. Here it is shown
that such machines may be made logically reversible at
every step, while retaining their simplicity and their ability
to do general computations.