A Transformation Based Algorithm for Reversible Logic Synthesis D. Michael Miller Dmitri Maslov Gerhard W. Dueck Design Automation Conference, 2003
Objectives Synthesis of Toffoli cascades Synthesis of Toffoli cascades reversible logic reversible logic application in application in quantum computing quantum computing low power CMOS low power CMOS optical computing optical computing Approach Approach use a naive algorithm to find a solution use a naive algorithm to find a solution apply transformations to simplify the network apply transformations to simplify the network
Toffoli Gate Family We use such gates for any number of inputs
The Basic Algorithm Reversible function is given as a truth table Reversible function is given as a truth table For each row in the truth table For each row in the truth table Introduce Toffoli gates such that the output equals the input Introduce Toffoli gates such that the output equals the input Make sure that previous outputs are not affected Make sure that previous outputs are not affected
The Basic Algorithm in out S S S S S S S Final circuit c b a Read quantum array in inverse order to applying gates Observe that after applying S3 wires are as in input
Bidirectional Algorithm in out need three gates need only one gate
Bidirectional Algorithm in out S S S Final circuit c b a S1 After applying S3 my wires are the same as inputs inputs ab
Improvements Output permutations Output permutations via swap gates via swap gates Control input reduction Control input reduction there may be more than on possible assignment of control variables there may be more than on possible assignment of control variables select the one that makes the function “simple” select the one that makes the function “simple” Template matching Template matching
Templates Idea: replace a sequence of gates with an equivalent shorter sequence Idea: replace a sequence of gates with an equivalent shorter sequence example: example:
Example
Template Classification
Larger Example rd53
Number of reversible functions using a specified number of gates gates Average naive permutation input control bidirectional templates optimal
Future Work Start from a non-reversible function Start from a non-reversible function Verify the completeness of the templates Verify the completeness of the templates Expand the algorithm to include Fredkin gates Expand the algorithm to include Fredkin gates Select the best permutation (not by exhaustive search) Select the best permutation (not by exhaustive search)