<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE article  PUBLIC "-//NLM//DTD Journal Publishing DTD v3.0 20080202//EN" "http://dtd.nlm.nih.gov/publishing/3.0/journalpublishing3.dtd"><article xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" dtd-version="3.0" xml:lang="en" article-type="research article"><front><journal-meta><journal-id journal-id-type="publisher-id">CS</journal-id><journal-title-group><journal-title>Circuits and Systems</journal-title></journal-title-group><issn pub-type="epub">2153-1285</issn><publisher><publisher-name>Scientific Research Publishing</publisher-name></publisher></journal-meta><article-meta><article-id pub-id-type="doi">10.4236/cs.2016.79223</article-id><article-id pub-id-type="publisher-id">CS-69136</article-id><article-categories><subj-group subj-group-type="heading"><subject>Articles</subject></subj-group><subj-group subj-group-type="Discipline-v2"><subject>Computer Science&amp;Communications</subject><subject> Engineering</subject><subject> Physics&amp;Mathematics</subject></subj-group></article-categories><title-group><article-title>
 
 
  Design and Implementation of an Efficient Reversible Comparator Using TR Gate
 
</article-title></title-group><contrib-group><contrib contrib-type="author" xlink:type="simple"><name name-style="western"><surname>Subramanian</surname><given-names>Saravanan</given-names></name><xref ref-type="aff" rid="aff1"><sup>1</sup></xref><xref ref-type="corresp" rid="cor1"><sup>*</sup></xref></contrib><contrib contrib-type="author" xlink:type="simple"><name name-style="western"><surname>Ila</surname><given-names>Vennila</given-names></name><xref ref-type="aff" rid="aff1"><sup>1</sup></xref></contrib><contrib contrib-type="author" xlink:type="simple"><name name-style="western"><surname>Sudha</surname><given-names>Mohanram</given-names></name><xref ref-type="aff" rid="aff2"><sup>2</sup></xref></contrib></contrib-group><aff id="aff1"><addr-line>Department of EEE, P. S. G. College of Technology, Coimbatore, India</addr-line></aff><aff id="aff2"><addr-line>Sri Eshwar College of Engineering, Kondampatty, India</addr-line></aff><author-notes><corresp id="cor1">* E-mail:<email>subbri.saravanan@gmail.com(SS)</email>;</corresp></author-notes><pub-date pub-type="epub"><day>05</day><month>07</month><year>2016</year></pub-date><volume>07</volume><issue>09</issue><fpage>2578</fpage><lpage>2592</lpage><history><date date-type="received"><day>5</day>	<month>April</month>	<year>2016</year></date><date date-type="rev-recd"><day>accepted</day>	<month>20</month>	<year>April</year>	</date><date date-type="accepted"><day>27</day>	<month>July</month>	<year>2016</year></date></history><permissions><copyright-statement>&#169; Copyright  2014 by authors and Scientific Research Publishing Inc. </copyright-statement><copyright-year>2014</copyright-year><license><license-p>This work is licensed under the Creative Commons Attribution International License (CC BY). http://creativecommons.org/licenses/by/4.0/</license-p></license></permissions><abstract><p>
 
 
  Reversible logic is a new emerging technology with many promising applications in optical information processing, low power (Complementary Metal Oxide Semiconductor) CMOS design, (De Oxy RiboNucleic Acid) DNA computing, etc. In industrial automation, comparators play an important role in segregating faulty patterns from good ones. In previous works, these comparators have been implemented with more number of reversible gates and computational complexity. All these comparators use propagation technique to compare the data. This will reduce the efficiency of the comparators. To overcome the problem, this paper proposes an efficient comparator using (Thapliyal Ranganathan) TR gate utilizing full subtraction and half subtraction algorithm which will improve the computation efficiency. The comparator design using half subtraction algorithm shows an improvement in terms of quantum cost. The comparator design using full subtraction algorithm shows effectiveness in reducing number of reversible gates required and garbage output.
 
</p></abstract><kwd-group><kwd>Reversible Logic Gates</kwd><kwd> Reversible Logic Circuits</kwd><kwd> (Very Large Scale Integration) VLSI Design</kwd></kwd-group></article-meta></front><body><sec id="s1"><title>1. Introduction</title><p>Moore’s law states that number of transistors in a chip doubles every two years but chip size decreases. This cannot be reduced greatly which will lead to more power consumption. This paves the path to new technologies “Reversible logic” and “Quantum dot Cellular Automata (QCA)”. As stated by Launder during logical computation, a bit of information is lost. It dissipates 2ln (KT) energy, where K is Boltzman constant and T is temperature. Present day computers are formed of digital logic circuits where one bit of information is lost for every computation. This is called irreversible logic [<xref ref-type="bibr" rid="scirp.69136-ref1">1</xref>] . To overcome this problem Bennett proposed number of inputs and outputs makes equal which will dissipate less power as bits are preserved at the output [<xref ref-type="bibr" rid="scirp.69136-ref2">2</xref>] . This is called Reversible logic. A quantum computer uses principle of superposition and entanglement for qubit computation (quantum bit―the basic unit of information for quantum computers). Reversible logic plays an important role in converting classical computation to quantum computation. The basic properties of Reversible logic are:</p><p> Equal number of inputs and outputs</p><p> Unique nature of outputs one to one mapping.</p><p>The Input and Output mapping is shown in <xref ref-type="fig" rid="fig1">Figure 1</xref>.</p><p> Minimum garbage output</p><p> No feedback</p><p> No fan out</p><p> Minimum number of reversible gates to be used</p><p> Minimum number of constant inputs.</p><p>The number of 1 &#215; 1 or 2 &#215; 2 reversible gates needed to design a reversible logic circuit is called quantum cost.</p><p>The number of reversible gates including 3 &#215; 3 and 4 &#215; 4 reversible gates needed to design system is the number of reversible gates required.</p><p>The unused output in a reversible circuit is called garbage output.</p><p>Total logic calculation is the number of XOR, AND, NOT logic function used in the reversible circuit. α indicates number of XOR logic in the circuit; β indicates number of AND logic in the circuit and γ indicates number of NOT logic in the circuit.</p><p>Reversible gates are classified as 2 &#215; 2 gates, 3 &#215; 3 gates and 4 &#215; 4 gates. Example for 2 &#215; 2 gates is Feynman gate, and for 3 &#215; 3 gates are Taffoli gate and Peres gate. The Classification of Reversible Logic Gates is given in <xref ref-type="fig" rid="fig2">Figure 2</xref> [<xref ref-type="bibr" rid="scirp.69136-ref25">25</xref>] .</p><fig id="fig1"  position="float"><label><xref ref-type="fig" rid="fig1">Figure 1</xref></label><caption><title> Input and output mapping</title></caption><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/43-7600721x7.png"/></fig><fig id="fig2"  position="float"><label><xref ref-type="fig" rid="fig2">Figure 2</xref></label><caption><title> Classification of reversible logic gates</title></caption><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/43-7600721x8.png"/></fig><p>The basic reversible gates are shown in <xref ref-type="fig" rid="fig3">Figure 3</xref> [<xref ref-type="bibr" rid="scirp.69136-ref3">3</xref>] .</p><sec id="s1_1"><title>1.1. Reversible Tr Gate</title><p>Thapliyal proposed a three input reversible gate called TR gate [<xref ref-type="bibr" rid="scirp.69136-ref3">3</xref>] . A, B and C are inputs and P, Q and R are corresponding outputs. The gate has unique one to one mapping.</p><p>The Reversible TR gate is given in <xref ref-type="fig" rid="fig4">Figure 4</xref>. The input and output functions are given by equations (1) and (2) respectively.</p><disp-formula id="scirp.69136-formula797"><label>(1)</label><graphic position="anchor" xlink:href="http://html.scirp.org/file/43-7600721x9.png"  xlink:type="simple"/></disp-formula><disp-formula id="scirp.69136-formula798"><label>(2)</label><graphic position="anchor" xlink:href="http://html.scirp.org/file/43-7600721x10.png"  xlink:type="simple"/></disp-formula><p>Research in reversible logic is getting importance today. Thapliyal and Srinivasan proposed a new reversible (Thapliyal Srinivasan Gate) TSG gate [<xref ref-type="bibr" rid="scirp.69136-ref4">4</xref>] and discuss about reversible carry look ahead adder and other adder architecture which forms a part of (Arithmetic and Logic Unit) ALU. The quantum cost of TSG gate is quiet high when compared to (Haghparast Navi Gate) HNG gate. Haghparast proposes two new 4 &#215; 4 bit reversible multiplier designs with less hardware complexity, less garbage bits, less quantum cost, and less constant inputs [<xref ref-type="bibr" rid="scirp.69136-ref5">5</xref>] and the architecture uses Peres gate for partial product generation. But the total logical calculation is more due to extra logics in Peres gate. Research is going on in deriving more applications out of it. Research is moving towards deriving a new application from reversible gates. Ancient Indians followed some sutras or formulae</p><fig id="fig3"  position="float"><label><xref ref-type="fig" rid="fig3">Figure 3</xref></label><caption><title> Basic reversible gates</title></caption><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/43-7600721x11.png"/></fig><fig id="fig4"  position="float"><label><xref ref-type="fig" rid="fig4">Figure 4</xref></label><caption><title> Reversible TR gate</title></caption><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/43-7600721x12.png"/></fig><p>for mathematical computation. These basic mathematical calculations form the base for modern VLSI architecture. Thapliyal discussed about performance of Vedic multipliers on (Field Programmable Gate Array) FPGA [<xref ref-type="bibr" rid="scirp.69136-ref6">6</xref>] and discusses the irreversible architecture based on delay. These architectures when implemented in VLSI will reduce power consumption. Ehsan Pour Ali Akbar, et al. proposed reversible signed Wallace tree multiplier in [<xref ref-type="bibr" rid="scirp.69136-ref7">7</xref>] . Synthesis of reversible circuits is discussed in [<xref ref-type="bibr" rid="scirp.69136-ref8">8</xref>] - [<xref ref-type="bibr" rid="scirp.69136-ref13">13</xref>] . It discusses about Binary Decision Diagram synthesis methods, exact synthesis approach and transformation based synthesis. Testing of reversible circuits is discussed in [<xref ref-type="bibr" rid="scirp.69136-ref14">14</xref>] .</p><p>Research in reversible logic is getting importance today. Nagamani et al. presented reversible 1 bit comparators [<xref ref-type="bibr" rid="scirp.69136-ref15">15</xref>] . The comparators were designed using BJN gate, Peres gate and Feynman gate. Lihui et al. proposed reversible 4 bit comparator using NLG gate [<xref ref-type="bibr" rid="scirp.69136-ref16">16</xref>] . NLG gate is a 2 &#215; 2 reversible gate. The gate works on the principle that when both inputs are same second output is one. This is similar to EXNOR logic. It is considered as complement of Feynman gate. Haghparast et al. proposed a 4 bit comparator using subtraction logic using HNG gate adopting carry propagation technique [<xref ref-type="bibr" rid="scirp.69136-ref17">17</xref>] . It requires 4 HNG gates, 4 Peres gates and 2 Feynman gates for 4 bit comparator design. Molecular design of half subtractor using Tetraphenylporphyrin was discussed in [<xref ref-type="bibr" rid="scirp.69136-ref18">18</xref>] . Kaur et al. discussed about Reversible design of full adder/full subtractor in [<xref ref-type="bibr" rid="scirp.69136-ref19">19</xref>] . The design uses parity preserving gate used in fault tolerant systems. Normally Fredkin gate is used as parity preserving logic. The uniqueness of the system is that number of “1”s in input is equal to number of “1” s in output. Haghparast proposed a new reversible (Binary Coded decimal) BCD subtractor using genetic algorithm in [<xref ref-type="bibr" rid="scirp.69136-ref20">20</xref>] . Haghparast proposed fault tolerant reversible BCD adder in [<xref ref-type="bibr" rid="scirp.69136-ref21">21</xref>] . The design uses fault tolerant NFT reversible gates and F2G gates. It provides an optimized design. Haghparast proposed reversible BCD adder/subtractor in [<xref ref-type="bibr" rid="scirp.69136-ref22">22</xref>] . The reversible BCD adder/subtractor units were designed using genetic algorithm for optimization approaches.</p><p>This paper designs a reversible comparator using TR gate proposed by Thapliyalusing full subtraction and half subtraction algorithm and analyzes the performance of the comparators in terms of quantum cost, number of gates and garbage output. The rest of the paper discusses proposed comparator design in Chapter 2, results and discussion in Chapter 3 and finally conclusion.</p></sec></sec><sec id="s2"><title>2. Proposed Comparator</title><p>In present day industrial automation, comparators play a major role. Digital comparator are used in computer processors, and moreover it can be used in some industrial automation devices that contrast visual images with digital images, as in the case of mechanical engineering industry that relies on computer-aided drafting (CAD) programs to check good products from faulty ones. They also can be employed to convert analog signals into digital patterns. A digital comparator also can be used along with a number of other devices to act as a monitor in an industrial setting to monitor accurate state of a machine. In view of importance of comparator in many industrial applications, this paper proposes reversible comparator design using TR gate proposed by Thapliyal (it is used as full subtractor). The comparator is designed with full subtraction algorithm and half subtraction algorithm. The proposed design is compared with previous works in terms of Quantum Cost, number of reversible gates, number of garbage outputs.</p><sec id="s2_1"><title>2.1. Comparator System Design</title><p>The comparator system consists of data segregator, comparator using the above algorithms and equvalence checker. The comparator system is shown in <xref ref-type="fig" rid="fig5">Figure 5</xref>. The data segregator as already described in algorithm it segregates the incoming data into Least Significant Bits (LSB) and Most Significant Bits (MSB). First the segregated MSB data is passed through the comparator which uses half subtraction or full subtraction algorithm. The carry and difference obtained is compared with to get data is greater or smaller.</p></sec><sec id="s2_2"><title>2.2. Reversible Comparator Using Full Subtraction Method</title><p>Reversible comparator is designed based on the subtraction algorithm. The paper uses full subtraction algorithm to compare 4 bit data. Carry is propagated between the bits. The same algorithm is used to design reversibe comparator based on TR gate subtractor. The design using TR gate requires 8 TR gates. To implement a subtractor module, 2 TR gates are needed. For 4 bit subtraction 8 TR gates are required. When end carry arises, A &lt; B. When end carry is “0”, A &gt; B. When all the difference bits and end carry bits are zero, then A = B. Each pair of TR gate acts as full subtractor. The architecture diagram for reversible comparator using full subtraction algorithm is shown in <xref ref-type="fig" rid="fig6">Figure 6</xref>.</p><p>In the comparator architecture shown below Q0-Q3 represents difference bits, R0-R3 represents borrow bits. For bits if borrow occurs Cout is “1”. A &lt; B. If borrow does not occur and if the difference is zero, then A = B. If borrow does not occurs but if the difference is not zero then A &gt; B. It involves carry propagation, so it is expected that computation delay will be little bit higher.</p></sec><sec id="s2_3"><title>2. 3. Reversible Comparator Using Half Subtraction Method</title><p>Reversible comparator is designed based on the half subtraction algorithm. This paper uses half subtraction algorithm to compare 4 bits of data. Carry is not propagated between the bits. Instead the carry generated in each bit is used to judge the comparison. The 4 bit data is divided into two sets of data LSB and MSB. The algorithm is explained below. The algorithm is used to design reversibe comparator based on TR gate subtractor. The design using TR gate requires 4 TR gates. To implement a half subtractor module, 1 TR gates is needed. For 4 bit subtraction 4 TR gates are required. The architecture diagram for reversible comparator using half subtr- action algorithm is shown in <xref ref-type="fig" rid="fig7">Figure 7</xref>.</p><fig id="fig5"  position="float"><label><xref ref-type="fig" rid="fig5">Figure 5</xref></label><caption><title> Comparator system</title></caption><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/43-7600721x13.png"/></fig><fig id="fig6"  position="float"><label><xref ref-type="fig" rid="fig6">Figure 6</xref></label><caption><title> Architecture diagram for reversible comparator using full subtraction algorithm</title></caption><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/43-7600721x14.png"/></fig><fig id="fig7"  position="float"><label><xref ref-type="fig" rid="fig7">Figure 7</xref></label><caption><title> Architecture diagram for reversible comparator using half subtraction algorithm</title></caption><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/43-7600721x15.png"/></fig><p>In the comparator architecture shown below D0-D3 represents difference bits, B0-B3 represents borrow bits. The data is verified from MSB to LSB. For MSB bits if borrow occurs. A &lt; B. If borrow does not occur and if the difference is zero, then A = B. If borrow does not occurs but if the difference is not zero then A &gt; B. To check the last two conditions equivalence checker is used. Since data verififcation starts from MSB to LSB, it is expected that computation delay will be less.</p><p>ALGORITHM</p><p>&#216; Segregate the 4 bit data and perform half subtraction on each of the minuend and subtrahend seperately.</p><p>&#216; Check from MSB, if carry occurs in the MSB, then subtrahend is greater.</p><p>&#216; If carry does not occur in MSB and difference is also “1”, then minuend is greater.</p><p>&#216; Else if carry does not occur in MSB and difference is also “0”, then check in next bit position if carry occurs then subtrahend is greater and repeat this for next set of bits.</p><p>&#216; If carry does not occur and difference is also ‘0’, then the two bits are equal.</p><p>&#216; If carry does not occur and difference results then minuend is greater.</p></sec><sec id="s2_4"><title>2.4. Equivalence Checker</title><p>The equivalence checker consists of feynman gates. The gate uses EXOR logic which is used to compare the data obtained from comparator with predefined pattern. The equivalence checker is given in <xref ref-type="fig" rid="fig8">Figure 8</xref>. The equivalence architecture shown below is scalable for ant number of bits. In the equivalence architecture borrow and difference bits obtained from comparator stage (TR half subtraction) is passed and verified. For eg. If D3 is zero and is passed through equivalence checker, the checker output is zero. Otherwise if D3 is not zero and is passed through equivalence checker,the checker output is not zero. In this case borrow B3 has to be checked, if in the equivalence checker output is one, then A &lt; B, otherwise A &gt; B.</p></sec></sec><sec id="s3"><title>3. Results and Discussions</title><p>The proposed method is verified for functional verification in Xilinx 9.2 using verilog simulator. The results for Comparator using the full subtraction algorithm is shown in <xref ref-type="fig" rid="fig9">Figure 9</xref>. Results for Comparator using half subtraction algorithm is shown in <xref ref-type="fig" rid="fig1">Figure 1</xref>0.</p><p>In <xref ref-type="fig" rid="fig9">Figure 9</xref> a1, b1 and c1 are inputs, z1 is the difference output and r21 is the carry output. If a1 = 4, b1 = 2, c1 = 0, then the difference z1 is 2, carry r21 is “0”. This indicates a1 &gt; b1. If a1 = 2, b1 = 4, c1 = 0, then the difference z1 is E, carry r21 is “1”. This indicates a1 &lt; b1. If a1 = 4, b1 = 4, c1 = 0, then the difference z1 is “0”, carry r21 is “0”. This indicates a1 = b1.</p><p>In <xref ref-type="fig" rid="fig1">Figure 1</xref>0, case 1 consider the data “21” &amp; “20”. The data are segregated into MSB and LSB bits as discussed below.When the data are subtracted from MSB bits, MSB bits are equal as difference and carry is “0”. So next LSB bits are considered for computation. The difference is “1” and carry is “0” which indicates miuend is greater.</p><fig id="fig8"  position="float"><label><xref ref-type="fig" rid="fig8">Figure 8</xref></label><caption><title> Equivalence checker</title></caption><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/43-7600721x16.png"/></fig><fig-group id="fig9"><label><xref ref-type="fig" rid="fig9">Figure 9</xref></label><caption><title> Results for Comparator using the full subtraction algorithm.</title></caption><fig id ="fig9_1"><label></label><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/43-7600721x17.png"/></fig><fig id ="fig9_2"><label></label><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/43-7600721x18.png"/></fig><fig id ="fig9_3"><label></label><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/43-7600721x19.png"/></fig></fig-group><p>a1 and b1 corresponds to MSB bits. c1 and d1 corresponds to LSB bits are inputs, q2 and q3 corresponds to difference bits and r and r1 corresponds to carry bits. Here a1 and c1 are minuend, b1 and d1 are subtrachend. If a1 = 2, b1 = 2, c1 = 1 and d1 = 0, then the difference occurs in q3 and carry does not occur.This indicates miuend is greater.</p><p>Case 2 consider the data “32” &amp; “22”. The data are segregated into MSB and LSB bits as discussed below.When the data are subtracted from MSB bits, MSB bits are not equal difference occurs and carry does not occur. The difference is “1” and borrow is “0” which indicates miuend is greater. If a1 = 3, b1 =2, c1 =2 and d1 = 2, then the difference occurs in q2 and carry does not occur. This indicates miuend is greater.</p><p>Case 3 consider the data “21’ &amp; “22”. The data are segregated into MSB and LSB bits as discussed below.When the data are subtracted from MSB bits, MSB bits are equal difference does not occurs and carry does not occur.So next LSB bits are considered, “1” and “2” when subtracted difference is”1’ and carry is “1”. If a1 = 2, b1 = 2, c1 = 1 and d1 = 2, then the difference occurs in q3 and carry also occurs. This indicates subtrahend is greater.</p><p>Case iv consider the data “22” &amp; “32”. The data are segregated into MSB and LSB bits as discussed below.When the data are subtracted from MSB bits, MSB bits are not equal difference occurs and carry also occur. The data “2” and “3” when subtracted difference is “1” and carry is “1”. If a1 = 2, b1 = 3, c1 = 2 and d1 = 2, then the difference occurs in q2 and carry also occurs. This indicates subtrahend is greater.</p><p>TheComparitive analysis of reversible comparators is given in <xref ref-type="table" rid="table1">Table 1</xref>. On comparison the number of reversible gates required in the comparison using subtraction algorithm is less and also garbage output is also less. Quantum cost of TR gate is 6 [<xref ref-type="bibr" rid="scirp.69136-ref3">3</xref>] . So for 4 bit comparator design total quantum cost is 48. It is little bit higher than the existing one. The proposed comparator using half subtraction algorithm has quantum cost of 24. The comparator using half subtraction algorithm requires less quantum cost, number of reversible gates and garbage output.</p><p>In the existing technique [<xref ref-type="bibr" rid="scirp.69136-ref17">17</xref>] HNG gate is used, peres gate and feynman gate are used. It is three level network. The number of garbage output is two for HNG gate and for peres gate also garbage output is two. In [<xref ref-type="bibr" rid="scirp.69136-ref23">23</xref>] tree based approach is used. This involves signal propagation incurs compuational delay.</p><fig-group id="fig10"><label><xref ref-type="fig" rid="fig1">Figure 1</xref>0</label><caption><title> Results for Comparator using half subtraction algorithm.</title></caption><fig id ="fig10_1"><label></label><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/43-7600721x20.png"/></fig><fig id ="fig10_2"><label></label><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/43-7600721x21.png"/></fig><fig id ="fig10_3"><label></label><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/43-7600721x22.png"/></fig><fig id ="fig10_4"><label></label><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/43-7600721x23.png"/></fig></fig-group><p>In the existing technique [<xref ref-type="bibr" rid="scirp.69136-ref24">24</xref>] four ZRQC1 gates, 6 Peres gates and 3 Feynman gates are used. It is multi level network and moreover the data is propagated. This obviously pass on the delay. Computational delay will be more. In [<xref ref-type="bibr" rid="scirp.69136-ref15">15</xref>] by using BJN reversible gate and TR gate, for one bit comparision three reversible gates are needed. This increases cost overhead. When the nmber of gates increases computational delay also increases. Similarly for one bit comparision, using Peres gate and BJN gate, 3 reversible gates are needed. By using Taffoli and BJN gate 4 reversible gates are needed to design one bit comparator. By using Fredkin and BJN gate for one bit comparision it requires 5 reversible gates.</p><p>In the proposed method, TR gate and Feynman gate are used in half subtraction mode which generates less garbage output and less quantum cost. The data is checked from MSB to LSB. If in the MSB, carry generated then there is no need for comparison of successive bits. This reduces delay in comparison for higher value of MSB.</p><p>The Comparitive analysis of reversible comparators for 8 bit comparator is shown in <xref ref-type="table" rid="table2">Table 2</xref>. From the table it is inferred that number of gates and garbage output doubles but compartor using half subtraction algorithm yields good results. The comparison of various comparators based on quantum cost, garbage output and number of gates are shown in Figures 11(a)-(c) respectively.</p><p>From <xref ref-type="fig" rid="fig1">Figure 1</xref>1(a) it is found that comparator design using BJN gate and Fredkin gate offers high quantum cost. The proposed comparator using half subtraction algorithm offers less quantum cost. From <xref ref-type="fig" rid="fig1">Figure 1</xref>1(b) it is found that comparator design using NLG gate offers higher number of reversible gates. The proposed comparator using full subtraction algorithm offers less number of reversible gates. From <xref ref-type="fig" rid="fig1">Figure 1</xref>1(c) it is found that comparator design using BJN gate and Fredkin gate offers high garbage output. The proposed comparator using full subtraction algorithm offers less garbage output.</p></sec><sec id="s4"><title>4. Conclusion</title><p>In this paper, a reversible comparator using TR gate based on full subtraction algorithm and half subtraction</p><table-wrap id="table1" ><label><xref ref-type="table" rid="table1">Table 1</xref></label><caption><title> Comparative analysis of reversible comparators</title></caption><table><tbody><thead><tr><th align="center" valign="middle" ></th><th align="center" valign="middle" >Number of Gates</th><th align="center" valign="middle" >Number of Garbage</th><th align="center" valign="middle" >Quantum Cost</th></tr></thead><tr><td align="center" valign="middle" >Comparator proposed in [<xref ref-type="bibr" rid="scirp.69136-ref17">17</xref>]</td><td align="center" valign="middle" >10</td><td align="center" valign="middle" >15</td><td align="center" valign="middle" >42</td></tr><tr><td align="center" valign="middle" >Previous Comparator [<xref ref-type="bibr" rid="scirp.69136-ref17">17</xref>]</td><td align="center" valign="middle" >25</td><td align="center" valign="middle" >23</td><td align="center" valign="middle" >Unknown</td></tr><tr><td align="center" valign="middle" >Existing Comparator [<xref ref-type="bibr" rid="scirp.69136-ref24">24</xref>]</td><td align="center" valign="middle" >16</td><td align="center" valign="middle" >17</td><td align="center" valign="middle" >50</td></tr><tr><td align="center" valign="middle" >Comparator using TR gate using Half subtraction method</td><td align="center" valign="middle" >12</td><td align="center" valign="middle" >12</td><td align="center" valign="middle" >32</td></tr><tr><td align="center" valign="middle" >Comparator using TR gate using Full subtraction method</td><td align="center" valign="middle" >9</td><td align="center" valign="middle" >9</td><td align="center" valign="middle" >49</td></tr></tbody></table></table-wrap><table-wrap id="table2" ><label><xref ref-type="table" rid="table2">Table 2</xref></label><caption><title> Comparative analysis of reversible comparators for 8 bit comparators</title></caption><table><tbody><thead><tr><th align="center" valign="middle" >Architecture</th><th align="center" valign="middle" >Number of Gates</th><th align="center" valign="middle" >Number of Garbage</th><th align="center" valign="middle" >Quantum Cost</th></tr></thead><tr><td align="center" valign="middle" >Existing Comparator [<xref ref-type="bibr" rid="scirp.69136-ref23">23</xref>]</td><td align="center" valign="middle" ></td><td align="center" valign="middle" >42</td><td align="center" valign="middle" >135</td></tr><tr><td align="center" valign="middle" >Existing Comparator (Peres gate and BJN gate) [<xref ref-type="bibr" rid="scirp.69136-ref15">15</xref>]</td><td align="center" valign="middle" >24</td><td align="center" valign="middle" >16</td><td align="center" valign="middle" >80</td></tr><tr><td align="center" valign="middle" >Existing Comparator (Taffoli gate and BJN gate) [<xref ref-type="bibr" rid="scirp.69136-ref15">15</xref>]</td><td align="center" valign="middle" >32</td><td align="center" valign="middle" >16</td><td align="center" valign="middle" >128</td></tr><tr><td align="center" valign="middle" >Existing Comparator (Fredkin gate and BJN gate) [<xref ref-type="bibr" rid="scirp.69136-ref15">15</xref>]</td><td align="center" valign="middle" >40</td><td align="center" valign="middle" >48</td><td align="center" valign="middle" >184</td></tr><tr><td align="center" valign="middle" >Existing Comparator (TR and BJN gate) [<xref ref-type="bibr" rid="scirp.69136-ref15">15</xref>]</td><td align="center" valign="middle" >24</td><td align="center" valign="middle" >16</td><td align="center" valign="middle" >96</td></tr><tr><td align="center" valign="middle" >Comparator proposed in [<xref ref-type="bibr" rid="scirp.69136-ref17">17</xref>]</td><td align="center" valign="middle" >20</td><td align="center" valign="middle" >30</td><td align="center" valign="middle" >84</td></tr><tr><td align="center" valign="middle" >Previous Comparator [<xref ref-type="bibr" rid="scirp.69136-ref17">17</xref>]</td><td align="center" valign="middle" >50</td><td align="center" valign="middle" >46</td><td align="center" valign="middle" >Unknown</td></tr><tr><td align="center" valign="middle" >Existing Comparator [<xref ref-type="bibr" rid="scirp.69136-ref24">24</xref>]</td><td align="center" valign="middle" >32</td><td align="center" valign="middle" >34</td><td align="center" valign="middle" >112</td></tr><tr><td align="center" valign="middle" >Proposed Comparator using TR gate using Full subtraction method</td><td align="center" valign="middle" >18</td><td align="center" valign="middle" >18</td><td align="center" valign="middle" >98</td></tr><tr><td align="center" valign="middle" >Proposed Comparator using TR gate using Half subtraction method</td><td align="center" valign="middle" >24</td><td align="center" valign="middle" >24</td><td align="center" valign="middle" >64</td></tr></tbody></table></table-wrap><fig-group id="fig11"><label><xref ref-type="fig" rid="fig1">Figure 1</xref>1</label><caption><title> (a) Comparison of various comparators based on quantum cost. (b) Comparison of various comparators based on garbage output. (c) Comparison of various comparators based on number of gates.</title></caption><fig id ="fig11_1"><label>(b)</label><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/43-7600721x24.png"/></fig><fig id ="fig11_2"><label>(c)</label><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/43-7600721x25.png"/></fig><fig id ="fig11_3"><label></label><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/43-7600721x26.png"/></fig></fig-group><p>algorithm was presented and analyzed with existing comparators. It is found that comparator designed half subtraction algorithm using TR gate shows effectiveness in terms of quantum cost but at the expense of number of reversible gates and garbage output. Reversible comparator using full subtraction algorithm proposed is performing better in terms of number of reversible gates and garbage output since equivalence checker circuit is not needed. The same algorithm may be implemented with Delay elements in between by principle of retiming to reduce critical path delay. The future scope of the work is to realize these reversible logic gates in DNA molecules and implement these arithmetic systems so as to reduce power consumption.</p></sec><sec id="s5"><title>Cite this paper</title><p>Subramanian Saravanan,Ila Vennila,Sudha Mohanram, (2016) Design and Implementation of an Efficient Reversible Comparator Using TR Gate. Circuits and Systems,07,2578-2592. doi: 10.4236/cs.2016.79223</p></sec><sec id="s6"><title>NOTES</title></sec></body><back><ref-list><title>References</title><ref id="scirp.69136-ref1"><label>1</label><mixed-citation publication-type="other" xlink:type="simple">Landauer, R. (1961) Irreversibility and Heat Generation in the Computing Process. IBM Journal of Research and Development, 5, 183-191. http://dx.doi.org/10.1147/rd.53.0183</mixed-citation></ref><ref id="scirp.69136-ref2"><label>2</label><mixed-citation publication-type="other" xlink:type="simple">Bennett, C. (1973) Logical Reversibility of Computation. IBM Journal of Research and Development, 17, 525-532.http://dx.doi.org/10.1147/rd.176.0525</mixed-citation></ref><ref id="scirp.69136-ref3"><label>3</label><mixed-citation publication-type="other" xlink:type="simple">Thapliyal, H. and Ranganathan, N. (2011) A New Design of the Reversible Subtractor Circuit. Proceedings of IEEE International Conference on Nanotechnology, Portland, 15-18 August 2011, 1430-1435.</mixed-citation></ref><ref id="scirp.69136-ref4"><label>4</label><mixed-citation publication-type="other" xlink:type="simple">Thapliyal, H. and Srinivas, M.B. (2005) Novel Reversible “TSG” Gate and Its Application for Designing Reversible Carry Look Ahead Adder and Other Adder Architectures. Springer-Verlag Lecture Notes in Computer Science, Proceedings of the 10th Asia-Pacific Computer Systems Architecture Conference—ACSAC, 3740, 775-786.</mixed-citation></ref><ref id="scirp.69136-ref5"><label>5</label><mixed-citation publication-type="other" xlink:type="simple">Haghparast, M., Jassbi, S.J., Navi, K. and Hashemipour, O. (2008) Design of a Novel Reversible Multiplier Circuit Using HNG Gate in Nanotechnology. World Applied Sciences Journal, 3, 974-978.</mixed-citation></ref><ref id="scirp.69136-ref6"><label>6</label><mixed-citation publication-type="other" xlink:type="simple">Thapliyal, H. and Srinivas, M.B. (2004) High Speed Efficient N × N Bit Parallel Hierarchical Overlay Multiplier Architecture Based on Ancient Indian Vedic Mathematic. Transactions on Engineering, Computing and Technology, 2, 225-228.</mixed-citation></ref><ref id="scirp.69136-ref7"><label>7</label><mixed-citation publication-type="other" xlink:type="simple">Akbar, E.P.A., Haghparast, M. and Keivan Navi, B.N. (2011) Novel Design of a Fast Reversible Wallace Sign Multiplier Circuit in Nanotechnology. Microelectronics Journal, 42, 973-981. http://dx.doi.org/10.1016/j.mejo.2011.05.007</mixed-citation></ref><ref id="scirp.69136-ref8"><label>8</label><mixed-citation publication-type="other" xlink:type="simple">Wille, R. and Groβe, D. (2007) Fast Exact Toffoli Network Synthesis of Reversible Logic. Proceedings of International Conference on Computer-Aided Design, San Jose, 4-8 November 2007, 60-64. http://dx.doi.org/10.1109/iccad.2007.4397244</mixed-citation></ref><ref id="scirp.69136-ref9"><label>9</label><mixed-citation publication-type="other" xlink:type="simple">Wille, R., Le, H.M., Dueck, G.W. and Groβe, D. (2008) Quantified Synthesis of Reversible Logic. Proceedings of Design Automation &amp; Test Europe Conference, Munich, 10-14 March 2008, 1015-1020.</mixed-citation></ref><ref id="scirp.69136-ref10"><label>10</label><mixed-citation publication-type="other" xlink:type="simple">Shende, V.V., Prasad, A.K., Markov, I.L. and Hayes, J.P. (2002) Synthesis of Reversible Logic Circuits. Proceedings of International Conference on Computer-Aided Design, 10-14 November 2002, 353-360. http://dx.doi.org/10.1109/iccad.2002.1167558</mixed-citation></ref><ref id="scirp.69136-ref11"><label>11</label><mixed-citation publication-type="other" xlink:type="simple">Hung, W.N.N., Song, X., Yang, G., Yang, J. and Perkowski, M. (2004) Quantum Logic Synthesis by Symbolic Reachability Analysis. Proceedings of Design Automation Conference, San Diego, 7-11 July 2004, 838-841.</mixed-citation></ref><ref id="scirp.69136-ref12"><label>12</label><mixed-citation publication-type="other" xlink:type="simple">Viamontes, G.F., Markov, I.L. and Hayes, J.P. (2007) Checking Equivalence of Quantum Circuits and States. Proceedings of International Conference on CAD, San Jose, 4-7 November 2007, 69-74. http://dx.doi.org/10.1109/iccad.2007.4397246</mixed-citation></ref><ref id="scirp.69136-ref13"><label>13</label><mixed-citation publication-type="journal" xlink:type="simple"><name name-style="western"><surname>Wang</surname><given-names> S.A.</given-names></name>,<name name-style="western"><surname> Lu</surname><given-names> C.Y.</given-names></name>,<name name-style="western"><surname> Tsai</surname><given-names> I.M. and Kuo. S.Y. </given-names></name>,<etal>et al</etal>. (<year>2008</year>)<article-title>An XQDD-Based Verification Method for Quantum Circuits</article-title><source> IEICE Transactions</source><volume> 91</volume>,<fpage> 584</fpage>-<lpage>594</lpage>.<pub-id pub-id-type="doi"></pub-id></mixed-citation></ref><ref id="scirp.69136-ref14"><label>14</label><mixed-citation publication-type="other" xlink:type="simple">Wille, R., Groβe, D., Miller, D.M. and Drechsler, R. (2009) Equivalence Checking of Reversible Circuits. International Symposium on Multi-Valued Logic, Naha, 21-23 May 2009, 324-330. http://dx.doi.org/10.1109/ismvl.2009.19</mixed-citation></ref><ref id="scirp.69136-ref15"><label>15</label><mixed-citation publication-type="other" xlink:type="simple">Nagamani, A.N., Jayashree, H.V. and Bhagyalakshmi, H.R. (2011) Novel Low Power Comparator Design Using Reversible Logic Gates. Indian Journal of Computer Science and Engineering, 2, 566-574.</mixed-citation></ref><ref id="scirp.69136-ref16"><label>16</label><mixed-citation publication-type="other" xlink:type="simple">Ni, L.H., Guan, Z.J., Dai, X.Y. and Li, W.J. (2010) Using New Designed NLG Gate for the Realization of Four-Bit Reversible Numerical Comparator. Proceedings of International Conference on Educational and Network Technology, Qinhuangdao, 25-27 June 2010, 254-258.</mixed-citation></ref><ref id="scirp.69136-ref17"><label>17</label><mixed-citation publication-type="other" xlink:type="simple">Haghparast, M., Rezazadeh, L. and Seivani, V. (2011) Design and Optimization of Nanometric Reversible 4 Bit Numerical Comparator. Middle-East Journal of Scientific Research, 7, 581-584.</mixed-citation></ref><ref id="scirp.69136-ref18"><label>18</label><mixed-citation publication-type="other" xlink:type="simple">Langford, S.J. and Yann, T. (2003) Molecular Logic: A Half-Subtractor Based on Tetraphenylporphyrin. Journal of the American Chemical Society, 125, 1198-1199.</mixed-citation></ref><ref id="scirp.69136-ref19"><label>19</label><mixed-citation publication-type="other" xlink:type="simple">Kaur, P. and Dhaliwal, B.S. (2012) Design of Fault Tolerant Full Adder/ Subtarctor Using Reversible Gates. Proceedings of International Conference on Computer Communication and Informatics (ICCCI), Coimbatore, 10-12 January 2012, 1-5.</mixed-citation></ref><ref id="scirp.69136-ref20"><label>20</label><mixed-citation publication-type="other" xlink:type="simple">Mohammadi, M., Haghparast, M., Eshghi, M. and Navi, K. (2009) Minimization and Optimization of Reversible BCD-Full Adder/Subtractor Using Genetic Algorithm and Don’t Care Concept. International Journal of Quantum Information, 7, 969-989. http://dx.doi.org/10.1142/S0219749909005523</mixed-citation></ref><ref id="scirp.69136-ref21"><label>21</label><mixed-citation publication-type="journal" xlink:type="simple"><name name-style="western"><surname>Haghparast</surname><given-names> M. </given-names></name>,<etal>et al</etal>. (<year>2011</year>)<article-title>Design and Implementation of Nanometric Fault Tolerant Reversible BCD Adder</article-title><source> Australian Journal of Basic and Applied Sciences</source><volume> 5</volume>,<fpage> 896</fpage>-<lpage>901</lpage>.<pub-id pub-id-type="doi"></pub-id></mixed-citation></ref><ref id="scirp.69136-ref22"><label>22</label><mixed-citation publication-type="other" xlink:type="simple">Mohammadi, M., Eshghi, M., Haghparast, M. and Bahrololoom, A. (2008) Design and Optimization of Reversible BCD Adder/Subtractor Circuit for Quantum and Nanotechnology Based Systems. World Applied Sciences Journal, 4, 787-792.</mixed-citation></ref><ref id="scirp.69136-ref23"><label>23</label><mixed-citation publication-type="other" xlink:type="simple">Thapliyal, H., Ranganathan, N. and Ferreira, R. (2010) Design of a Comparator Tree Based on Reversible Logic. IEEE International Conference on Nanotechnology, Seoul, August 2010, 1113-1116.</mixed-citation></ref><ref id="scirp.69136-ref24"><label>24</label><mixed-citation publication-type="other" xlink:type="simple">Zhou, R.-G., Zhang, M.-Q., Wu, Q. and Li, Y.-C. (2013) Optimization Approaches for Designing a Novel 4-Bit Reversible Comparator. International Journal of Theoretical Physics, 52, 559-575.</mixed-citation></ref><ref id="scirp.69136-ref25"><label>25</label><mixed-citation publication-type="other" xlink:type="simple">Saravanan, S., Vennila, I. and Mohanram, S. (2016) Design and Implementation of Efficient Reversible Arithmetic and Logic Unit. Circuits and Systems, 7, 630-642. http://dx.doi.org/10.4236/cs.2016.76054</mixed-citation></ref></ref-list></back></article>