Verilog Implementation of Reversible Logic Gate
Verilog Implementation of Reversible Logic Gate
Verilog Implementation of Reversible Logic Gate
This is due to the mismatch of inputs and outputs. Reversible Logic is gaining interest in the recent past due to its less
heat dissipating characteristics. This logic circuit maps to its unique input to the output and ensure one to one mapping and basis
for emerging applications like DNA Computing, Bioinformatics, Nanotechnologies, Quantum Computing, Quantum Dot Cellular
Data, Adiabatic CMOS, Thermodynamics, Low power Design and Optical Computing to produce zero power dissipation under
ideal conditions.
This paper presents the combinational circuit and Verilog code for the basic Reversible Logic gates which are important
(Feynman, Double Feynman, Fredkin, Toffoli and peres ). Every Logic circuit which is combinational uses all these basic
Reversible Logic Gates and can be verified through Simulation using Verilog HDL.
Keywords— Reversible Logic gates, Quantum Computing, Reversible Logic, Feynman, Fredkin, Toffoli and peres.
155
International Journal of Engineering Research in Electronic and Communication
Engineering (IJERECE) Vol 3, Issue 3, March 2016
The Boolean function f(x1, x2 … xn) of n Boolean This refers to the number of levels in the circuit
variables is called reversible if: which are required to realize the given logic functions.
1. The number of outputs is equal to the number of
inputs. H. Hardware Complexity:
2. Any output pattern maps to a unique input pattern.
This refers to the total number of logic operation in
In other words, reversible functions are those that perform a circuit. Means the total number of AND, OR and EXOR
permutations of the set of input vectors [7-9]. operation in a circuit [11] and [15].
For an (n, k) function, i.e. function with n-input k-
output, it is necessary to add inputs and/or outputs to make it I. Design Constraints for Reversible Logic Circuits:
reversible. This leads to the following definition.
Reversible logic imposes many design constraints
B. Reversible logic gate: that need to be either ensured or optimized for implementing
any particular Boolean functions.
Reversible Gates are circuits in which number of outputs is 1) In reversible logic circuit the number of inputs
equal to the number of inputs and there is a one to one must be equal to the number of outputs.
correspondence between the vector of inputs and outputs 2) For each input pattern there must be a unique
[10- 12]. It not only helps us to determine the outputs from output pattern.
the inputs but also helps us to uniquely recover the inputs 3) Each output will be used only once, that is, no fan
from the outputs. out is allowed.
4) The resulting circuit must be acyclic.
C. Ancilla inputs/ constant inputs:
Anicilla inputs are used to denote the present value III. REVERSIBLE LOGIC GATES
inputs that were added to an (n, k) function to make it
reversible. The constant inputs are known as ancilla inputs. In this section, we describe all about reversible
[13]. logic and reversible logic gates. Though it is already briefly
described about garbage outputs, in this section we will
D. Garbage outputs: define these with more appropriate Reversible logic gates.
Garbage is the number of outputs added to make an (i) NOT Gate: 1*1 NOT gate is the simplest among all the
n-input k-output function ((n; k) function) reversible. The reversible gates where the gate has only one input (A) and
relation between garbage outputs and constant inputs is [7]
156
International Journal of Engineering Research in Electronic and Communication
Engineering (IJERECE) Vol 3, Issue 3, March 2016
one output (B) such that B = A’. The block diagram for 1*1
NOT gate is shown in Fig.3.1. (Quantum Cost = 0)
Code :
157
International Journal of Engineering Research in Electronic and Communication
Engineering (IJERECE) Vol 3, Issue 3, March 2016
Code:
158
International Journal of Engineering Research in Electronic and Communication
Engineering (IJERECE) Vol 3, Issue 3, March 2016
(vi) Peres Gate: Let Iv and Ov be the input and output Carry = ((A XOR B) C) XOR AB
vector of a 3*3 Peres Gate [18,20,21] respectively, where
Iv=(A,B,C) and Ov=(X=A,Y=A⊕B , Z=AB⊕C). Fig. 3.11 For this we go with peres gate as it has low
shows the block diagram of 3*3 Peres gate. (Quantum Cost quantum cost as compared with the discussed above basic
= 4) Reversible Logic gates. The Peres implemented Full Adder
with its corresponding quantum cost is shown in the figure
4.1
module Peres(input A,B,C, output X,Y,Z ); Figure 4.1:Full Adder using Peres Gates
assign X = A;
assign Y =A^B; Code:
assign Z =(A&B)^C;
endmodule module FULLADDER( input A,B,Cin, output SUM,Cout
);
Peres P1(A,B,0,G1,G2,G3);
Peres P2(G2,Cin,G3,G4,SUM,Cout);
endmodule
159
International Journal of Engineering Research in Electronic and Communication
Engineering (IJERECE) Vol 3, Issue 3, March 2016
VII. CONCLUSION
Figure 4.4: PFA traditional logic implementation.
This paper presents Verilog CODE for all
Once we take the PFA as a block, we can derive Reversible Logic Gates, which provide us to design Verilog
the algorithm to implement an n-bits adder. This algorithm CODE of any complex combinational circuit. Here we have
was implemented in this design for a 4-bit adder and can be tried to make the Verilog code as much as possible. We can
seen in figure 4.5. simulate and synthesis it using Xilinx 15.1 software and
verified using Z series board and also calculate the power
consumption and compare it with the irreversible
Combinational Circuits.
REFERENCES
160
International Journal of Engineering Research in Electronic and Communication
Engineering (IJERECE) Vol 3, Issue 3, March 2016
BETWEEN REVERSIBLE AND 16. Milburn, Gerard.j., The Feynman processor perseus
CONVENTIONAL LOGIC GATES”, International books 1998
Journal of Engineering Research and Applications
(IJERA) ISSN: 2248-9622 www.ijera.com Vol. 2, 17. Feynman R., 1985. Quantum mechanical
Issue 2,Mar-Apr 2012, pp.148-151 computers, Optics News, 11: 11-20.
161