A Transformation Based Algorithm for Ternary Reversible Logic Synthesis using Universally Controlled Ternary Gates Erik Curtis, Marek Perkowski.

Slides:



Advertisements
Similar presentations
Reversible Gates in various realization technologies
Advertisements

Synthesis of Reversible Synchronous Counters Mozammel H A Khan Department of Computer Science and Engineering, East West University, 43 Mohakhali, Dhaka.
Logic Circuits Design presented by Amr Al-Awamry
Chapter 2 Logic Circuits.
Lecture #9 EGR 277 – Digital Logic
Realization of Incompletely Specified Reversible Functions Manjith Kumar Ying Wang Natalie Metzger Bala Iyer Marek Perkowski Portland Quantum Logic Group.
© Janice Regan, CMPT 102, Sept CMPT 102 Introduction to Scientific Computer Programming The software development method algorithms.
CMPT 354, Simon Fraser University, Fall 2008, Martin Ester 52 Database Systems I Relational Algebra.
Midterm Exam for Quantum Computing Class Marek Perkowski.
SYNTHESIS OF REVERSIBLE CIRCUITS WITH NO ANCILLA BITS FOR LARGE REVERSIBLE FUNCTIONS SPECIFIED WITH BIT EQUATIONS Nouraddin Alhagi, Maher Hawash, Marek.
Lecture 9 Recursive and r.e. language classes
Designing Oracles for Grover Algorithm
1 Module 9 Recursive and r.e. language classes –representing solvable and half-solvable problems Proofs of closure properties –for the set of recursive.
Lecture 8 Recursively enumerable (r.e.) languages
A Transformation Based Algorithm for Reversible Logic Synthesis D. Michael Miller Dmitri Maslov Gerhard W. Dueck Design Automation Conference, 2003.
Marek Perkowski Reversible Logic Synthesis with Garbage Bits Lecture 6.
08/07/041 CSE-221 Digital Logic Design (DLD) Lecture-8:
Marek Perkowski Reversible Logic Models: Billiard Ball and Optical Lecture 4.
Derivatives of Perkowski’s Gate k f2 g h t t De Vos gates  f1f1  A B P Q Feynman gates A B P f 2f 2  C Q R Toffoli gates Q P f 2 A C R B S D 0.
Chapter 4 Gates and Circuits.
Boolean Functions and their Representations
Multi-Valued Input Two-Valued Output Functions. Multi-Valued Input Slide 2 Example Automobile features 0123 X1X1 TransManAuto X2Doors234 X3ColourSilverRedBlackBlue.
CSC 110 – Intro to Computing Lecture 14: Midterm Review.
April 25, A Constructive Group Theory based Algorithm for Reversible Logic Synthesis.
9/19/06 Hofstra University – Overview of Computer Science, CSC005 1 Chapter 4 Gates and Circuits.
Minimization Techniques for Reversible Logic Synthesis.
Grover’s Algorithm in Machine Learning and Optimization Applications
Lecture 3. Boolean Algebra, Logic Gates
Fast Spectral Transforms and Logic Synthesis DoRon Motter August 2, 2001.
Charles Kime & Thomas Kaminski © 2008 Pearson Education, Inc. (Hyperlinks are active in View Show mode) Chapter 3 – Combinational Logic Design Part 1 –
Overview Part 1 – Design Procedure 3-1 Design Procedure
In a not gate, if the input is on(1) the output is off (0) and vice versa.
Lecture 3. Boolean Algebra, Logic Gates Prof. Sin-Min Lee Department of Computer Science 2x.
Final Exam Review Instructor : Yuan Long CSC2010 Introduction to Computer Science Apr. 23, 2013.
Chapter 4 Gates and Circuits. 4–2 Chapter Goals Identify the basic gates and describe the behavior of each Describe how gates are implemented using transistors.
Charles Kime & Thomas Kaminski © 2004 Pearson Education, Inc. Terms of Use (Hyperlinks are active in View Show mode) Terms of Use Lecture 12 – Design Procedure.
Dr. Ahmed El-Bialy, Dr. Sahar Fawzy Combinational Circuits Dr. Ahmed El-Bialy Dr. Sahar Fawzy.
Combinational Circuit – Arithmetic Circuit
Combinational Logic Design BIL- 223 Logic Circuit Design Ege University Department of Computer Engineering.
REVERSIBLE LOGIC SYNTHESIS. Overview of the Presentation 1. Introduction 2. Design of a Reversible Full-adder Circuit.
Logic Circuits Chapter 2. Overview  Many important functions computed with straight-line programs No loops nor branches Conveniently described with circuits.
Set A formal collection of objects, which can be anything May be finite or infinite Can be defined by: – Listing the elements – Drawing a picture – Writing.
1 A Novel Synthesis Algorithm for Reversible Circuits Mehdi Saeedi, Mehdi Sedighi*, Morteza Saheb Zamani {msaeedi, msedighi, aut.ac.ir.
1 Algorithms CS/APMA 202 Rosen section 2.1 Aaron Bloomfield.
1 Lecture 6 BOOLEAN ALGEBRA and GATES Building a 32 bit processor PH 3: B.1-B.5.
1 Algorithms CS 202 Epp section ??? Aaron Bloomfield.
5 - Digital Logic with Boolean Algebra
CLASSICAL LOGIC SRFPGA layout With I/O pins.
Karnaugh Maps (K maps).
Chapter4: Combinational Logic Part 4 Originally By Reham S. Al-Majed Imam Muhammad Bin Saud University.
4–1. BSCS 5 th Semester Introduction Logic diagram: a graphical representation of a circuit –Each type of gate is represented by a specific graphical.
Section Recursion  Recursion – defining an object (or function, algorithm, etc.) in terms of itself.  Recursion can be used to define sequences.
BDD-based Synthesis of Reversible Logic for Large Functions Robert Wille Rolf Drechsler DAC’09 Presenter: Meng-yen Li.
Combinational Design, Part 2: Procedure. 2 Topics Positive vs. negative logic Design procedure.
Lecture 1 Gunjeet kaur Dronacharya group of institutions.
A Synthesis Method for MVL Reversible Logic by 1 Department of Computer Science, University of Victoria, Canada M. Miller 1, G. Dueck 2, and D. Maslov.
Dr.Ahmed Bayoumi Dr.Shady Elmashad
Overview Part 2 – Combinational Logic Functions and functional blocks
Prof. Sin-Min Lee Department of Computer Science
Logic Gates and Boolean Algebra
EKT 124 / 3 DIGITAL ELEKTRONIC 1
Combinational Logic Logic circuits for digital systems may be combinational or sequential. A combinational circuit consists of input variables, logic gates,
Chapter 4 Gates and Circuits.
Logic Gates.
DIGITAL ELECTRONICS B.SC FY
Basic circuit analysis and design
Fuzzy Reversible Logic using Toffoli-like gates
Sajib Kumar Mitra, Lafifa Jamal and Hafiz Md. Hasan Babu*
Circuit Simplification and
SYEN 3330 Digital Systems Chapter 2 – Part 1 SYEN 3330 Digital Systems.
Presentation transcript:

A Transformation Based Algorithm for Ternary Reversible Logic Synthesis using Universally Controlled Ternary Gates Erik Curtis, Marek Perkowski

Synthesis Problems for Cascades Gates are binary and ternary –Toffoli, Feynman, NOT –GTG –Subset of GTG –Universally controlled (binary and ternary) Algorithms are searches –From inputs to outputs –From outputs to inputs –Bidirectional –Decomposed

Gates NOTV 2-input binary gates 2-input ternary gates op1 op2 op3 deVos op1 op2 op3 AND …. op1 op2 op3 arbitrary …. NOT arbitrary V+ arbitrary k-input ternary gates k-input binary gates

A set of all one-qubit gates for ternary reversible logic

Definition The Universally Controlled Ternary Gate (UCTG) is a n*n gate where the first n- 1 wires are unchanged and wire n is transformed by one of the 6 generalized inverters based on an arbitrary function f of wires 1, 2, …, n-1.

3.1 The Basic Algorithm The basic algorithm is a greedy one-pass over the entire function that transforms the output vector to the input vector one bit at a time, until the identity function is found. The algorithm consists of a special case loop for vector 0 and a general case loop for all other vectors in the function. See figure 1 for the listing of the pseudo- code of the basic algorithm.

Figure 1. Basic Algorithm Step 1: Let m = # of inputs If  (0)  0, then For j in {0..m-1} { if(  (0,j) = 1 ) apply transform ‘+1’. if(  (0,j) = 2 ) apply transform ‘+2’. } Step 2: Let  + be the current function;  ++ is next function. For i in {0..3 m -1} { let p be a ternary vector of i For j in {0..m-1} { if(  + (i,j) != p[j] ) { let c2 be a list of all bits in p = 2 except j let c1 be a list of all bits in p = 1 except j t = find_transform(  + (i,j), p[j]) Transform( j, t, c1, c2) } } }

Figure 1. Basic Algorithm function Transform( position, transform, c1, c2) { for i in {0.. 3 m -1} { if( meets_constraints( f + (i), c1, c2 ) ) { f ++ ( i, position) = apply( transform, f + (i,position) ) } } f + = f ++ }

The first step of the algorithm The special case loop for  (0) is executed first. In this case, there are no control lines associated with the transforms. If  (0) = 0, then vector 0 is in the correct location and no transformation is needed; therefore, the algorithm continues on to step 2. In the case where  (0)  0, the algorithm then loops over every bit j in vector 0. Wherever j is equal to 1, an uncontrolled transform ‘+1’ is applied to bit j in every vector. Wherever j is equal to 2, an uncontrolled transform ‘+2’ is applied to bit j in every vector. At the end of step 1,  (0) = 0. At no time should this vector change from 0 to another value, now that this value has been locked in.

The second step of the algorithm In the second step, the algorithm looks at every vector i, where 1  i  3m – 1, and every bit j in vector i (a minterm) in turn. A ternary vector p is created where p is the ternary representation of i. For each i and j, if the bit of the current function  +(i,j) is not equal to the expected bit p[j], then apply the proper transform to all bits in position j, with respect to a set of control vectors c1 and c2. The control vectors c1 and c2 are used to keep the algorithm from transforming the previously locked bits. The control vectors are created by putting every bit equal to 2 in  +(i) except bit  +(i,j) into c2, and every bit equal to 1 in  +(i) except bit  +(i,j) into c1. Table 2 shows the logic table for transform selection.

The principle of the DMM-like algorithms A B The algorithm build the cascade from outputs to inputs. This is given as problem description Operator 12 applied to A Operator +1 applied to B when A=2 Operator +1 applied to A when B=2 Yellow shows where the argument values are modified (the controlled variable)

A B Operator 12 applied to A Operator +1 applied to B when A=2 Operator +1 applied to A when B=2 Operator +2 applied to A when B=1 Operator +2 applied to B Operator +1 applied to A = AB

A B Operator 12 applied to A Operator +1 applied to B when A=2 Operator +1 applied to A when B=2 Operator +2 applied to A when B=1 Operator +2 applied to B Operator +1 applied to A = AB

A B Operator 12 applied to A Operator +2 applied to B when A=2 Operator +2 applied to A when B=2 Operator +1 applied to A when B=1 Operator +2 applied to B Operator +1 applied to A = AB F(A,B)G(A,B) F G Gates are created from output to input HIJKL L

A B Operator 12 applied to A Operator +2 applied to B when A=2 Operator +2 applied to A when B=2 Operator +1 applied to A when B=1 Operator +2 applied to B Operator +1 applied to A = AB K(A,B) J(A,B) F G Gates are created from input to output HIJKL L

Figure 1. Basic Algorithm Step 1: Let m = # of inputs If  (0)  0, then For j in {0..m-1} { if(  (0,j) = 1 ) apply transform ‘+1’. if(  (0,j) = 2 ) apply transform ‘+2’. } Step 2: Let  + be the current function;  ++ is next function. For i in {0..3 m -1} { let p be a ternary vector of i For j in {0..m-1} { if(  + (i,j) != p[j] ) { let c2 be a list of all bits in p = 2 except j let c1 be a list of all bits in p = 1 except j t = find_transform(  + (i,j), p[j]) Transform( j, t, c1, c2) } } } function Transform( position, transform, c1, c2) { for i in {0.. 3 m -1} { if( meets_constraints( f + (i), c1, c2 ) ) { f ++ ( i, position) = apply( transform, f + (i,position) ) } } f + = f ++ }

Table 3. Input and intermediate variables for basic algorithm Critical minterms are red numbers Sorted minterms are pink rectangles

Fig. 3. UCTG realization of basic algorithm. (a) before transformation, (b) after.

Figure. 5. Compressed result.

Figure 4. Compression Algorithm Step 1: For every uncontrolled gate, find the closest controlled gate on the same wire. Move the uncontrolled gate next to the controlled gate. Every gate that the uncontrolled gate passes over that contains a control line attached to the same wire as the uncontrolled gate, has that control transformed by the uncontrolled gates transform, taking into account the direction of movement of the uncontrolled gate. Step 2: Find controlled gates that are on the same wire and are next to each other. If the transforms of these gates are compatible, then the gates can be merged by merging the control lines and converting the transforms into the new merged transforms. Step 3: Find control gates that are on the same wire and are next to each other. If the control lines of these gates are exclusive, then the gates can be merged by setting one control line set to be output 1 and the other control line set to be output 2. Step 4: Merge the uncontrolled gates. Find the uncontrolled gates and merge them into the control gates they are next to, if it is possible.

Table 4. Compatibility Chart

Table 5. Benchmark Results

Abhinav Agarwal – DATE 2004 Claims to have the best results of all so far. Many points uncertain We have to dig deeper to see if there is really any value there that we do not know. We used Reed Muller earlier but differently. Is PPRM better than FPRM, may be because of efficient realization on a computer.

F(C,B,A)=[1,0,7,2,3,4,5,6] abcabc R,Q,P c=b+ab+ac b=b+c+ac a=a+1a=a b=b+ac c=c+ab+ac a=a b=b c=c+ab a=a b=b c=c a cb From inputs to outputs Uses gates that are their own inverses