# A New Pairwise NPN Boolean Matching Algorithm Based on Structural Difference Signature

^{1}

^{2}

^{3}

^{4}

^{5}

^{6}

^{*}

## Abstract

**:**

## 1. Introduction

## 2. Related Works

## 3. Terminology and Notation

**Definition**

**1.**

## 4. The Proposed Algorithm

#### 4.1. Boolean Difference

**Definition**

**2.**

**Example**

**1.**

**Definition**

**3.**

**Definition**

**4.**

**Lemma**

**1.**

**Proof.**

**Property**

**1.**

**Proof.**

**Example**

**2.**

**Definition**

**5.**

**Definition**

**6.**

**Definition**

**7.**

#### 4.2. SDS-Based Boolean Matching Algorithm

Procedure 1 NPN Boolean Matching. |

Input:f and gOutput: 0 or 1function Matching($f,g$)Create BDD of f and g $sp\_f=bddtrue,sp\_g=bddtrue,trans\_list=NULL$ Compute $\left|f\right|$ and $\left|g\right|$ if $\left|f\right|=\left|g\right|$ thenif $\left|f\right|\ne |\overline{g}|$ thenReturn Handle_SDS($f,g$) elseif Handle_SDS($f,g$)=1 thenReturn 1 elseReturn Handle_SDS(f,$\overline{g}$) end ifend ifelseif $\left|f\right|=|\overline{g}|$ thenReturn Handle_SDS(f,$\overline{g}$) elseReturn 0 end ifend ifend function |

Procedure 2 recursive_search. |

Input:f, g, $sp\_f$, $sp\_g$, and $trans\_list$Output: 0 or 1function handle_SDS($f,g,sp\_f,sp\_g,trans\_list$)if ${D}_{1}$ thenreturn VERIFY($f,g,T$) end ifUPDATE($f,g,sp\_f,sp\_g$) if ${V}_{f}\ne {V}_{g}$ thenreturn 0 end ifif ${D}_{2}$ thenCompute ${D}_{f}$ and ${D}_{g}$ if $NotEmpty\left({D}_{f}\right)$ thenAdd independent mappings to $trans\_list$ end ifend if$min\_number$=32768 for all ${x}_{i}\in f\left(x\right)$ doif ${D}_{3}$ thenContinue end iffor all ${x}_{j}\in g\left(x\right)$ doSearch variable mappings end forCompute ${\chi}_{i}\left({S}_{i}\right)$ if ${D}_{4}$ thenfor all ${\phi}_{j}\left({\psi}_{j}\right)\in {\chi}_{i}\left({S}_{i}\right)$ doif ${D}_{5}$ thenreturn 0 elseAdd ${\phi}_{j}\left({\psi}_{j}\right)$ to $trans\_list$ end ifend for$min\_number=1$ elseif $|{\chi}_{i}\left|\right(|{S}_{i}\left|\right)<min\_number$ then$min=i$ end ifend ifend forif ${D}_{6}$ thenUpdate $sp\_f$ and $sp\_g$ Return Handle_SDS($f,g,sp\_f,sp\_g,trans\_list$) elsefor all ${\phi}_{j}\left({\psi}_{j}\right)\in {\chi}_{min}\left({S}_{min}\right)$ doif ${D}_{5}$ thencontinue elseAdd ${\phi}_{j}\left({\psi}_{j}\right)$ to $trans\_list$ Update $sp\_f$ and $sp\_g$ Return Handle_SDS($f,g,sp\_f,sp\_g,trans\_list$) end ifend forReturn 0 end ifend function |

**Example**

**3.**

## 5. Experimental Results

## 6. Conclusions

## Author Contributions

## Funding

## Acknowledgments

## Conflicts of Interest

## References

- Slepian, D. On the number of symmetry types of Boolean functions of n variables. Can. J. Math.
**1955**, 2, 185–193. [Google Scholar] [CrossRef] - Zhang, J.; Yang, G.; Hung, W.N.N.; Liu, T.; Song, X.; Perkowski, M.A. A group algebraic approach to NPN classification of Boolean functions. Theory Comput. Syst.
**2018**. [Google Scholar] [CrossRef] - Zhang, Y.; Yang, G.; Hung, W.N.N.; Zhang, J. Computing affine equivalence classes of Boolean functions by group isomorphism. IEEE Trans. Comput.
**2016**, 12, 3606–3616. [Google Scholar] [CrossRef] - Lai, Y.-T.; Sastry, S.; Pedram, M. Boolean matching using binary decision diagrams with applications to logic synthesis and verification. In Proceedings of the 1992 IEEE International Conference on Computer Design: VLSI in Computers and Processors, Cambridge, MA, USA, 11–14 October 1992. [Google Scholar] [CrossRef]
- Zhang, J.; Yang, G.; Hung, W.N.N.; Zhang, Y.; Wu, J. An efficient NPN Boolean matching algorithm based on structural signature and Shannon expansion. Cluster Comput.
**2018**, 6, 1–16. [Google Scholar] [CrossRef] - Adbollahi, A.; Pedram, M. Symmetry detection and Boolean matching utilizing a signature-based canonical form of Boolean functions. IEEE Trans. Comput.-Aided Des. Integr. Circuits Syst.
**2008**, 6, 1128–1137. [Google Scholar] [CrossRef] - Lee, S.Y.; Lee, N.Z.; Jiang, J.H.R. Canonicalization of threshold logic representation and its applications. In Proceedings of the International Conference on Computer-Aided Design, San Diego, CA, USA, 5–8 November 2018; p. 85. [Google Scholar]
- Asghar, A.; Iqbal, M.M.; Ahmed, W.; Ali, M.; Parvez, H.; Rashid, M. Logic algebra for exploiting shared SRAM-table based FPGAs for large LUT inputs. In Proceedings of the Electrical Engineering and Computing Technologies, Karachi, Pakistan, 15–16 November 2017; pp. 1–4. [Google Scholar] [CrossRef]
- Soeken, M.; Mishchenko, A.; Petkovska, A.; Sterin, B.; Ienne, P.; Brayton, R.K.; De Micheli, G. Heuristic NPN classification for large functions using AIGs and LEXSAT. In Proceedings of the International Conference on Theory and Applications of Satisfiability Testing, Bordeaux, France, 5–8 July 2016; pp. 212–227. [Google Scholar]
- Huang, Z.; Wang, L.; Nasikovskiy, Y.; Mishchenko, A. Fast Boolean matching based on NPN classification. In Proceedings of the International Conference on Field-Programmable Technology, Kyoto, Japan, 9–11 December 2013; pp. 310–313. [Google Scholar] [CrossRef]
- Petkovska, A.; Soeken, M.; Micheli, G.D.; Ienne, P.; Mishchenko, A. Fast hierarchical NPN classification. In Proceedings of the International Conference on Field Programmable Logic and Applications, Lausanne, Switzerland, 29 August–2 September 2016; pp. 1–4. [Google Scholar] [CrossRef]
- Agosta, G.; Bruschi, F.; Pelosi, G.; Sciuto, D. A transform-parametric approach to Boolean matching. IEEE Trans. Comput.-Aided Des. Integr. Circuits Syst.
**2009**, 6, 805–817. [Google Scholar] [CrossRef] - Chen, K.C.; Yang, C.Y. Boolean matching algorithms. In Proceedings of the International Symposium on VLSI Technology, Systems, and Applications, Taipei, Taiwan, 12–14 May 1993; pp. 44–48. [Google Scholar]
- Kapoor, B. Improved technology mapping using a new approach to Boolean matching. In Proceedings of the European Design and Test Conference, Paris, France, 6–9 March 1995; pp. 86–90. [Google Scholar] [CrossRef][Green Version]
- Vos, A.D.; Baerdemacker, S.D. Symmetry groups for the decomposition of reversible computers, quantum computers, and computers in between. Symmetry
**2011**, 2, 305–324. [Google Scholar] [CrossRef] - Katebi, H.; Igor, I.L. Large-scale Boolean matching. In Proceedings of the Conference on Design, Automation and Test in Europe, Dresden, Germany, 8–12 March 2010; pp. 771–776. [Google Scholar] [CrossRef]
- Matsunaga, Y. Accelerating SAT-based Boolean matching for heterogeneous FPGAs using one-hot encoding and CEGAR technique. In Proceedings of the Design Automation Conference of 20th Asia and South Pacifics, Chiba, Japan, 19–22 January 2015; pp. 255–260. [Google Scholar] [CrossRef]
- Ghaderi, Z.; Bagherzadeh, N.; Albaqsami, A. STABLE: Stress-Aware Boolean Matching to Mitigate BTI-Induced SNM Reduction in SRAM-Based FPGAs. IEEE Trans. Comput.
**2018**, 99, 1. [Google Scholar] [CrossRef] - Cong, J.; Minkovich, K. Improved SAT-based Boolean matching using implicants for LUT-based FPGAs. In Proceedings of the ACM/sigda International Symposium on Field Programmable Gate Arrays, Monterey, CA, USA, 18–20 February 2007; pp. 139–147. [Google Scholar]
- Wang, K.H.; Chan, C.M.; Liu, J.C. Simulation and SAT-based Boolean matching for large Boolean networks. In Proceedings of the Design Automation Conference, San Francisco, CA, USA, 26–31 July 2009; pp. 396–401. [Google Scholar]
- Moore, J.; Fazel, K.; Thornton, M.A.; Miller, D.M. Boolean function matching using Walsh Spectral decision diagrams. In Proceedings of the Design, Applications, Integration and Software, Richardson, TX, USA, 29–30 October 2006; pp. 127–130. [Google Scholar] [CrossRef]
- Thornton, M.A.; Drechsler, R.; Gunther, W. Logic circuit equivalence checking using Haar Spectral coefficients and partial BDDs. VLSI Des.
**2014**, 1, 53–64. [Google Scholar] [CrossRef] - Zhang, J.S.; Chrzanowska-Jeske, M.; Mishchenko, A.; Burch, J.R. Linear cofactor relationships in Boolean functions. IEEE Trans. Comput.-Aided Des. Integr. Circuits Syst.
**2006**, 6, 1011–1023. [Google Scholar] [CrossRef]

#I | #B.N. | #C.N. | #D.N. | #R.T. | #B.N. of [5] | #C.N. of [5] | #D.N. of [5] | #R.T. of [5] | #R.T. of [6] |
---|---|---|---|---|---|---|---|---|---|

7 | 2.2 | 2.1 | 3.2 | 0.00024 | 4.6 | 2.8 | 4.1 | 0.00024 | 0.00067 |

8 | 2.1 | 1.9 | 3.4 | 0.00022 | 9.2 | 3.7 | 4.9 | 0.00030 | 0.00091 |

9 | 3.7 | 2.2 | 3.6 | 0.00034 | 11.5 | 7.1 | 5.0 | 0.00047 | 0.00099 |

10 | 1.9 | 1.8 | 3.5 | 0.00027 | 15.0 | 14.1 | 5.3 | 0.00074 | 0.00123 |

11 | 7.8 | 7.7 | 3.3 | 0.00059 | 19.4 | 19.2 | 4.2 | 0.00053 | 0.00228 |

12 | 2.1 | 2.1 | 3.2 | 0.00032 | 6.7 | 6.6 | 3.8 | 0.00146 | 0.00585 |

13 | 3.3 | 3.2 | 3.2 | 0.00061 | 16.9 | 16.4 | 4.3 | 0.00127 | 0.00638 |

14 | 2.1 | 2.0 | 3.3 | 0.00063 | 8.7 | 7.3 | 4.6 | 0.00217 | 0.02743 |

15 | 1.8 | 1.7 | 3.2 | 0.00079 | 8.2 | 6.9 | 4.6 | 0.00262 | 0.02998 |

16 | 2.5 | 2.4 | 3.5 | 0.00155 | 10.1 | 8.6 | 4.5 | 0.00426 | 0.04310 |

17 | 2.9 | 2.8 | 3.7 | 0.00308 | 9.3 | 8.4 | 4.8 | 0.00784 | 0.05044 |

18 | 2.3 | 2.2 | 3.2 | 0.00445 | 7.0 | 6.1 | 4.6 | 0.02274 | 0.07177 |

19 | 2.4 | 2.3 | 3.1 | 0.00870 | 7.7 | 6.6 | 4.2 | 0.03285 | 0.08870 |

20 | 3.0 | 2.9 | 3.6 | 0.02069 | 7.5 | 6.4 | 4.9 | 0.04337 | 0.13250 |

21 | 2.1 | 2.1 | 3.2 | 0.02879 | 9.6 | 8.6 | 4.3 | 0.11471 | 0.17362 |

22 | 3.8 | 3.8 | 3.6 | 0.10301 | 8.7 | 7.7 | 5.1 | 0.20554 | 0.30469 |

#I | #B.N. | #C.N. | #D.N. | #R.T. | #B.N. of [5] | #C.N. of [5] | #D.N. of [5] | #R.T. of [5] | #R.T. of [6] |
---|---|---|---|---|---|---|---|---|---|

7 | 1.0 | 1.0 | 1.5 | 0.00014 | 1.3 | 1.0 | 1.8 | 0.00012 | 0.00121 |

8 | 1.1 | 1.1 | 3.2 | 0.00042 | 1.2 | 1.2 | 3.5 | 0.00035 | 0.00146 |

9 | 1.2 | 1.2 | 1.8 | 0.00034 | 1.6 | 1.5 | 2.4 | 0.00051 | 0.00186 |

10 | 1.1 | 1.1 | 1.3 | 0.00060 | 3.4 | 1.5 | 1.5 | 0.00063 | 0.00193 |

11 | 1.0 | 1.0 | 1.3 | 0.00074 | 1.4 | 1.4 | 2.6 | 0.00078 | 0.00243 |

12 | 1.0 | 1.0 | 1.3 | 0.00080 | 1.3 | 1.2 | 1.7 | 0.00091 | 0.00255 |

13 | 1.1 | 1.0 | 2.5 | 0.00467 | 1.3 | 1.1 | 3.8 | 0.00447 | 0.00535 |

14 | 1.1 | 1.1 | 1.4 | 0.00401 | 1.2 | 1.1 | 2.0 | 0.00368 | 0.01245 |

15 | 1.4 | 1.3 | 2.0 | 0.00569 | 1.7 | 1.5 | 3.1 | 0.00475 | 0.04077 |

16 | 1.2 | 1.2 | 1.9 | 0.01346 | 2.0 | 1.6 | 3.2 | 0.00151 | 0.04849 |

17 | 1.1 | 1.1 | 1.5 | 0.10502 | 1.2 | 1.2 | 2.2 | 0.11518 | 0.31644 |

18 | 1.1 | 1.0 | 1.5 | 0.10944 | 1.5 | 1.5 | 2.5 | 0.23394 | 0.64273 |

19 | 1.8 | 1.8 | 2.6 | 0.80747 | 5.5 | 5.3 | 4.4 | 0.89123 | 1.62971 |

20 | 1.3 | 1.3 | 2.1 | 1.00309 | 2.9 | 2.8 | 2.7 | 1.28156 | 2.13035 |

21 | 1.3 | 1.3 | 1.5 | 3.73072 | 1.7 | 1.5 | 2.7 | 3.71382 | 10.2122 |

22 | 1.6 | 1.6 | 1.7 | 6.50130 | 2.8 | 2.7 | 3.1 | 6.24368 | 11.2760 |

© 2018 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Zhang, J.; Yang, G.; Hung, W.N.N.; Wu, J.; Zhu, Y.
A New Pairwise NPN Boolean Matching Algorithm Based on Structural Difference Signature. *Symmetry* **2019**, *11*, 27.
https://doi.org/10.3390/sym11010027

**AMA Style**

Zhang J, Yang G, Hung WNN, Wu J, Zhu Y.
A New Pairwise NPN Boolean Matching Algorithm Based on Structural Difference Signature. *Symmetry*. 2019; 11(1):27.
https://doi.org/10.3390/sym11010027

**Chicago/Turabian Style**

Zhang, Juling, Guowu Yang, William N. N. Hung, Jinzhao Wu, and Yixin Zhu.
2019. "A New Pairwise NPN Boolean Matching Algorithm Based on Structural Difference Signature" *Symmetry* 11, no. 1: 27.
https://doi.org/10.3390/sym11010027