Professional Documents
Culture Documents
net/publication/352492122
CITATIONS READS
0 2,317
2 authors:
All content following this page was uploaded by Arpita Das on 27 June 2021.
Prepared By
ABSTRACT
In this project, a 4 bit comparator cell has been designed in Cadence Vir-
tuoso. For design purpose, nmos and pmos widths are specified to 240nm
and 120nm respectively. A gate level schematic design along with layout
diagram of 4-bit comparator including each of the gates or sub-block used
in this project have been developed. Our design has been verified through
DRC(Design Rule Check) and LVS(Layout versus Schematic) checking. Post
layout simulation of each sub-block of our system and of the full design have
been performed to verify its functionality. After that, full chip layout has
been completed with I/O pad placement and this full chip design is also veri-
fied through DRC,LVS checking. Finally, a GDS(Graphic Database System)
file of the layout has been generated that is normally sent to the foundry
for fabrication. Besides, the functionality of 4-bit comparator using Inci-
sive Unified Simulator(IUS) is also verified by Verilog and Testbench code in
Cadence NCSim Software which has also ensured our simulation output.
Page 2
Arpita Das Sudeshna Das 1402054 1402061
KEYWORDS
Page 3
Arpita Das Sudeshna Das 1402054 1402061
Table of Contents
1 INTRODUCTION 7
2 THEORY 7
2.1 4-Bit Magnitude Comparator . . . . . . . . . . . . . . . . . . 8
4 TASKS 9
4.1 Specification, Architectural Design and Functional Verification 9
4.1.1 Specification . . . . . . . . . . . . . . . . . . . . . . . . 9
4.1.2 Behavioural Verilog Code of a Comparator for Two
4-bit Numbers in Cadence NCSim Software Using In-
cisive Unified Simulator (IUS) . . . . . . . . . . . . . . 9
4.1.3 Functional Verification of 4-bit Comparator Circuit Us-
ing Incisive Unified Simulator (IUS) . . . . . . . . . . . 12
4.2 Gate Level Design,Layout Simulation,DRC and LVS check of
Each Gate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
4.2.1 Gate Level Design and Layout Simulation of Inverter . 13
4.2.2 Gate Level Design and Layout Simulation of Two Input
Nor Gate . . . . . . . . . . . . . . . . . . . . . . . . . 16
4.2.3 Gate Level Design and Layout Simulation of Three In-
put Nor . . . . . . . . . . . . . . . . . . . . . . . . . . 19
4.3 Gate Level Design and Layout Simulation of Each Sub-block . 22
4.4 Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . 25
4.5 Gate Level Schematic Design,Top Level Layout Placement,
Routing of 4 bit Comparator, Layout Simulation and DRC,LVS
Check . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
4.5.1 Gate Level Schematic Design . . . . . . . . . . . . . . 26
4.5.2 Top Level Layout Placement and Routing . . . . . . . 27
4.5.3 Layout Simulation and DRC,LVS Check . . . . . . . . 29
4.6 Complete Chip Layout with I/O Pad Placement, Clearing All
DRC Errors and Tape Out . . . . . . . . . . . . . . . . . . . . 31
4.6.1 Complete Chip Layout with I/O Pad Placement . . . . 31
4.6.2 DRC and LVS Check . . . . . . . . . . . . . . . . . . . 31
5 TOOLS USED 32
6 CONCLUSION 32
7 FUTURE IMPROVEMENTS 32
Page 4
Arpita Das Sudeshna Das 1402054 1402061
8 REFERENCES 32
Page 5
Arpita Das Sudeshna Das 1402054 1402061
List of Figures
1 Output Waveforms of 4-bit Comparator . . . . . . . . . . . . . 12
2 Schematic Design of Inverter . . . . . . . . . . . . . . . . . . . 13
3 Symbol of Inverter . . . . . . . . . . . . . . . . . . . . . . . . 13
4 Layout Diagram of Inverter . . . . . . . . . . . . . . . . . . . 14
5 DRC and LVS Check of the layout of Inverter . . . . . . . . . 14
6 Output Waveform of Inverter . . . . . . . . . . . . . . . . . . 15
7 Schematic Design of Two Input Nor Gate . . . . . . . . . . . . 16
8 Symbol of Two Input Nor Gate . . . . . . . . . . . . . . . . . 16
9 Layout Diagram of Two Input Nor Gate . . . . . . . . . . . . 17
10 DRC and LVS Check of the layout of Two Input Nor Gate . . 17
11 Output Waveform of Two Input Nor Gate . . . . . . . . . . . 18
12 Schematic Design of Three Input Nor Gate . . . . . . . . . . . 19
13 Symbol of Three Input Nor Gate . . . . . . . . . . . . . . . . 19
14 Layout Diagram of Three Input Nor Gate . . . . . . . . . . . 20
15 DRC and LVS Check of the layout of Three Input Nor Gate . 20
16 Output Waveform of Three Input Nor Gate . . . . . . . . . . 21
17 Schematic Design of 1-bit Comparator . . . . . . . . . . . . . 22
18 Layout Diagram of 1-bit Comparator . . . . . . . . . . . . . . 23
19 DRC and LVS Check of the layout of 1-bit Comparator . . . . 23
20 Output Waveforms of 1-bit Comparator . . . . . . . . . . . . . 24
21 Block Diagram of 4-bit Comparator . . . . . . . . . . . . . . . 25
22 Schematic Design of 4-bit Comparator . . . . . . . . . . . . . 26
23 Layout Diagram of 4-bit Comparator before Routing . . . . . 27
24 Layout Diagram of 4-bit Comparator after Routing . . . . . . 28
25 DRC and LVS Check of the layout of 4-bit Comparator . . . . 29
26 AV extracted view of 4-bit Comparator showing parasitic ca-
pacitance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
27 Output Waveforms of 4-bit Comparator . . . . . . . . . . . . . 30
28 Complete Chip Layout with I/O Pad Placement . . . . . . . . 31
29 DRC and LVS Check of Complete Chip Layout . . . . . . . . 31
Page 6
Arpita Das Sudeshna Das 1402054 1402061
1 INTRODUCTION
In electronics, the comparator is used to compare two voltages or currents
which are given at the two inputs of the comparator. That means it takes two
input voltages, then compares them and gives a differential output voltage
either high or low-level signal. A digital comparator or magnitude com-
parator is a hardware electronic device that takes two numbers as inputs in
binary form and determines whether one number is greater than, less than or
equal to the other number. Comparators are used in central processing units
(CPUs) and microcontrollers (MCUs). In metrology, measuring instruments
and comparators play significant role. Measuring instruments are used to
measure the actual dimension of the work piece, whereas the comparators
are used for comparison of the actual dimension with the working standard.
In our 4-bit comparator project, we will use Cadence Virtuoso and Cadence
NCSim Software for design purpose and to verify its functionality. We will
also design complete chip layout with I/O pad placement and create a GDS
file from the layout which is normally sent to the foundry for fabrication.
2 THEORY
A magnitude digital comparator is a combinational circuit that compares two
digital or binary numbers in order to find out whether one binary number
is equal, less than or greater than the other binary number. We logically
design a circuit for which we will have two inputs one for A and other for
B and have two output terminals, one for A>B condition and one for A<B
condition. For circuit requirements, we have considered only greater and
smaller outputs. The truth table for a binary 1-bit comparator bit-slice is
given in table 01.
Inputs Outputs
Ai Bi Gi+1 Si+1 Gi Si
x x 1 0 1 0
x x 0 1 0 1
0 0 0 0 0 0
0 1 0 0 0 1
1 0 0 0 1 0
1 1 0 0 0 0
Page 7
Arpita Das Sudeshna Das 1402054 1402061
1. If A3 = 1 and B3 = 0
2. f A3 = B3 and A2 = 1 and B2 = 0
Similarly the condition for A<B can be possible in the following four cases
1. If A3 = 0 and B3 = 1
2. f A3 = B3 and A2 = 0 and B2 = 1
For our project purpose and according to the given suggestions, we have con-
sidered only outputs for A>B and A<B. The logic expressions for the two
output signals in terms of the four input signals are as follows:-
Page 8
Arpita Das Sudeshna Das 1402054 1402061
4 TASKS
4.1 Specification, Architectural Design and Functional
Verification
4.1.1 Specification
For design purpose, the width of nmos is specified to 240nm and pmos is
specified to 120nm.
//The V e r i l o g module−
//The i n p u t s and o u t p u t s i g n a l s are d e c l a r e d
module comparator (
intA , // i n p u t A
intB , // i n p u t B
smaller , // h i g h when A i s l e s s than B
greater // h i g h when A i s g r e a t e r than B
);
parameter n=4;
// what are t h e i n p u t p o r t s .
input [ n − 1 : 0 ] intA , intB ;
//What are t h e o u t p u t p o r t s .
output reg s m a l l e r , g r e a t e r ;
Page 9
Arpita Das Sudeshna Das 1402054 1402061
// c h e c k i f A i s b i g g e r than B.
{ s m a l l e r , g r e a t e r }=2 ’ b01 ;
end
e l s e i f ( intA == intB )
begin
// Check i f A i s e q u a l t o B
{ s m a l l e r , g r e a t e r }=2 ’ b00 ;
end
e l s e i f ( intA < intB )
begin
// O t h e r w i s e − c h e c k f o r A l e s s than B.
{ s m a l l e r , g r e a t e r }=2 ’ b10 ;
end
end
endmodule
Page 10
Arpita Das Sudeshna Das 1402054 1402061
module c o m p t s t ;
parameter n=4;
// what are t h e i n p u t p o r t s .
reg [ n − 1 : 0 ] intA , intB ;
//What are t h e o u t p u t p o r t s .
wire s m a l l e r , g r e a t e r ;
i n i t i a l begin
// Apply i n p u t s
intA = 2 ;
intB = 3 ;
#100;
intA = 9 ;
intB = 8 ;
#100;
intA = 1 1 ;
intB = 1 2 ;
#100;
intA = 1 3 ;
intB = 1 3 ;
#100;
intA = 1 5 ;
intB = 1 4 ;
#100;
intA = 1 1 ;
intB = 2 ;
#100;
Page 11
Arpita Das Sudeshna Das 1402054 1402061
intA = 4 ;
intB = 6 ;
#100;
end
initial begin
$shm open ( ”shm . db” , 1 ) ; // Opens a waveform d a t a b a s e
$shm probe ( ”AS” ) ; // Saves a l l s i g n a l s t o d a t a b a s e
#700 $finish ;
#750 $ s h m c l o s e ( ) ; // C l o s e s t h e waveform d a t a b a s e
end
endmodule
From figure 1 we see that, the inputs A and B are taken after every
100ns.The simulation is stopped at 700ns which is evident from the figure.The
waveform database is closed at 750ns. We can observe two observations ,
one of which is between 0 to 100ns at which A<B and for this Smaller=1.
Another one is between 300ns and 400ns at which both inputs are same and
the generated outputs are both zero. So we see the co-ordination of Table 1
with the output from Figure 1. We have verified the functionality of 4-bit
comparator with the truth table and the result is positive.
Page 12
Arpita Das Sudeshna Das 1402054 1402061
Page 13
Arpita Das Sudeshna Das 1402054 1402061
Page 14
Arpita Das Sudeshna Das 1402054 1402061
From Figure 5, we see that when the gate receives a HIGH signal, it
makes it LOW signal by inverting it and similar is the case for LOW signal
when the gate receives it. The output is plotted for 20ns transient response.
Page 15
Arpita Das Sudeshna Das 1402054 1402061
4.2.2 Gate Level Design and Layout Simulation of Two Input Nor
Gate
The inclusive NOR (Not-OR) gate has an output that is normally at logic
level 1 and only goes LOW to logic level 0 when any of its inputs are at logic
level 1. The NOR gate is implemented by connecting two p-mos in series
and two n-mos in parallel. The output is taken from the common terminal
of drain of n-mos and drain of one p-mos that is immediately connected to
the common drain terminal of two n-mos.
Page 16
Arpita Das Sudeshna Das 1402054 1402061
Figure 10: DRC and LVS Check of the layout of Two Input Nor Gate
Page 17
Arpita Das Sudeshna Das 1402054 1402061
From Figure 11, it is seen that when the gate receives HIGH signal at
any of input terminals, it immediately makes it output LOW. When the gate
receives two LOW signals at its both input terminals at the same time, the
output becomes HIGH. The output is plotted for 25ns transient response.
Page 18
Arpita Das Sudeshna Das 1402054 1402061
Page 19
Arpita Das Sudeshna Das 1402054 1402061
Figure 15: DRC and LVS Check of the layout of Three Input Nor Gate
Page 20
Arpita Das Sudeshna Das 1402054 1402061
From Figure 16, likewise the operation of two input nor gate, it is seen
that when the gate receives HIGH signal at any of three input terminals,
it immediately makes it output LOW. When the gate receives LOW signals
at all its input terminals at the same time, the output becomes HIGH. The
output is plotted for 25ns transient response.
Page 21
Arpita Das Sudeshna Das 1402054 1402061
1. The two numbers are compared starting with the most significant bits.
The outputs from this comparison are connected to the next most sig-
nificant bit stage inputs etc. The two output signals Gi and Si remain
at zero as long as the two bits being compared are the same.
3. All the remaining pairs of less significant bits then have no further
effect on the state of subsequent outputs Gi and Si .
4. If all pairs of bits of the two numbers being compared are equal, then
the outputs stay at zero signifying equality.
Page 22
Arpita Das Sudeshna Das 1402054 1402061
Figure 19: DRC and LVS Check of the layout of 1-bit Comparator
Page 23
Arpita Das Sudeshna Das 1402054 1402061
From figure 20, we can see that whenever A3>B3 output greater is high
and when B3>A3 output smaller is high. The output is plotted for 20ns
transient response.
Page 24
Arpita Das Sudeshna Das 1402054 1402061
In the cascaded circuit,we have assigned the inputs from the outputs of pre-
vious stage by Gi1 and Si1 for the 1st block. Outputs of the 1st block( G3 ,
S3 ) are inputs to the 2nd block and so likewise for other two blocks. The two
numbers A and B consist of four bits. In the comparison process if outputs
of previous stages are different from each other(e.g. G3 =1, S3 =0), resultant
greater will be high and smaller will be low and the circuit will not respond
to the values of inputs. Similar is the case when G3 =0, S3 =1. But if the
previous stages output bits are both zero,only then the output will respond
to the inputs.
Thus,comparing two bits per block along with outputs of previous stage we
get the resultant as ’Greater’ and ’Smaller’. The normalized block diagram
is as follows :-
Page 25
Arpita Das Sudeshna Das 1402054 1402061
Gi1 , Si1 , Ai , Bi are the inputs. For different values of Gi1 and Si1 , states of
Ai and Bi will be neglected otherwise states of Ai and Bi will be compared.
So we will get the comparator result on the basis of Gi1 , Si1 ,Ai , Bi for
three different cases.
For the whole cascaded circuit, 16 inverters, 8 two input nor and 8 three
input gates are used.
Page 26
Arpita Das Sudeshna Das 1402054 1402061
Page 27
Arpita Das Sudeshna Das 1402054 1402061
Page 28
Arpita Das Sudeshna Das 1402054 1402061
Figure 25: DRC and LVS Check of the layout of 4-bit Comparator
Page 29
Arpita Das Sudeshna Das 1402054 1402061
From figure 27, we can study a few observations. One of which is between
0 to 5ns in which B>A, both Gi1 and Si1 both are 0. The resultant smaller
output is 1 and greater is 0.
Another one is between 20 to 25ns in which A>B, both Gi1 and Si1 both are
0. The resultant greater output is 1 and smaller is 0.
Another one is between 15 to 20ns in which A=B, both Gi1 and Si1 both are
0. The both outputs are 0.
Another one is between 25 to 30ns in which A>B, Gi1 is 0 and Si1 is 1. The
resultant greater output is 0 and smaller is 1. So in this time duration, we
see that outputs do not respond to the states of the inputs. Similar is the
case with 30 to 35ns.
Hence, the functionality of 4-bit comparator is verified.
Page 30
Arpita Das Sudeshna Das 1402054 1402061
Page 31
Arpita Das Sudeshna Das 1402054 1402061
5 TOOLS USED
In this experiment we used:
• Cadence Virtuoso
• Cadence’s ASUURA
6 CONCLUSION
Using Cadence Virtuoso and Cadence NCSim Software,a system design with
functional architectural analysis of 4-bit comparator have been performed.
At the end of this project, design of a complete chip and a GDS file of the
layout have been created after clearing all design rule errors and layout to
schematic verification.
7 FUTURE IMPROVEMENTS
The critical delay in this circuit is the propagation delay of the two outputs
through all the stages. The gates passing both outputs should be sized appro-
priately. The delay is only one gate per stage and should not be the limiting
factor on a system’s scale. In our design,there are some ripples occured in
both input and output signals. This is due to the signals passing through all
gates which causes propagation delay. As a future improvement,we can look
forward to minimizing this delay to reduce ripples.
8 REFERENCES
1. Lab Manual
2. http://www.google.com
Page 32