E Cad and Vlsi Lab Manual
E Cad and Vlsi Lab Manual
Experiment 1
Aim: To write VHDL code for all basic gates, simulate and verify functionality, synthesize .
Tools Required:
1. FPG Advantage
i. Simulator: Modelsim SE6.1a
ii. Synthesis: Leonardo spectrum
Theory :
AND:
The AND gate is an electronic circuit that gives a high output (1) only if all its inputs are
high. A dot (.) is used to show the AND operation i.e. A.B.
OR:
The OR gate is an electronic circuit that gives a high output (1) if one or more of its
inputs are high. A plus (+) is used to show the OR operation.
NOT:
The NOT gate is an electronic circuit that produces an inverted version of the input at its
output. It is also known as an inverter. If the input variable is A, the inverted output is known as
NOT A. This is also shown as A', or A with a bar over the top.
NAND:
This is a NOT-AND gate which is equal to an AND gate followed by a NOT gate. The
outputs of all NAND gates are high if any of the inputs are low. The symbol is an AND gate
with a small circle on the output. The small circle represents inversion.
NOR:
This is a NOT-OR gate which is equal to an OR gate followed by a NOT gate. The
outputs of all NOR gates are low if any of the inputs are high. The symbol is an OR gate with a
small circle on the output. The small circle represents inversion.
EX-OR:
The 'Exclusive-OR' gate is a circuit which will give a high output if either, but not
both, of its two inputs are high. An encircled plus sign ( ) is used to show the EXOR operation.
1|Page
e-CAD&VLSI LAB
4 ECE- e-CAD & VLSI Lab manual Aurora’s Engineering College
2|Page
e-CAD&VLSI LAB
4 ECE- e-CAD & VLSI Lab manual Aurora’s Engineering College
Procedure:
5. Now, give the name of the entity & click next, then an editor window opens,
6. Declare the input, output ports in the entity and save it.
8. Now, give the name of the entity you gave before and a architecture name and click next,
then a editor window opens, write the required style of code and save it.
9. Click the project file and verify the errors by CHECK button.
10. If no errors, click on simulate button, then modelsim gets started, select the ports and give
them to “select to wave” option and type the force commands and run command ,then the
graph is displayed.
11. After that, move to design manager window, select the project file and click on
synthesize button, then Leonardo Spectrum windows gets opened, in that, click on view
RTL schematic button, the required logic diagram is displayed.
VHDL code:
AND gate:
LIBRARY ieee;
USE ieee.std_logic_1164.all;
USE ieee.std_logic_arith.all;
ENTITY and1 IS
port(a,b:in std_logic;
c:out std_logic);
END ENTITY and1;
ARCHITECTURE dataflow OF and1 IS
BEGIN
3|Page
e-CAD&VLSI LAB
4 ECE- e-CAD & VLSI Lab manual Aurora’s Engineering College
c<=a and b;
END ARCHITECTURE dataflow;
OR gate:
LIBRARY ieee;
USE ieee.std_logic_1164.all;
USE ieee.std_logic_arith.all;
ENTITY or1 IS
port(a,b:in std_logic;
c:out std_logic);
END ENTITY or1;
ARCHITECTURE dataflow OF or1 IS
BEGIN
c<=a or b;
END ARCHITECTURE dataflow;
NOT gate:
LIBRARY ieee;
USE ieee.std_logic_1164.all;
USE ieee.std_logic_arith.all;
ENTITY not1 IS
port(a:in std_logic;
o : out std_logic);
END ENTITY not1;
ARCHITECTURE dataflow OF not1 IS
BEGIN
o<=not a;
END ARCHITECTURE dataflow;
NAND gate:
LIBRARY ieee;
USE ieee.std_logic_1164.all;
USE ieee.std_logic_arith.all;
ENTITY nand1 IS
port(a,b:in std_logic;
c:out std_logic);
4|Page
e-CAD&VLSI LAB
4 ECE- e-CAD & VLSI Lab manual Aurora’s Engineering College
NOR gate:
LIBRARY ieee;
USE ieee.std_logic_1164.all;
USE ieee.std_logic_arith.all;
ENTITY nor1 IS
port(a,b:in std_logic;
c:out std_logic);
END ENTITY nor1;
ARCHITECTURE dataflow OF nor1 IS
BEGIN
c<=a nor b;
END ARCHITECTURE dataflow;
XOR gate:
LIBRARY ieee;
USE ieee.std_logic_1164.all;
USE ieee.std_logic_arith.all;
ENTITY xor1 IS
port(a,b:in std_logic;
c:out std_logic);
END ENTITY xor1;
ARCHITECTURE dataflow OF xor1 IS
BEGIN
c<=a xor b;
END ARCHITECTURE dataflow;
Simulations:
AND gate:
5|Page
e-CAD&VLSI LAB
4 ECE- e-CAD & VLSI Lab manual Aurora’s Engineering College
NOT gate:
6|Page
e-CAD&VLSI LAB
4 ECE- e-CAD & VLSI Lab manual Aurora’s Engineering College
NAND gate:
NOR gate:
XOR gate:
7|Page
e-CAD&VLSI LAB
4 ECE- e-CAD & VLSI Lab manual Aurora’s Engineering College
Synthesis Diagrams:
AND gate:
OR gate:
NOT gate:
8|Page
e-CAD&VLSI LAB
4 ECE- e-CAD & VLSI Lab manual Aurora’s Engineering College
NAND gate:
NOR gate:
XOR gate:
Conclusion:
The VHDL code for all basic gates is written, simulated and synthesized.
9|Page
e-CAD&VLSI LAB
4 ECE- e-CAD & VLSI Lab manual Aurora’s Engineering College
Experiment 2
DESIGN OF 2-to-4 DECODER
Aim: To write VHDL code for 2-to-4 decoder in Behavioral modeling, Structural Modeling,
simulate and synthesize
Tools Required:
1. FPG Advantage
i. Simulator: Modelsim SE6.1a
ii. Synthesis: Leonardo spectrum
Theory : A decoder can take the form of a multiple-input, multiple-output logic circuit that
converts coded inputs into coded outputs, where the input and output codes are different e.g. n-
to-2n , binary-coded decimal decoders. Decoding is necessary in applications such as data
multiplexing, 7 segment display and memory address decoding.
LIBRARY ieee;
USE ieee.std_logic_1164.all;
USE ieee.std_logic_arith.all;
ENTITY decoder24 IS
port(a:in std_logic_vector(1 downto 0);
f:out std_logic_vector(3 downto 0));
END ENTITY decoder24;
10 | P a g e
e-CAD&VLSI LAB
4 ECE- e-CAD & VLSI Lab manual Aurora’s Engineering College
Run 40ns
Synthesis Diagrams:
LIBRARY ieee;
USE ieee.std_logic_1164.all;
USE ieee.std_logic_arith.all;
11 | P a g e
e-CAD&VLSI LAB
4 ECE- e-CAD & VLSI Lab manual Aurora’s Engineering College
ENTITY decoder2x4 IS
port(a:in std_logic_vector(1 downto 0);
f:out std_logic_vector(3 downto 0));
END ENTITY decoder2x4;
ARCHITECTURE behav_when_case OF decoder2x4 IS
BEGIN
process(a)
begin
case(a) is
when "00" => f <= "0001";
when "01" => f <= "0010";
when "10" => f <= "0100";
when "11" => f <= "1000";
when others => f <= "0000";
end case;
end process;
END ARCHITECTURE behav_when_case;
Simulations:
Synthesis Diagrams:
12 | P a g e
e-CAD&VLSI LAB
4 ECE- e-CAD & VLSI Lab manual Aurora’s Engineering College
LIBRARY ieee;
USE ieee.std_logic_1164.all;
USE ieee.std_logic_arith.all;
ENTITY decoder_strct IS
port(a:in std_logic_vector(1 downto 0);
En:in std_logic;
f:out std_logic_vector(3 downto 0));
END ENTITY decoder_strct;
ARCHITECTURE stuctural OF decoder_strct IS
signal s,t: std_logic;
component inv1 port(I :in std_logic;o:out std_logic);
end component;
component and3 port(I0,I1,I3: in std_logic;o:out std_logic);
end component;
begin
u1:inv1 port map(a(0),s);
u2:inv1 port map(a(1),t);
u3:and3 port map(s,t,En,f(0));
u4:and3 port map(a(0),t,En,f(1));
u5:and3 port map(s,a(1),En,f(2));
u6:and3 port map(a(0),a(1),En,f(3));
END ARCHITECTURE stuctural;
13 | P a g e
e-CAD&VLSI LAB
4 ECE- e-CAD & VLSI Lab manual Aurora’s Engineering College
Simulations:
Synthesis Diagrams:
Conclusion:
The VHDL code for 2-to-4 decoder using behavioral (using with-select, when-else), Structural
model using is written, simulated and synthesized.
14 | P a g e
e-CAD&VLSI LAB
4 ECE- e-CAD & VLSI Lab manual Aurora’s Engineering College
Experiment 3
DESIGN OF 8-to-3 ENCODER
Aim: To write the VHDL code for 8-to-3 Encoder in Dataflow, Behavioral, Structural modeling
simulate and synthesize.
Tools Required:
1. FPG Advantage
i. Simulator: Modelsim SE6.1a
ii. Synthesis: Leonardo spectrum
Theory : The truth table for an 8-3 binary encoder (8 inputs and 3 outputs) is shown in the
following table. It is assumed that only
one input has a value of 1 at any given
time.
LIBRARY ieee;
USE ieee.std_logic_1164.all;
USE ieee.std_logic_arith.all;
ENTITY encoder8to3_df IS
port(I:in std_logic_vector(7 downto 0);
E0,E1,E2:out std_logic);
END ENTITY encoder8to3_df;
15 | P a g e
e-CAD&VLSI LAB
4 ECE- e-CAD & VLSI Lab manual Aurora’s Engineering College
Simulation :
Synthesis diagram:
16 | P a g e
e-CAD&VLSI LAB
4 ECE- e-CAD & VLSI Lab manual Aurora’s Engineering College
ENTITY encoder_be IS
port(I : in std_logic_vector( 7 downto 0);
En : in std_logic;
E : out std_logic_vector(2 downto 0));
END ENTITY encoder_be;
ARCHITECTURE behav OF encoder_be IS
BEGIN
process(I,En)
begin
if En ='1' then
case I is
when "00000001"=> E <= "000";
when "00000010"=> E <= "001";
when "00000100"=> E <= "010";
when "00001000"=> E <= "011";
when "00010000"=> E <= "100";
when "00100000"=> E <= "101";
when "01000000"=> E <= "110";
when "10000000"=> E <= "111";
when others => E <= "UUU";
end case;
else E <= "UUU";
end if;
end process;
END ARCHITECTURE behav;
Simulation :force I 00000001 0ns,00000010 10ns,00000100 20ns,00001000
30ns,00010000 40ns,00100000 50ns,01000000 60ns,10000000 70ns
17 | P a g e
e-CAD&VLSI LAB
4 ECE- e-CAD & VLSI Lab manual Aurora’s Engineering College
Synthesis diagram:
LIBRARY ieee;
USE ieee.std_logic_1164.all;
USE ieee.std_logic_arith.all;
ENTITY encoder_st IS
port(I : in std_logic_vector(7 downto 0);
E : out std_logic_vector(2 downto 0));
END ENTITY encoder_st;
ARCHITECTURE struct OF encoder_st IS
component or2 port(A,B,C,D : in std_logic;
M: out std_logic);
end component;
BEGIN
u1 :or2 port map(I(1),I(3),I(5),I(7),E(0));
u2 :or2 port map(I(2),I(3),I(6),I(7),E(1));
u3: or2 port map(I(4),I(5),I(6),I(7),E(2)) ;
END ARCHITECTURE struct;
18 | P a g e
e-CAD&VLSI LAB
4 ECE- e-CAD & VLSI Lab manual Aurora’s Engineering College
BEGIN
M <= A or B or C or D;
END ARCHITECTURE dataflow;
Simulation :
Synthesis diagram:
Conclusion:
The VHDL code for 8-to-3 encoder using Dataflow, Behavioural (using when-else Statement),
Structural modelling is written, simulated and synthesized.
19 | P a g e
e-CAD&VLSI LAB
4 ECE- e-CAD & VLSI Lab manual Aurora’s Engineering College
Experiment 4
DESIGN OF 8-To-1 MULTIPLEXER
Aim: To write the VHDL code for 8-to-1 multiplexer, simulate and synthesize.
Tools Required:
1. FPG Advantage
iii. Simulator: Modelsim SE6.1a
iv. Synthesis: Leonardo spectrum
Theory:
A multiplexer (or MUX) is a device that selects one of several analog or digital input signals
and forwards the selected input into a single line. A multiplexer of 2n inputs has n select lines,
which are used to select which input line to send to the output.
VHDL code:
LIBRARY ieee;
USE ieee.std_logic_1164.all;
USE ieee.std_logic_arith.all;
ENTITY mux81 IS
port(EN_L: in std_logic;
D: in std_logic_vector(7 downto 0);
S: in std_logic_vector(2 downto 0);
Z: out std_logic);
END ENTITY mux81;
ARCHITECTURE behav OF mux81 IS
20 | P a g e
e-CAD&VLSI LAB
4 ECE- e-CAD & VLSI Lab manual Aurora’s Engineering College
BEGIN
process(S,D,EN_L)
begin
if EN_L ='0' then
case(S) is
when "000" => Z <= D(0);
when "001" => Z <= D(1);
when "010" => Z <= D(2);
when "011" => Z <= D(3);
when "100" => Z <= D(4);
when "101" => Z <= D(5);
when "110" => Z <= D(6);
when "111" => Z<= D(7);
when others => Z <= 'U';
end case;
else Z <='U';
end if;
end process;
END ARCHITECTURE behav;
Simulation :
21 | P a g e
e-CAD&VLSI LAB
4 ECE- e-CAD & VLSI Lab manual Aurora’s Engineering College
Synthesis diagram:
Conclusion:
The VHDL code for 8-to-1 multiplexer is written, simulated and synthesized.
22 | P a g e
e-CAD&VLSI LAB
4 ECE- e-CAD & VLSI Lab manual Aurora’s Engineering College
Experiment 5
DESIGN OF 4 BIT BINARY TO GRAY CODE CONVERSION
Aim: To write the VHDL code for 4 Bit Binary to Gray code conversion, simulate and
synthesize.
Tools Required:
1. FPG Advantage
i. Simulator: Modelsim SE6.1a
ii. Synthesis: Leonardo spectrum
Theory :
VHDL code :
LIBRARY ieee;
USE ieee.std_logic_1164.all;
USE ieee.std_logic_arith.all;
ENTITY binarytograycodeconverter IS
port(b:in std_logic_vector(3 downto 0);
g: out std_logic_vector(3 downto 0));
END ENTITY binarytograycodeconverter;
ARCHITECTURE dataflow OF binarytograycodeconverter IS
BEGIN
g(3)<=b(3);
g(2)<=b(3)xor b(2);
g(1)<=b(2)xor b(1);
g(0)<=b(1) xor b(0);
END ARCHITECTURE dataflow;
23 | P a g e
e-CAD&VLSI LAB
4 ECE- e-CAD & VLSI Lab manual Aurora’s Engineering College
Simulations:
Synthesis Diagrams:
Conclusion:
The VHDL code for binary to gray code conversion is written , simulated and synthesized.
24 | P a g e
e-CAD&VLSI LAB
4 ECE- e-CAD & VLSI Lab manual Aurora’s Engineering College
Experiment 6(a)
DESIGN OF 4-BIT COMPARATOR
Aim: To write the VHDL code for 4-BIT COMPARATOR, simulate and synthesize using
dataflow model.
Tools Required:
1. FPG Advantage
i. Simulator: Modelsim SE6.1a
ii. Synthesis: Leonardo spectrum
Theory :
The purpose of a Digital Comparator is to compare a set of variables or unknown numbers, for
exampleA (A1, A2, A3, .... An, etc) against that of a constant or unknown value such as B (B1,
B2, B3, .... Bn, etc) and produce an output condition or flag depending upon the result of the
comparison. For example, a magnitude comparator of two 1-bits, (A and B) inputs would
produce the following three output conditions when compared to each other.
VHDL CODE:
LIBRARY ieee;
USE ieee.std_logic_1164.all;
USE ieee.std_logic_arith.all;
ENTITY comparator4bit_df IS
port(a,b: in std_logic_vector(3 downto 0);
agtb,aeqb,altb : out std_logic);
25 | P a g e
e-CAD&VLSI LAB
4 ECE- e-CAD & VLSI Lab manual Aurora’s Engineering College
Synthesis diagram:
Conclusion:
The VHDL code for 4-bit Comparator using dataflow model is written, simulated and
synthesized.
26 | P a g e
e-CAD&VLSI LAB
4 ECE- e-CAD & VLSI Lab manual Aurora’s Engineering College
Experiment 6(b)
DESIGN OF 4-BIT COMPARATOR
Aim: To write the VHDL code for 4-BIT COMPARATOR, simulate and synthesize using
dataflow model
LIBRARY ieee;
USE ieee.std_logic_1164.all;
USE ieee.std_logic_arith.all;
ENTITY comparator4bit_behav IS
port(a,b: in std_logic_vector(3 downto 0);
agtb,aeqb,altb : out std_logic);
END ENTITY comparator4bit_behav;
ARCHITECTURE behavioural OF comparator4bit_behav IS
BEGIN
process(a,b)
begin
if(a>b)then
agtb <='1';
aeqb <= '0';
altb <= '0';
elsif(a<b) then
agtb <= '0';
aeqb <= '0';
altb <= '1';
elsif(a=b) then
agtb <='0';
aeqb <= '1';
altb <= '0';
else
agtb<='0';
aeqb <='0';
altb <= '0';
end if;
end process;
END ARCHITECTURE behavioural;
Simulation:
force a 0111 0ns,0101 40ns
force b 0110 0ns,0101 30ns
run 60ns
27 | P a g e
e-CAD&VLSI LAB
4 ECE- e-CAD & VLSI Lab manual Aurora’s Engineering College
Synthesis diagram:
Conclusion:
The VHDL code for 4-bit comparator using dataflow model is written, simulated and
synthesized.
28 | P a g e
e-CAD&VLSI LAB
4 ECE- e-CAD & VLSI Lab manual Aurora’s Engineering College
Experiment 7(a)
DESIGN OF HALF ADDER
Aim: To write the VHDL code for Half adder, simulate and synthesize.
Tools Required:
1. FPG Advantage
i. Simulator: Modelsim SE6.1a
ii. Synthesis: Leonardo spectrum
Theory :
The half adder adds two one-bit binary numbers A and B. It has two outputs, Sum S and Carry
C.
LIBRARY ieee;
USE ieee.std_logic_1164.all;
USE ieee.std_logic_arith.all;
ENTITY halfadder1 IS
port(a: in std_logic;
b:in std_logic;
carry:out std_logic;
sum:out std_logic);
END ENTITY halfadder1;
ARCHITECTURE dataflow OF halfadder1 IS
BEGIN
sum <=a xor b;
carry <= a and b;
END ARCHITECTURE dataflow;
29 | P a g e
e-CAD&VLSI LAB
4 ECE- e-CAD & VLSI Lab manual Aurora’s Engineering College
Simulations:
force a 0 0ns, 1 10ns,0 20ns,1 30ns
force b 1 0ns,0 10ns,1 20ns
run 50ns
Synthesis Diagrams:
Conclusion:
The VHDL code for half adder is written and simulated and synthesized.
30 | P a g e
e-CAD&VLSI LAB
4 ECE- e-CAD & VLSI Lab manual Aurora’s Engineering College
Experiment 7(b)
DESIGN OF FULL ADDER
Aim: To write the VHDL code for Full adder, simulate and synthesize using dataflow model.
Tools Required:
1. FPG Advantage
i. Simulator: Modelsim SE6.1a
ii. Synthesis: Leonardo spectrum
Theory :
A full adder adds binary numbers and accounts for values carried in as well as out. A one-bit
full adder adds three one-bit numbers, often written as A, B, and Cin; A and B are the operands,
and Cin is a bit carried in from the next less significant stage.
Inputs Outputs
A B Cin Cout S
0 0 0 0 0
1 0 0 0 1
0 1 0 0 1
1 1 0 1 0
0 0 1 0 1
1 0 1 1 0
0 1 1 1 0
1 1 1 1 1
31 | P a g e
e-CAD&VLSI LAB
4 ECE- e-CAD & VLSI Lab manual Aurora’s Engineering College
Simulations:
Force a 0 0ns,1 40ns
Force b 0 0ns,1 20ns,0 40ns,1 60ns
Force c 0 0ns,1 10ns,0 20ns,1 30ns,0 40ns,1 50ns,0 60ns,1 70ns
Run 80ns
Synthesis diagrams:
Conclusion:
The VHDL code for full adder using Dataflow modeling is written, simulated and synthesized.
32 | P a g e
e-CAD&VLSI LAB
4 ECE- e-CAD & VLSI Lab manual Aurora’s Engineering College
Experiment 7(c)
DESIGN OF FULL ADDER
Aim: To write the VHDL code for Full adder, simulate and synthesize using Structural model.
Tools Required:
1. FPG Advantage
iii. Simulator: Modelsim SE6.1a
iv. Synthesis: Leonardo spectrum
Theory :
A full adder adds binary numbers and accounts for values carried in as well as out. A one-bit
full adder adds three one-bit numbers, often written as A, B, and Cin; A and B are the operands,
and Cin is a bit carried in from the next less significant stage.
Inputs Outputs
A B Cin Cout S
0 0 0 0 0
1 0 0 0 1
0 1 0 0 1
1 1 0 1 0
0 0 1 0 1
1 0 1 1 0
0 1 1 1 0
1 1 1 1 1
33 | P a g e
e-CAD&VLSI LAB
4 ECE- e-CAD & VLSI Lab manual Aurora’s Engineering College
ENTITY fulladder_struct IS
port(Fx,Fy,Fcin: in std_logic;
Fsum,Fcarry : out std_logic);
END ENTITY fulladder_struct;
ARCHITECTURE struct OF fulladder_struct IS
signal s1,c1,c2:std_logic;
component HA port(A,B : in std_logic;
sum,carry : out std_logic)
end component;
BEGIN
u1: HA port map(Fx,Fy,s1,c1);
u2: HA port map(s1,Fcin,Fsum,c2);
Fcarry <= c1 or c2;
END ARCHITECTURE struct;
Simulation:
force Fx 0 0ns,1 30ns
force Fy 0 0ns, 1 20ns,0 40ns, 1 60ns
force Fcin 0 0ns, 1 10ns,0 20ns,1 30ns,0 40ns,1 50ns,0 60ns,1 70ns
run 80ns
34 | P a g e
e-CAD&VLSI LAB
4 ECE- e-CAD & VLSI Lab manual Aurora’s Engineering College
Synthesis diagram:
Conclusion:
The VHDL code for full adder using Structural modeling is written, simulated and synthesized.
35 | P a g e
e-CAD&VLSI LAB
4 ECE- e-CAD & VLSI Lab manual Aurora’s Engineering College
Experiment 7(d)
DESIGN OF FULL ADDER
Aim: To write the VHDL code for Full adder, simulate and synthesize using Behavioral model.
Tools Required:
1. FPG Advantage
v. Simulator: Modelsim SE6.1a
vi. Synthesis: Leonardo spectrum
Theory :
A full adder adds binary numbers and accounts for values carried in as well as out. A one-bit
full adder adds three one-bit numbers, often written as A, B, and Cin; A and B are the operands,
and Cin is a bit carried in from the next less significant stage.
36 | P a g e
e-CAD&VLSI LAB
4 ECE- e-CAD & VLSI Lab manual Aurora’s Engineering College
Simulation :
force a 0 0ns,1 40ns
force b 0 0ns,1 20ns,0 40ns,1 60ns
force c 0 0ns,1 10ns,0 20ns,1 30ns,0 40ns,1 50ns,0 60ns,1 70ns
run 80ns
37 | P a g e
e-CAD&VLSI LAB
4 ECE- e-CAD & VLSI Lab manual Aurora’s Engineering College
Synthesis diagram:
38 | P a g e
e-CAD&VLSI LAB
4 ECE- e-CAD & VLSI Lab manual Aurora’s Engineering College
Simulation :
force a 000 0ns,001 10ns,010 20ns,011 30ns,100 40ns,101 50ns,110 60ns,111 70ns
run 80ns
Synthesis Diagram:
Conclusion:
The VHDL code for full adder using Behavioral (if-then-else, case statement) modeling is
written, simulated and synthesized.
39 | P a g e
e-CAD&VLSI LAB
4 ECE- e-CAD & VLSI Lab manual Aurora’s Engineering College
Experiment 8(a)
DESIGN OF T-FLIPFLOP
Aim: To write the VHDL code for T-FLIPFLOP, simulate and synthesize using structural
model.
Tools Required:
1. FPG Advantage
i. Simulator: Modelsim SE6.1a
ii. Synthesis: Leonardo spectrum
Theory :
LIBRARY ieee;
USE ieee.std_logic_1164.all;
USE ieee.std_logic_arith.all;
40 | P a g e
e-CAD&VLSI LAB
4 ECE- e-CAD & VLSI Lab manual Aurora’s Engineering College
ENTITY tflipflop IS
port(t,clk: in std_logic;
q : inout std_logic:='0');
END ENTITY tflipflop;
ARCHITECTURE behav OF tflipflop IS
BEGIN
process(clk)
begin
q<='0';
if(clk'event and clk='1')then
if(t='1') then
q <=not(q);
else
q<=q;
end if;
end if;
end process;
END ARCHITECTURE behav;
Simulation :
force t 1 0ns
force clk 1 0ns,0 10ns,1 20ns,0 30ns,1 40ns,0 50ns,1 60ns,0 70ns,1 80ns
run 80ns
41 | P a g e
e-CAD&VLSI LAB
4 ECE- e-CAD & VLSI Lab manual Aurora’s Engineering College
Synthesis diagram:
Conclusion:
The VHDL code for T-flipflop is written in Behavioural Modelling(using if-else statement),
simulated and synthesized.
42 | P a g e
e-CAD&VLSI LAB
4 ECE- e-CAD & VLSI Lab manual Aurora’s Engineering College
Experiment 8(b)
DESIGN OF D-FLIPFLOP
Aim: To write the VHDL code for D-FLIPFLOP,simulate and synthesize using behavioural
model.
Tools Required:
1. FPG Advantage
i. Simulator: Modelsim SE6.1a
ii. Synthesis: Leonardo spectrum
Theory :
LIBRARY ieee;
USE ieee.std_logic_1164.all;
USE ieee.std_logic_arith.all;
ENTITY dflipflop IS
port(d,clk :in std_logic;
q:out std_logic);
END ENTITY dflipflop;
ARCHITECTURE behav OF dflipflop IS
43 | P a g e
e-CAD&VLSI LAB
4 ECE- e-CAD & VLSI Lab manual Aurora’s Engineering College
BEGIN
process(clk)
begin
if (clk'event and clk='1') then
q <= d;
end if;
end process;
END ARCHITECTURE behav;
Simulation :
force d 1 0ns,0 20ns
force clk 1 0ns,0 10ns,1 20ns,0 30ns,1 40ns,0 50ns,1 60ns
run 70ns
Synthesis diagram:
Conclusion:
The VHDL code for T-flipflop is written in Behavioural Modelling(using if-else statement),
simulated and synthesized.
44 | P a g e
e-CAD&VLSI LAB
4 ECE- e-CAD & VLSI Lab manual Aurora’s Engineering College
Experiment 8(c)
DESIGN OF JK-FLIPFLOP
Aim: To write the VHDL code for JK-FLIPFLOP,simulate and synthesize using behavioral
model.
Tools Required:
1. FPG Advantage
i. Simulator: Modelsim SE6.1a
ii. Synthesis: Leonardo spectrum
Theory :
VHDL code:
LIBRARY ieee;
USE ieee.std_logic_1164.all;
USE ieee.std_logic_arith.all;
ENTITY jkflipflop IS
port(s,r,j,k,clk : in std_logic;
q: inout std_logic;
qn: out std_logic:='1');
END ENTITY jkflipflop;
ARCHITECTURE behav OF jkflipflop IS
BEGIN
process(s,r,clk)
begin
if(r= '0' then q<= '0');
elsif s='0' then q<='1';
45 | P a g e
e-CAD&VLSI LAB
4 ECE- e-CAD & VLSI Lab manual Aurora’s Engineering College
Synthesis diagram:
Conclusion:
The VHDL code for JK Fliplop using behavioural modelling(using if-else) is written, simulated
and synthesized.
46 | P a g e
e-CAD&VLSI LAB
4 ECE- e-CAD & VLSI Lab manual Aurora’s Engineering College
CYCLE - 2
47 | P a g e
e-CAD&VLSI LAB
4 ECE- e-CAD & VLSI Lab manual Aurora’s Engineering College
Experiment 1
DESIGN RULES
Design rules are the communication link between the designer specifying requirements and the
fabricator who materializes them. Design rules are used to produce workable mask layouts from
which the various layers in silicon will be formed or patterned.
The object of a set of design rules is to allow a ready translation of circuit design concepts,
usually in stick diagram are symbolic form into actual geometry in silicon.
The first set of design rules are lambda based. These rules are straight forward and
relatively simple to occupy. They are real and chips can be fabricated from mask layout using the
lambda based rules set.
All paths in all layers will be dimensioned in lambda ‘λ’ and subsequently lambda
can be allocated and appropriate value compatible with the feature size of the fabrication
process.
48 | P a g e
e-CAD&VLSI LAB
4 ECE- e-CAD & VLSI Lab manual Aurora’s Engineering College
49 | P a g e
e-CAD&VLSI LAB
4 ECE- e-CAD & VLSI Lab manual Aurora’s Engineering College
50 | P a g e
e-CAD&VLSI LAB
4 ECE- e-CAD & VLSI Lab manual Aurora’s Engineering College
51 | P a g e
e-CAD&VLSI LAB
4 ECE- e-CAD & VLSI Lab manual Aurora’s Engineering College
rb10Minimum surface : 32 2
52 | P a g e
e-CAD&VLSI LAB
4 ECE- e-CAD & VLSI Lab manual Aurora’s Engineering College
53 | P a g e
e-CAD&VLSI LAB
4 ECE- e-CAD & VLSI Lab manual Aurora’s Engineering College
Experiment 2
BASIC LOGIC GATEs
Aim: To design the digital schematics and corresponding layouts using CMOS logic for an
AND LOGIC gate, OR LOGIC gate, NOT LOGIC gate and check the lambda based rules
using DRC and verify its functionality.
Apparatus:
Theory:
AND GateS: The AND gate is an electronic circuit that gives a high output (1) only if all its
inputs are high. A dot (.) is used to show the AND operation i.e. A.B.
Procedure:
1. Open the DSch2 tool and draw the schematic diagram as per the circuit drawn.
2. Save the file and verify the functionality.
3. After that open Microwind 3.1 tool and draw the layout diagram as per the circuit drawn.
4. Save the file and verify the lambda rules by using DRC, then verify the functionality.
54 | P a g e
e-CAD&VLSI LAB
4 ECE- e-CAD & VLSI Lab manual Aurora’s Engineering College
Timing Diagram:
Semi-custom Layout:
55 | P a g e
e-CAD&VLSI LAB
4 ECE- e-CAD & VLSI Lab manual Aurora’s Engineering College
Simulation:
Voltage –Time:
Conclusion:
The digital schematics and corresponding layouts using CMOS logic for an AND LOGIC gate
are designed and the lambda based rules using DRC are checked and verified its functionality.
56 | P a g e
e-CAD&VLSI LAB
4 ECE- e-CAD & VLSI Lab manual Aurora’s Engineering College
OR LOGIC GATE
OR Gate:
The OR gate is an electronic circuit that gives a high output (1) if one or more of its inputs are
high. A plus (+) is used to show the OR operation.
Procedure:
1. Open the DSch2 tool and draw the schematic diagram as per the circuit drawn.
2. Save the file and verify the functionality.
3. After that open Microwind 3.1 tool and draw the layout diagram as per the circuit drawn.
4. Save the file and verify the lambda rules by using DRC, then verify the functionality.
57 | P a g e
e-CAD&VLSI LAB
4 ECE- e-CAD & VLSI Lab manual Aurora’s Engineering College
Timing Diagram:
Semi-custom Layout:
58 | P a g e
e-CAD&VLSI LAB
4 ECE- e-CAD & VLSI Lab manual Aurora’s Engineering College
Simulation:
Voltage –Time:
Voltage-voltage:
59 | P a g e
e-CAD&VLSI LAB
4 ECE- e-CAD & VLSI Lab manual Aurora’s Engineering College
Conclusion:
The digital schematics and corresponding layouts using CMOS logic for an OR LOGIC gate
are designed and the lambda based rules using DRC are checked and verified its functionality.
NOT Gate:
The NOT gate is an electronic circuit that produces an inverted version of the input at its output.
It is also known as an inverter. If the input variable is A, the inverted output is known as NOT A.
This is also shown as A', or A with a bar over the top.
Procedure:
1. Open the DSch2 tool and draw the schematic diagram as per the circuit drawn.
2. Save the file and verify the functionality.
3. After that open Microwind 3.1 tool and draw the layout diagram as per the circuit drawn.
4. Save the file and verify the lambda rules by using DRC, then verify the functionality.
60 | P a g e
e-CAD&VLSI LAB
4 ECE- e-CAD & VLSI Lab manual Aurora’s Engineering College
Timing Diagram:
61 | P a g e
e-CAD&VLSI LAB
4 ECE- e-CAD & VLSI Lab manual Aurora’s Engineering College
Simulation:
Voltage –Time:
62 | P a g e
e-CAD&VLSI LAB
4 ECE- e-CAD & VLSI Lab manual Aurora’s Engineering College
Voltage-Voltage:
Conclusion:
The digital schematics and corresponding layouts using CMOS logic for an NOT LOGIC gate
are designed and the lambda based rules using DRC are checked and verified its functionality.
63 | P a g e
e-CAD&VLSI LAB
4 ECE- e-CAD & VLSI Lab manual Aurora’s Engineering College
Experiment 2(b)
Apparatus:
THEORY:
NAND: This is a NOT-AND gate which is equal to an AND gate followed by a NOT gate. The
outputs of all NAND gates are high if any of the inputs are low. The symbol is an AND gate
with a small circle on the output. The small circle represents inversion
Procedure:
1. Open the DSch2 tool and draw the schematic diagram as per the circuit drawn.
2. Save the file and verify the functionality.
3. After that open Microwind 3.1 tool and draw the layout diagram as per the circuit drawn.
4. Save the file and verify the lambda rules by using DRC, then verify the functionality.
64 | P a g e
e-CAD&VLSI LAB
4 ECE- e-CAD & VLSI Lab manual Aurora’s Engineering College
Timing Diagram:
Semi-custom Layout:
65 | P a g e
e-CAD&VLSI LAB
4 ECE- e-CAD & VLSI Lab manual Aurora’s Engineering College
Full-Custom Layout:
Simulation:
Voltage –Time:
Conclusion:
The digital schematics and corresponding layouts using CMOS logic for an NAND LOGIC gate
are designed and the lambda based rules using DRC are checked and verified its functionality.
66 | P a g e
e-CAD&VLSI LAB
4 ECE- e-CAD & VLSI Lab manual Aurora’s Engineering College
NOR Gate:
This is a NOT-OR gate which is equal to an OR gate followed by a NOT gate. The outputs of all
NOR gates are low if any of the inputs are high.The symbol is an OR gate with a small circle on
the output. The small circle represents inversion
Procedure:
1. Open the DSch2 tool and draw the schematic diagram as per the circuit drawn.
2. Save the file and verify the functionality.
3. After that open Microwind 3.1 tool and draw the layout diagram as per the circuit drawn.
4. Save the file and verify the lambda rules by using DRC, then verify the functionality.
67 | P a g e
e-CAD&VLSI LAB
4 ECE- e-CAD & VLSI Lab manual Aurora’s Engineering College
Timing Diagram:
68 | P a g e
e-CAD&VLSI LAB
4 ECE- e-CAD & VLSI Lab manual Aurora’s Engineering College
Semi-custom Layout:
Simulation:
Voltage –Time:
69 | P a g e
e-CAD&VLSI LAB
4 ECE- e-CAD & VLSI Lab manual Aurora’s Engineering College
Voltage-voltage:
Conclusion:
The digital schematics and corresponding layouts using CMOS logic for an NOR LOGIC gate
are designed and the lambda based rules using DRC are checked and verified its functionality.
70 | P a g e
e-CAD&VLSI LAB
4 ECE- e-CAD & VLSI Lab manual Aurora’s Engineering College
Experiment 2(c)
EX-OR LOGIC GATE
Aim: To design the digital schematics and corresponding layouts using CMOS logic for an
EX-OR LOGIC gate, EX-NOR LOGIC gate and check the lambda based rules using DRC and
verify its functionality.
Apparatus:
THEORY:
EX-OR: The 'Exclusive-OR' gate is a circuit which will give a high output if either, but not
both, of its two inputs are high. An encircled plus sign ( ) is used to show the EXOR operation.
Procedure:
1. Open the DSch2 tool and draw the schematic diagram as per the circuit drawn.
2. Save the file and verify the functionality.
3. After that open Microwind 3.1 tool and draw the layout diagram as per the circuit drawn.
4. Save the file and verify the lambda rules by using DRC, then verify the functionality.
71 | P a g e
e-CAD&VLSI LAB
4 ECE- e-CAD & VLSI Lab manual Aurora’s Engineering College
Timing Diagram:
Semi-custom Layout:
72 | P a g e
e-CAD&VLSI LAB
4 ECE- e-CAD & VLSI Lab manual Aurora’s Engineering College
Simulation:
Voltage –Time:
Voltage-voltage:
Conclusion:
The digital schematics and corresponding layouts using CMOS logic for an EX-OR LOGIC
gate are designed and the lambda based rules using DRC are checked and verified its
functionality.
73 | P a g e
e-CAD&VLSI LAB
4 ECE- e-CAD & VLSI Lab manual Aurora’s Engineering College
Ex-NOR Gate:
The 'Exclusive-NOR' gate is a circuit which will give a high output if both of its inputs
are high or low. An encircled dot sign (.) is used to show the EXNOR operation.
A B ~ (a^b)
0 0 1
0 1 0
1 0 0
1 1 1
Procedure:
1. Open the DSch2 tool and draw the schematic diagram as per the circuit drawn.
2. Save the file and verify the functionality.
3. After that open Microwind 3.1 tool and draw the layout diagram as per the circuit drawn.
4. Save the file and verify the lambda rules by using DRC, then verify the functionality.
74 | P a g e
e-CAD&VLSI LAB
4 ECE- e-CAD & VLSI Lab manual Aurora’s Engineering College
Timing diagram:
75 | P a g e
e-CAD&VLSI LAB
4 ECE- e-CAD & VLSI Lab manual Aurora’s Engineering College
Semi-custom Layout:
Simulation:
Voltage –Time:
Conclusion:
The digital schematics and corresponding layouts using CMOS logic for an EX-NOR LOGIC
gate are designed and the lambda based rules using DRC are checked and verified its
functionality.
76 | P a g e
e-CAD&VLSI LAB
4 ECE- e-CAD & VLSI Lab manual Aurora’s Engineering College
Experiment 3
HALF ADDER
Aim: To design the digital schematics and corresponding layouts using CMOS logic for
HALF ADDER and check the lambda based rules using DRC and verify its functionality.
Apparatus:
Theory:
The half adder adds two one-bit binary numbers A and B. It has two outputs, S and C
Procedure:
1. Open the DSch2 tool and draw the schematic diagram as per the circuit drawn.
2. Save the file and verify the functionality.
3. After that open Microwind 3.1 tool and draw the layout diagram as per the circuit drawn.
4. Save the file and verify the lambda rules by using DRC, then verify the functionality.
77 | P a g e
e-CAD&VLSI LAB
4 ECE- e-CAD & VLSI Lab manual Aurora’s Engineering College
Timing Diagram:
Semi-custom Layout:
78 | P a g e
e-CAD&VLSI LAB
4 ECE- e-CAD & VLSI Lab manual Aurora’s Engineering College
Simulation:
Voltage –Time:
Voltage-Voltage:
Conclusion:
The digital schematics and corresponding layouts using CMOS logic for an HALF ADDER are
designed and the lambda based rules using DRC
79 | P a g e
e-CAD&VLSI LAB
4 ECE- e-CAD & VLSI Lab manual Aurora’s Engineering College
Experiment 4
Aim: To write SPICE code for CMOS Inverter Circuit, Simulate and verify functionality.
Apparatus:
1. PSPICE
i. DesignLab Eval8
Theory:
In CMOS, both p and n-channel transistors are used. A schematic circuit representation of the
CMOS inverter is shown in figure. The operation of the circuit on an inverter can be explained as
follows. All voltages are referenced with respect to VSS, the ground potential. When the input
voltage VI is zero, the gate of the p-channel transistor is at VDD below the source potential, that
is, VGS=VDD. This turns on the transistor, which is turned off since VGS=0 for this transistor.
Now if the input voltage is raised to the threshold voltage level of the n-channel transistor raised
to VDD, the n-channel transistor will conduct while the p-channel transistor gets turned off,
discharging the load capacitance C to ground potential.
Procedure:
1. Start program Design Lab Eval8 select Design manager to get Design Manager
window
2. Click on Run Text Edit window to get microsim text editor
3. Type the program, save it with experiment name.
4. Then run pspice AD, to get pspice AD window.
5. Then go to file, click on open to select the saved file
6. The selected file is simulated successfully.
7. Go to file, click Run Probe to get microsim probe window.
8. Click on Add Trace, Deselect Currents and Aliased names and click on OK to view the
frequency response.
80 | P a g e
e-CAD&VLSI LAB
4 ECE- e-CAD & VLSI Lab manual Aurora’s Engineering College
Circuit Diagram:
CMOS Inverter:
81 | P a g e
e-CAD&VLSI LAB
4 ECE- e-CAD & VLSI Lab manual Aurora’s Engineering College
Conclusion:
The SPICE code for CMOS Inverter Circuit is written, simulated and the functionality is
verified.
82 | P a g e
e-CAD&VLSI LAB
4 ECE- e-CAD & VLSI Lab manual Aurora’s Engineering College
Experiment 5
Aim: To write SPICE code for Differential Amplifier, Simulate and verify functionality.
Apparatus:
1. PSPICE
i. DesignLab Eval8
Theory:
Differential amplifiers are compatible with the matching properties of IC technology. The
differential amplifier has two modes of signal operation:
i. Differential mode,
ii. Common mode.
Differential amplifiers are excellent input stages for voltage amplifiers Differential amplifiers
can have different loads including:
Current mirrors
MOS diodes
Current sources/sinks
Resistors
The small signal performance of the differential amplifier is similar to the inverting amplifier in
gain, output resistance and bandwidth. The large signal performance includes slew rate and the
linearization of the transconductance. The design of CMOS analog circuits uses the relationships
of the circuit to design the dc currents and the W/L ratios of each transistor.
A differential amplifier is an amplifier that amplifies the difference between two voltages and
rejects the average or common mode value of the two voltages. Differential and common mode
voltages: v1 and v2 are called single-ended voltages. They are voltages referenced to ac ground.
The differential-mode input voltage, vID, is the voltage difference between v1 and v2. The
common-mode input voltage, vIC, is the average value of v1 and v2 .
83 | P a g e
e-CAD&VLSI LAB
4 ECE- e-CAD & VLSI Lab manual Aurora’s Engineering College
Circuit Diagram:
Figure: General MOS Differential Amplifier: (a) Schematic Diagram, (b) Input Gate Voltages
Implementation.
84 | P a g e
e-CAD&VLSI LAB
4 ECE- e-CAD & VLSI Lab manual Aurora’s Engineering College
* Filename="diffvid.cir"
* MOS Diff Amp with Current Mirror Load
*DC Transfer Characteristics vs VID
VID 7 0 DC 0V AC 1V
E+ 1 10 7 0 0.5
E- 2 10 7 0 -0.5
VIC 10 0 DC 0.65V
VDD 3 0 DC 2.5VOLT
VSS 4 0 DC -2.5VOLT
M1 5 1 8 8 NMOS1 W=9.6U L=5.4U
M2 6 2 8 8 NMOS1 W=9.6U L=5.4U
M3 5 5 3 3 PMOS1 W=25.8U L=5.4U
M4 6 5 3 3 PMOS1 W=25.8U L=5.4U
M5 8 9 4 4 NMOS1 W=21.6U L=1.2U
M6 9 9 4 4 NMOS1 W=21.6U L=1.2U
IB 3 9 220UA
.MODEL NMOS1 NMOS VTO=1 KP=40U
+ GAMMA=1.0 LAMBDA=0.02 PHI=0.6
+ TOX=0.05U LD=0.5U CJ=5E-4 CJSW=10E-10
+ U0=550 MJ=0.5 MJSW=0.5 CGSO=0.4E-9 CGDO=0.4E-9
85 | P a g e
e-CAD&VLSI LAB
4 ECE- e-CAD & VLSI Lab manual Aurora’s Engineering College
Conclusion:
The SPICE code for CMOS Differential Amplifier is written, simulated and the functionality is
verified.
86 | P a g e
e-CAD&VLSI LAB
4 ECE- e-CAD & VLSI Lab manual Aurora’s Engineering College
Experiment 6(a)
Apparatus:
1. PSPICE
i. DesignLab Eval8
Theory:
A common Source amplifier is one of three basic single-stage MOSFET amplifier topologies,
typically used as a voltage or transconductance amplifier. The easiest way to tell if a MOSFET is
common source, common drain, or common gate is to examine where the signal enters and
leaves. The remaining terminal is what is known as “common”. The signal enters the gate, and
exits the drain. The only terminal is the source. This is a common-source MOSFET. The
analogous bipolar junction transistor circuit is the common-emitter amplifier.
87 | P a g e
e-CAD&VLSI LAB
4 ECE- e-CAD & VLSI Lab manual Aurora’s Engineering College
Circuit Diagram:
88 | P a g e
e-CAD&VLSI LAB
4 ECE- e-CAD & VLSI Lab manual Aurora’s Engineering College
Conclusion:
The PSPICE code for CMOS Common Source Amplifier is written, simulated (AC analysis) and
the functionality is verified.
89 | P a g e
e-CAD&VLSI LAB
4 ECE- e-CAD & VLSI Lab manual Aurora’s Engineering College
Experiment 6(b)
Aim: To write SPICE code for Common Drain Amplifier, Simulate and verify the functionality.
Apparatus:
1. PSPICE
Theory:
A common-drain amplifier, also known as a source follower, is one of three basic single-stage
MOSFET amplifier topologies, typically used as a voltage buffer. In the circuit the gate terminal
of the transistor serves as the input, the source is the output, and the drain is common to both
(input and output), hence its name. The analogous bipolar junction transistor circuit is the
common-collector amplifier.
In addition, this circuit is used to transform impedances. For example, the Thévenin resistance of
a combination of a voltage follower driven by a voltage source with high Thévenin resistance is
reduced to only the output resistance of the voltage follower, a small resistance. That resistance
reduction makes the combination a more ideal voltage source. Conversely, a voltage follower
inserted between a driving stage and a high load (i.e. a low resistance) presents an infinite
resistance (low load) to the driving stage, an advantage in coupling a voltage signal to a large
load.
90 | P a g e
e-CAD&VLSI LAB
4 ECE- e-CAD & VLSI Lab manual Aurora’s Engineering College
Circuit Diagram:
91 | P a g e
e-CAD&VLSI LAB
4 ECE- e-CAD & VLSI Lab manual Aurora’s Engineering College
Conclusion:
The PSPICE code for CMOS Common Drain Amplifier is written, simulated (AC analysis) and
the functionality is verified.
92 | P a g e
e-CAD&VLSI LAB