331 likes | 537 Views
A Transformation Based Algorithm for Reversible Logic Synthesis. D. Maslov,G. W. Dueck and D . M. Miller. Speaker: Min Lung Chuang Advisor: Chun-Yao Wang 2005/03/09. Outline. Introduction Reversible Circuits Toffoli Network Synthesis
E N D
A Transformation Based Algorithm for Reversible Logic Synthesis D. Maslov,G. W. Dueck and D . M. Miller Speaker: Min Lung Chuang Advisor: Chun-Yao Wang 2005/03/09
Outline • Introduction • Reversible Circuits • Toffoli Network Synthesis • Transformation with template • Experimental results • Summary
Motivation • Reversible circuits have applications in - low power design - quantum computer Landauer Principle If a computation process erases a single bit of information, the energy dissipated into the environment is at least E = k T ln2 , where k is the Boltzmann’s constant, • T is the temperature quantum computing is a reversible computing
Outline • Introduction • Reversible Circuits • Toffoli Network Synthesis • Transformation with template • Experimental results • Summary
︰ ︰ Reversible Computing (1/7) • If we know the input, we can calculate the output and , moreover, the computation is “reversible”. if C=0→ A=?, B=? A C B A Reversible Computation The AND Gate
Reversible Function (Gate) (2/7) • Traditional gates such as AND, OR, and EXOR are not reversible • Definition: Multiple output Boolean function is called reversible iff: 1. 2. - is a bijection. • A bijection function means the function is 1-1 and onto
Reversible Function (3/7) • Several reversible gates have been proposed. Toffoli gates and Fredkin gates are the best known and most widely studied • There are some Toffoli gates will be introduced later - NOT( ) - CN (Controlled NOT) - CCN (Controlled Controlled NOT)
It is controlled by the input to the wire control target The CN Gate (4/7) • A Controlled NOT is a two-wire input gadget that has two outputs as well. A A’ B B’ CNOT (Feynman) Truth Table for the CN Gate
The CCN Gate (5/7) • We cannot do everything with just N and CN gates. Toffoli Truth Table for the CNN Gate
. . . Generalized Toffoli Gate (6/7) • TOF(C,t),where C is the set of control variable, { }, t is the set of target variable { } and ex: NOT gate is TOF( , ) CN gate is TOF( , ) CCN gate is TOF( , )
Toffoli garbage constant inputs Reversible Function (7/7) Garbageis the number of outputs added to make an n-input k-output function reversible.
Outline • Introduction • Reversible Circuits • Toffoli Network Synthesis • Transformation with template • Experimental results • Summary
PRELIMINARIES (1/7) • In reversible logic fan-outs and feedback conventionally are not allowed, thus any network is a cascade.
Synthesis Procedure (2/7) • The Basic Algorithm - - - - Assume the function is given in a truth table as a reversible specification. Start creating the cascade from its end: transform the output to the form of the input. Transform the output pattern to the form of input in lexicographical order. While working with the pattern of higher order do not affect patterns with lower order.
a a’ b b’ c C’ a b c Synthesis Procedure (3/7) in 000 001 010 011 100 101 110 111 out 001 000 011 010 101 111 100 110 S1 000 001 010 011 100 110 101 111 S3 000 001 010 011 100 101 111 110 S1 000 001 010 011 100 110 101 111 S1 000 001 010 011 100 110 101 111 S2 000 001 010 011 100 111 101 110 S3 000 001 010 011 100 101 111 110 S3 000 001 010 011 100 101 110 111 Final circuit
If we apply TOF(C, ), C= { } - input part: the pattern { } will be interchanged with the pattern { } - output part: permute the output patterns associated with input pattern { } and { } without reordering the input side of the truth table Bidirectional Modification (4/7) • If we could construct the network from the two ends simultaneously, we can speed up the synthesis process and get a better result.
Bidirectional Modification (5/7) need three gates in the end of the cascade for the basic approach in 000 001 010 011 100 101 110 111 out 111 000 001 010 011 100 101 110 can assign one gate in the beginning of the cascade instead
a a’ b b’ c c’ a b a a’ c b b’ c c’ Bidirectional Modification (6/7) in 000 001 010 011 100 101 110 111 out 111 000 001 010 011 100 101 110 S1 000 111 010 001 100 011 110 101 S2 000 001 010 111 100 101 110 011 S3 000 001 010 011 100 101 110 111 Final circuit Basic algorithm result
out 000 111 . . . in 000 001 . . . Further Improvements (7/7) • Control input reduction: there may be more than one possible assignment of controls. 1. The set of control lines that contain a line that has not appeared as a 1 in any earlier row of the Spec 2. The set of control lines that contain all lines that have appeared as 1’s in rows earlier in the Spec • It may not help to decrease gate count, but it help to decrease the quantum cost of the design.
Outline • Introduction • Reversible Circuits • Toffoli Network Synthesis • Transformation with template • Experimental results • Summary
Template (1/9) • Templates were introduced as a tool for network simplification. • A template was defined as two sequences of gates that realize the same function. 1. One is used to matched to a part of the network being simplified 2. The other is substituted when a match is found.
Template (2/9) • Observation: These two sequence gates of a template and must satisfy the equation = Identity • Definition: A size m template is a cascade of m gates which realizes the identity function. • Any template of size m should be independent of smaller size templates.
Template (3/9) • Theorem:If a network realizes the identity function, then for any k-shift, realizes the identity. We prove the theorem for 1-shift, Then all k-shifts can be proven by applying the 1-shift k times.
F E B A G F C D E G D A C B Template application (4/9) • Example. Template ABCDEFG. p=4. Starting gate B. Direction: backward F E G D A C B m2 How many rewriting rules are there in one template? Matched gate length: m/2 choices. Starting gate i: m choices. Directions of application: 2 (forward, backward).
1 1 1 1 1 1 0 1 0 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 0 1 1 0 0 0 1 0 1 0 1 0 1 0 1 1 0 1 0 0 1 0 0 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 0 0 0 0 0 0 1 1 1 0 0 1 0 0 1 1 0 0 0 The Templates: Classification (5/9) • Size 2 • Size 4
1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 0 1 0 1 0 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 0 0 1 0 1 1 0 1 1 1 1 0 1 0 1 0 1 0 1 1 The Templates: Classification (6/9) • Size 5
1 b c d The Templates: Application (8/9) a Template size=5
a a b b c c d d a b c d The Templates: Application (9/9)
Outline • Introduction • Reversible Circuits • Toffoli Network Synthesis • Transformation with template • Experimental results • Summary
Results Number of reversible functions of size 3 using a specified number of Toffoli gates. More than 50% of synthesized functions are optimal.
Outline • Introduction • Reversible Circuits • Toffoli Network Synthesis • Transformation with template • Experimental results • Summary
Summary • The synthesis algorithm will always terminate with a valid network. • This algorithm can modified to include the Peres (quantum cost 4) , Miller (quantum cost 8) and mEXOR gate into this algorithm. • In this work, the template simplification toll has been presented, and the experimental results shows that the quality of the simplification is good