Reversible Multiplexer Document
Reversible Multiplexer Document
Low power architectures are more pronounced for different applications that
extend from Internet of Things to Quantum computing. Primitive
combinational logic circuits induce from bit deletion due to information loss
during the processing of input information which results in energy loss. The
computations involving reversibility cancel the loss of information by
sustaining the input bits from output. In the basic arithmetic and logic units,
the combinational circuits play a significant role in determining the
performance of the processor. The principals involved in the design of
reversibility is an upcoming technology for ultra-low power applications. The
reversible logic circuits furnish a thoroughly new way to progress in Quantum
computing. In this article, we propose an energy tolerant low power reversible
multiplexer with optimum energy loss. The proposed multiplexer also reduces
the ancillae, garbage outputs and quantum cost considerably.
CHAPTER – 1
INTRODUCTION
1.1 Introduction to VLSI:
Before the introduction of VLSI technology, most ICs had a limited set of
functions they could perform. An electronic circuit might consist of a CPU,
ROM, RAM and other glue logic. VLSI lets IC designers add all of these into
one chip.
The electronics industry has achieved a phenomenal growth over the last few
decades, mainly due to the rapid advances in large scale integration
technologies and system design applications. With the advent of very large
scale integration (VLSI) designs, the number of applications of integrated
circuits (ICs) in high-performance computing, controls, telecommunications,
image and video processing, and consumer electronics has been rising at a very
fast pace.
The current cutting-edge technologies such as high resolution and low bit-rate
video and cellular communications provide the end-users a marvelous amount
of applications, processing power and portability. This trend is expected to
grow rapidly, with very important implications on VLSI design and systems
design.
The entire design process follows a step-by-step approach, and the following
are the front-end design steps:
Logic Design: This step involves control flow, Boolean expressions, word
width, and register allocation.
Circuit Design: This step performs the realization of the circuit in the form
of a netlist. Since this is a software step, it utilizes simulation to check the
outcome.
Physical Design: In this step, we create the layout by converting the netlist
into a geometrical depiction. This step also follows some preconceived static
rules, such as the lambda rules, which afford precise details of the ratio,
spacing between components, and size.
The following are the back-end design steps for hardware development:
Wafer Processing: This step utilizes pure silicon melted in a pot at 1400º C.
Then, a small seed comprising the required crystal orientation is injected into
liquefied silicon and gradually pulled out, 1mm per minute. We manufacture
the silicon crystal as a cylindrical ingot and cut it into discs or wafers before
polishing and crystal orientation.
Etching: Here, we selectively remove material from the surface of the wafer
to produce patterns. With an etching mask to protect the essential parts of the
material, we use additional plasma or chemicals to remove the remaining
photoresist.
Metallization: In this step, we apply a thin layer of aluminum over the entire
wafer.
Assembly and Packaging: Every one of the wafers contains hundreds of
chips. Therefore, we use a diamond saw to cut the wafers into single chips.
Afterward, they receive electrical testing, and we discard the failures. In
contrast, those that pass receive a thorough visual inspection utilizing a
microscope. Finally, we package the chips that pass the visual inspection as
well as recheck them.
What is a Multiplexer?
A multiplexer (sometimes spelled multiplexor and also known as a MUX) is
defined as a combinational circuit that selects one of several data inputs and
forwards it to the output. The inputs to a multiplexer can be analog or digital.
Multiplexers are also known as data selectors.
A multiplexer efficiently transmits large data volumes over a network within
limited time and bandwidth.
Multiplexers that are built from transistors and relays are termed as analog
multiplexers which are used in analog applications and Multiplexers that are
built from logic gate termed as digital multiplexers which are used in digital
applications. The inverse of a multiplexer is known as a demultiplexer.
In digital systems, many times it is necessary to select a single data line from
several data-input lines and the data from the selected data input line should be
available on the output line. The digital circuit which does this task is a
multiplexer.
A multiplexer is a digital circuit that selects one of the n data inputs and
forwards it to the output. The selection of one of the n inputs is done by the
select inputs. To select one of several inputs, we need m select lines such that
2m=n.
Depending on the digital code applied at the select inputs, one of the n data
inputs is selected and transmitted to the single output. Hence, a multiplexer has
maximum 2n data input lines, ‘m’ selects lines, and one output line.
The block diagram of an n-to-1 multiplexer and its equivalent circuit is shown
in the figure below.
Multiplexer Circuit
There are many types of multiplexers – like 2-to-1, 4-to-1, and 8-to-1
multiplexers. Each one has a different circuit, truth table, boolean expression,
and working principle. Let’s discuss each type of multiplexer one by one.
2 to 1 Multiplexer
2 to 1 Multiplexer Circuit
A 2-to-1 multiplexer is the digital multiplexer circuit that has two data inputs
D0 and D1, one selects line S and one output Y. To implement a 2-to-1
multiplexer circuit we need 2 AND gates, an OR gate, and a NOT gate.
The block diagram, logic symbol and switching circuit analogy of 2-to-1
multiplexer is shown in the figure below.
As shown, D0 is an applied input to one of the AND gate and D1 is an
applied input to the other AND gate. Select input S is applied to the second
AND gate as a second input and an inverted input S is applied to the first
AND gate as a second input. The output of both the AND gates is applied as
inputs to the OR gate.2 to 1 Multiplexer Circuit.
2 to 1 Multiplexer Working Principle
When S=0, it directly enters the second AND gate, while inverted S (1) enters
the first AND gate. For AND gates, an output of zero occurs if any input is
zero, resulting in zero from the second AND gate. Meanwhile, the first AND
gate outputs Y = D0 since its second input is 1.
When S=1, Exactly the reverse happens. In this case, the second AND gate
output is equal to its first input, that is Y = D1 and the first AND gate output
is 0.
So, by applying either a logic ‘0’ or a logic ‘1’ at the select input S, we can
select the appropriate input, D0 or D1 with the circuit act like a single pole
double throw (SPDT) switch.
The below table shows the truth table for the 2-to-1 multiplexer.
2 to 1 Multiplexer Truth Table
Here, the 2-input multiplexer connects one of two 1-bit sources to a common
output, hence it produces a 2-to-1 multiplexer.
There are two major, closely related types of reversibility that are of
particular interest for this purpose: physical reversibility and logical
reversibility.
There are many number of reversible logic gates that exist at present.
The quantum cost of each reversible logic gate is an important optimization
parameter.
Irreversible gates are used as design units in the conventional techniques for
creating a digital circuit. Due to bit loss in each operation, these gates cause
information loss. The major source of heat produced by digital systems is the
bit loss phenomenon in digital circuits.
If the vectors of the input bits and output bits are equal and the inputs
and outputs are assigned to each individual input in a one-to-one relationship,
then a logic gate is said to be reversible. As a result, the outputs of a reversible
gate may potentially be used to identify it individually. Input bits may still be
recovered from the logic gates even after the creation of the output. Reversible
logic gates' inputs and outputs can only be recovered from one another in a
certain way. Information cannot be deleted using reversible logical processes,
and no heat is produced.
In order to reproduce the inputs from the outputs, the reversible circuit
works backward, which results in zero power usage. Reversible logic gates are
used to create reversible circuits, which carry out difficult logical and
arithmetic operations.
CHAPTER – 2
LITERATURE SURVEY
The Proposed Multiplexer Architecture performs multiplexing
operation. Multiplexers of various designs have already addressed and worked
on by numerous authors in a literature of reversible designs with the aim of
creating the large optimal and better performance circuits.
EXISTING SYSTEM
4x1 Multiplexer
4x1 Multiplexer has four data inputs I3, I2, I1 & I0, two selection lines s1 &
s0 and one output Y. The block diagram of 4x1 Multiplexer is shown in the
following figure.
4x1 Multiplexer
Y=S1′S0′I0+S1′S0I1+S1S0′I2+S1S0I3
We can implement this Boolean function using Inverters, AND gates & OR
gate. The circuit diagram of 4x1 multiplexer is shown in the following figure.
4 to 1 Multiplexer Circuit Diagram
We can easily understand the operation of the above circuit. Similarly, you
can implement 8x1 Multiplexer and 16x1 multiplexer by following the same
procedure.
8x1 Multiplexer
16x1 Multiplexer
8x1 Multiplexer
In this section, let us implement 8x1 Multiplexer using 4x1 Multiplexers and
2x1 Multiplexer. We know that 4x1 Multiplexer has 4 data inputs, 2 selection
lines and one output. Whereas, 8x1 Multiplexer has 8 data inputs, 3 selection
lines and one output.
So, we require two 4x1 Multiplexers in first stage in order to get the 8 data
inputs. Since, each 4x1 Multiplexer produces one output, we require a 2x1
Multiplexer in second stage by considering the outputs of first stage as inputs
and to produce the final output.
Let the 8x1 Multiplexer has eight data inputs I7 to I0, three selection lines s2,
s1 & s0 and one output Y. The Truth table of 8x1 Multiplexer is shown
below.
We can implement 8x1 Multiplexer using lower order Multiplexers easily by
considering the above Truth table. The block diagram of 8x1 Multiplexer is
shown in the following figure.
8 to 1 Multiplexer
The same selection lines, s1 & s0 are applied to both 4x1 Multiplexers. The
data inputs of upper 4x1 Multiplexer are I7 to I4 and the data inputs of lower
4x1 Multiplexer are I3 to I0. Therefore, each 4x1 Multiplexer produces an
output based on the values of selection lines, s1 & s0.
The outputs of first stage 4x1 Multiplexers are applied as inputs of 2x1
Multiplexer that is present in second stage. The other selection line, s2 is
applied to 2x1 Multiplexer.
If s2 is zero, then the output of 2x1 Multiplexer will be one of the 4 inputs I3
to I0 based on the values of selection lines s1 & s0.
If s2 is one, then the output of 2x1 Multiplexer will be one of the 4 inputs I7
to I4 based on the values of selection lines s1 & s0.
Therefore, the overall combination of two 4x1 Multiplexers and one 2x1
Multiplexer performs as one 8x1 Multiplexer.
CHAPTER – 4
METHODOLOGY
The Reversible logic gates methodology is used in the proposed design.
A. Reversible Logic Gates A device with a one point to one other point
mapping between input and output vectors is a reversible logical gates. The
vector of outputs may always be used to reconstruct the vector of inputs. Each
output vectors have a unique functionalities compared to the other output
vectors. A reversible circuit gate has a at least four logic gates with low
complexity level. The Reversible logic circuits have different parameters like
constant given inputs, trash outputs, Quantum rate or cost and number of gates
used in the circuit designing.
two input-output QC is 1.
Figure.2 shows the functional block for the Toffoli gate [6], that is a 3x3 gate.
Toff, gate's input and output vectors are M(a,b,c) and K(p,q,r). Toffoli gate's
output will specified as p=a, q=b, r =ab xor c. The Toffoli gate's quantum rate
is 5.
Figure.4 shows the functional block and the CNOT gate , which is a 2x2 gate.
M(a,b) and K represent the input and output vectors (p,q). The CNOT gate's
output is denoted as p=a, q=a xor b. The CNOT gate has a quantum rate of 1.
Figure.5 shows the functional block for the DKG gate, a 4x4 gate. DKG gate's
input and output vectors are M(a,b,c,d) and K(p,q,r,s). p=b, q=a xor c, r=(a xor
b)(c xor d) xor cd, and s=b xor c xor d are the output parameters of the DKG.
The DKG gate's quantum rate is 17.
Fig.5. DKG gate
Figure 6 shows the functional block for the TR gate , a 3x3 gate. The input
vectors for the TR gate are M(a,b,c) and Output Vector of the gate is K(p,q,r),
respectively. The definition of the TR gate's output is p=a, q=a xor b, and r =b'
xor c. Quantum rate of the TR gate is 4.
Fig.6. TR gate
Cog gate
Figure.7 shows the functional block and the Cog gate .Cog gate is also known
as New Fredkin gate. The Cog gate is formed by cascading of Feynman gate
and Fredkin gate. The Operation of cog gate is almost similar to that of Fredkin
gate. In case of Fredkin gate, it generates only one Swapping operation of the
control inputs. Whereas in Cog gate, it generates the two Swap operation of all
the control inputs. In case of all 3 input 3 output reversible gates, the minimum
quantum cost is attained by cog gate.
Other than this, some basic reversible gates also available like Feynmann(2x2
gate), Double Feynmenn(3x3 gate), HNG gate, Fredkin gate, TSG, NFT,
RMUX1, TKS, BVF. These gates also used for implement the combinational
circuit.
CHAPTER – 5
PROPOSED METHOD
The design of proposed multiplexer is done in three stages. Initially the most
significant bit of selection lines is considered with least significant two input
bits to generate the partial output expression. The desired output in first stage
is used as selection line in the second stage. In second stage the most significant
two input bits are considered. Finally, the output is generated in the third stage
where the least significant bit of the selection line is considered and generated
the output. The proposed 4 X 1 Multiplexer uses COG reversible gate. It uses
3 COG gates and has 5 garbage outputs. The quantum cost of each COG gates
is 4. The effective quantum cost of proposed multiplexer is 16 which is very
low when compared with existing architectures. A single COG gate can be used
as a 2 X 1 multiplexer. In order to design a 4 X 1 multiplexer, in general we
require three 2 X 1 multiplexers. Therefore, in proposed design three 2 X 1
multiplexers are used. Similarly, the proposed design can be extended for
higher order multiplexers. In order to design 8 X 1 multiplexers, we need two
4 X 1 multiplexers and one 2 X 1 multiplexer. Higher order multiplexers are
obtained by cascading smaller order multiplexers. In general, to design a 2n X
1 multiplexer, (2n -1) COG gates are required with the required quantum cost
of 4(2n-1). It also generates (2n+n-1) garbage outputs. An open source
software Revkit is used for simulating the proposed multiplexer. The output
expression for the proposed multiplexer is
Fig. Design of 4x1 Multiplexer
For implementing an 8x1 Reversible Multiplexer, two 4x1 Reversible
Multiplexer and one 2x1 Reversible Multiplexer are required which is as
shown in below fig. This design quantum cost is twenty eight and produces
12 garbage outputs. The Reversible 8x1 Multiplexer is implemented based on
the following equation.
Fig: Proposed 8:1 Reversible multiplexer
Introduction
Xilinx Tools is a suite of software tools used for the design of digital
circuits implemented using Xilinx Field Programmable Gate Array
(FPGA) or Complex Programmable Logic Device (CPLD). The design
procedure consists of (a) design entry, (b) synthesis and implementation of
the design, (c) functional simulation and (d) testing and verification. Digital
designs can be entered in various ways using the above CAD tools: using a
schematic entry tool, using a hardware description language (HDL) –
Verilog or VHDL or a combination of both. In this lab we will only use the
design flow that involves the use of Verilog HDL.
The CAD tools enable you to design combinational and sequential circuits
starting with Verilog HDL design specifications. The steps of this design
procedure are listed below:
End: endmodule
All your designs for this lab must be specified in the above Verilog input
format. Note that the
state diagram segment does not exist for combinational logic designs.
In this lab digital designs will be implemented in the Basys2 board which
has a Xilinx Spartan3E –XC3S250E FPGA with CP132 package. This
FPGA part belongs to the Spartan family of FPGAs. These devices come
in a variety of packages. We will be using devices that are packaged in
132 pin package with the following part number: XC3S250E-CP132. This
FPGA is a device with about 50K gates. Detailed information on this
device is available at the Xilinx website.
In this lab we will enter a design using a structural or RTL description using
the Verilog HDL. You can create a Verilog HDL input file (.v file) using
the HDL Editor available in the Xilinx ISE Tools (or any text editor).
In the Port Name column, enter the names of all input and output pins and
specify the Direction accordingly. A Vector/Bus can be defined by
entering appropriate bit numbers in the MSB/LSB columns. Then click on
Next> to get a window showing all the new source information (Figure 6).
If any changes are to be made, just click on <Back to go back and make
changes. If everything is acceptable, click on Finish > Next > Next >
Finish to continue.
If a source has to be removed, just right click on the source file in the
Sources in Project window in the Project Navigator and select Remove
in that. Then select Project -> Delete Implementation Data from the
Project Navigator menu bar to remove any related files.
module cog_mux41_db(
input A,B,C,D,
input S0,S1,
output Y
);
coggate cog1(S1,A,B,C1,C2,G1);
coggate cog2(C1,C,D,G2,C3,G3);
coggate cog3(S0,C2,C3,G4,Y,G5);
endmodule
module coggate(a,b,c,x,y,z);
input a,b,c;
output reg x,y,z;
always@(a,b,c)
begin
case({a,b,c})
0 : begin x=0;y=0;z=1; end
1: begin x=0;y=0;z=0; end
2: begin x=0;y=1;z=0; end
3: begin x=0;y=1;z=1; end
4: begin x=1;y=0;z=1; end
5: begin x=1;y=1;z=0; end
6: begin x=1;y=0;z=0; end
7: begin x=1;y=1;z=1; end
endcase
end
endmodule
Suppose we want to describe an OR gate. It can be done using the logic
equation as shown in Figure 9a or using the case statement (describing the
truth table) as shown in Figure 9b. These are just two example constructs
to design a logic function. Verilog offers numerous such constructs to
efficiently model designs. A brief tutorial of Verilog is available in
Appendix-A.
3. Synthesis and Implementation of the Design
To implement the design, double click the Implement design option in the
Processes window. It will go through steps like Translate, Map and Place
& Route. If any of these steps could not be done or done with errors, it will
place a X mark in front of that, otherwise a tick mark will be placed after
each of them to indicate the successful completion. If everything is done
successfully, a tick mark will be placed before the Implement Design
option. If there are warnings, one can see mark in front of the option
indicating that there are some warnings.
One can look at the warnings or errors in the Console window present at
the bottom of the Navigator window. Every time the design file is saved;
all these marks disappear asking for a fresh compilation.
By double clicking it opens the top level module showing only input(s) and
output(s) as shown below.
In the Sources window (top left corner) right click on the file that you
want to generate the test bench for and select ‘New Source’
Provide a name for the test bench in the file name text box and select
‘Verilog test fixture’ among the file types in the list on the right side as
shown in figure 11.
Click on ‘Next’ to proceed. In the next window select the source file with
which you want to associate the test bench.
Figure 15: Associating a module to a testbench (snapshot from
Xilinx ISE software)
Click on Next to proceed. In the next window click on Finish. You will
now be provided with a template for your test bench. If it does not open
automatically click the radio button next to Simulation .
You should now be able to view your test bench template. The code
generated would be something like this:
module cog_mux41;
// Inputs
reg A;
reg B;
reg C;
reg D;
reg S0;
reg S1;
// Outputs
wire Y;
initial begin
// Initialize Inputs
A = 1;B = 0;C = 1;D = 0;S0 = 0;S1 = 0;
#10 A = 1;B = 0;C = 1;D = 0;S0 = 0;S1 = 1;
#10 A = 1;B = 0;C = 1;D = 0;S0 = 1;S1 = 0;
#10 A = 1;B = 0;C = 1;D = 0;S0 = 1;S1 = 1;
#10 $finish;
// Outputs
wire Y;
end
endmodule
Save your test bench file using the File menu.
4.2 Simulating and Viewing the Output Waveforms
Now under the Processes window (making sure that the testbench file in
the Sources window is selected) expand the ModelSim simulator Tab
by clicking on the add sign next to it. Double Click on Simulate
Behavioral Model. You will probably receive a complier error. This is
nothing to worry about – answer “No” when asked if you wish to abort
simulation. This should cause ModelSim to open. Wait for it to complete
execution. If you wish to not receive the compiler error, right click on
Simulate Behavioral Model and select process properties. Mark the
checkbox next to “Ignore Pre-Complied Library Warning Check”.
RESULTS
[2] W. D. Pan and M. Nalasani, “Reversible logic,” IEEE Potentials, vol. 24,
no. 1, pp. 38–41, 2005.
[7] Umesh Kumar, Lavisha Sahu and Uma Sharma, “Performance evaluation
of reversible logic gates,” IEEE International Conference on ICT in Business
Industry & Government, 2016.
[12] H. Gaur and A. Singh, “Design of reversible circuits with high testability,”
Electronics Letters, vol. 52, no. 13, pp. 1102–1104, 2016.
[23] Pathak, N., Kumar, S., Misra, N.K. et al., “A modular approach for
testable conservative reversible multiplexer circuit for nano-electronic confine
application”. Int Nano Lett 9, vol. 9, no. 4, pp. 299–309 , 2019.