Download presentation
Presentation is loading. Please wait.
Published byDulcie Moore Modified over 6 years ago
1
Fredkin/Toffoli Templates for Reversible Logic Synthesis
by Dmitri Maslov Dmitri Maslov Gerhard Dueck Michael Miller ICCAD, November 11, 2003, San Jose, CA
2
Outline Synthesis Procedure
Basic definitions Synthesis Procedure The Templates (definition, classification, application) Results ICCAD, San Jose, CA November 11, 2003 page 1/20
3
Basic Definitions Definition. Multiple output Boolean function is called reversible iff: is a bijection. In reversible logic fan-outs and feed-back conventionally are not allowed, thus any network is a cascade. ICCAD, San Jose, CA November 11, 2003 page 2/20
4
Basic Definitions … Toffoli type gates NOT Toffoli CNOT (Feynman)
Generalized Toffoli Toffoli type gates ICCAD, San Jose, CA November 11, 2003 page 3/20
5
Basic Definitions Fredkin gates are the controlled SWAPs.
Fredkin gates can be effectively simulated by a Toffoli gate and two CNOTs. ICCAD, San Jose, CA November 11, 2003 page 4/20
6
Synthesis Procedure 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. ICCAD, San Jose, CA November 11, 2003 page 5/20
7
Synthesis Procedure in 000 001 010 011 100 101 110 111 out 100 110 101
Final circuit 1 ICCAD, San Jose, CA November 11, 2003 page 6/20
8
Synthesis Procedure Further Improvements
Bidirectional modification: while synthesizing a network the gates can be assigned at both sides. Output permutation. Control input reduction: there may be more than one possible assignment of controls. Apply templates. ICCAD, San Jose, CA November 11, 2003 page 7/20
9
Templates as a Simplification Tool
As 3 gates can be rewritten by a sequence of 2, some s gates can be rewritten as a sequence of k gates (k<s). Network simplification approach. preprocessing: find as many rewriting rules as possible. simplify by matching rewriting rules and rewriting the circuit. ICCAD, San Jose, CA November 11, 2003 page 8/20
10
Templates as a Simplification Tool
Problems in such naive approach. The number of rewriting rules is very large: a. For s=3, k=2 and n=3 (number of lines) the number of rewriting rules is 180 (using Toffoli gates only). b. Many rewriting rules are redundant. c. The number of non-redundant rewriting rules only grows exponentially on n. 2. Very often a rewriting can be applied only when certain gates are moved. ICCAD, San Jose, CA November 11, 2003 page 9/20
11
The Templates: Definition
Observation 1. If one has a rewriting rule then the gates in it satisfy equation Observation 2. If we have an identity then for any parameter p, is a valid rewriting rule. Observation 3. If , then ICCAD, San Jose, CA November 11, 2003 page 10/20
12
The Templates: 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, i.e. application of smaller templates does not decrease the number of gates in a size m template. Given G0G1…Gm-1, a template of size m, its application for parameter p, is: for ICCAD, San Jose, CA November 11, 2003 page 11/20
13
The Templates: Definition
Example. Template ABCDEFG. p=4. Starting gate B. Direction: backward. F F E E B A G C D G D A C B m2 How many rewriting rules are there in one template? Parameter p: m/2 choices. Starting gate i: m choices. Directions of application: 2 (forward, backward). ICCAD, San Jose, CA November 11, 2003 page 12/20
14
The Templates: Classification
A class of Toffoli-Fredkin templates is defined as an identity with certain conditions on the form of gates in it. Box gate: - Line with the box is either NOT or SWAP. - All the boxes on the same line are of the same type. - If a line with a box has a NOT or a SWAP on it, the box is necessarily substituted with NOT. ICCAD, San Jose, CA November 11, 2003 page 13/20
15
The Templates: Classification
Class 1: duplication deletion. Class 2: passing rule. ICCAD, San Jose, CA November 11, 2003 page 14/20
16
The Templates: Classification
Group: semi-passing Group: link Group: Fredkin definition ICCAD, San Jose, CA November 11, 2003 page 15/20
17
The Templates: Classification
Class 3: main template. Class 4: fttftt template. ICCAD, San Jose, CA November 11, 2003 page 16/20
18
The Templates: Application
In a program realization: use size 4 templates to move gates – moving rule. Semi-passing templates are used to pass the gate that does not change. for other templates apply smaller templates first (in a sense, smaller template does a more general transformation). - given a template, match it by trying both directions, starting with any gate and trying to move other gates by the moving rule. ICCAD, San Jose, CA November 11, 2003 page 17/20
19
The Templates: Application
ICCAD, San Jose, CA November 11, 2003 page 18/20
20
The Templates: Application
semi-passing passing ICCAD, San Jose, CA November 11, 2003 page 18/20
21
Results j optimal synthesized 1 18 2 184 3 1318 1290 4 6474 5680 5 17695 13209 6 14134 13914 7 496 5503 8 512 9 WA: 5.134 5.437 Number of reversible functions of size 3 using a specified number of Toffoli-Fredkin gates. More than 77% of synthesized functions are optimal. Average gate count of the synthesized Toffoli-Fredkin circuit is less than optimal gate count for Toffoli network. ICCAD, San Jose, CA November 11, 2003 page 19/20
22
Benchmark synthesis results
Name Size* Number of gates rd32 4 4T rd53 7 12T mod5 5 9T hwb5 24F hwb6 6 65F hwb7 166F ham3 3 4FT ham7 24T ham15 15 138T * - when the function is not reversible, it was synthesized in its minimal reversible specification. ICCAD, San Jose, CA November 11, 2003 page 20/20
23
END Fredkin/Toffoli Templates for Reversible Logic Synthesis
Thanks for Your attention!
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.