Professional Documents
Culture Documents
E-Cad and Vlsi Lab
E-Cad and Vlsi Lab
1
CONTENTS
2
Xilinx Manual:
Xilinx ISE is a software tool produced by Xilinx for synthesis and analysis of HDL designs,
which enables the developer to synthesize ("compile") their designs, perform timing analysis,
examine RTL diagrams, simulate a design's reaction to different stimuli, and configure the
target device with the programmer
In our Lab, the scope is limited to design and analyze the design using test benches &
simulation
The following is the step by step procedure to design in the Xilinx ISE:
3
2.Continue to the next window and check if the Preferred Language is selected as „Verilog‟
3. Proceed by clicking „Next‟ and create a „New Source‟ using the „Create New Source‟
Window
4
4. Select the source type as „Verilog Module‟ and input a filename and proceed to „Next‟
In the next window „Define Module‟ enter the ports
5. Finish with the new project setup with the „Summary‟ window
5
6. Once „Finish‟ is selected a pop-up appears to create the directory Select „yes‟
7. Then proceed to „Next‟ in the “New Project Wizard‟ to „Add Existing Sources‟ „Add
source‟ if an existing source is available, If not proceed to „Next‟ and finish with the
„Project Summary‟ window
6
Design Entry and Syntax Check
The ports defined during the „Project Creation‟ are defined as a module in the „filenamev‟
file
7
10. Select the design from the „Hierarchy “window In the below window of Processes
„Implement Design „would be orange (in color) ready for implementation
11. Double click on implement design, it turns green (in color) once the design is
implemented successfully and the Summary report is displayed
8
12. Test-Bench creations, Simulation & Verification
To add a test-bench to the existing design, right click on the „v‟ file from the Hierarchy
window and select „New Source‟
13. Select „Verilog Text Fixture‟ from the Select Source Type and name the Test-Bench
9
14. Continue to „Finish‟ and a test bench is added in the project area
15. Edit the test bench as per your simulation requirements and select „Behavioral
Simulation‟ in the „Design Window‟ In the Processes window Isim Simulator would be
displayed First Proceed with the Behavioral Check Syntax
10
16. Double clicks on „Behavioral Check Syntax‟ & check for no errors
17. Then double click on „Simulate Behavioral Model‟ and the ISIM simulator window
would open Check for the outputs
11
Procedure for porting the SPARTAN 3E
1. Go to User Constraints -> Assign package pins. Then the window shown as below is opened. Now we
have to give input and output port numbers in “Loc” coloum. Here we have two inputs and two
outputs.
2. Let inputs be L13 and L14 and outputs be F12 and E12 as shown below.
12
4. Now a window named Bus Limiter will open. Here select “symplify verilog default[]” and click OK.
5. Come back to program and follow: Generate Programming file -> Configure device
13
6. Now iMPACT pop will open and there select “Configure devices using Boundary scan” , next click
FINISH.
7. Then Progress dialogue will open, showing “Executing command…….”. We have to wait until the
execution is completed.
8. After execution, the window shown as below will open. It shows device selection i.e., Spartan 500e.
14
9. Already created .ucf file is added to Spartan as shown below:
10. Right click on the first icon -> select “assign new configuration file” as shown below:
15
11. Then select .bit file as shown and click OPEN.
12. After opening file, again right click on first device ans select PROGRAM
16
14. Finally we will get a pop-up showing “program succeeded”. This will finish dumping process.
17
EXPERIMENT: 1- HDL CODE TO REALIZE ALL LOGIC GATES
AIM: To develop the source code for logic gates by using VERILOG and obtain the simulation,
synthesis, place and route and implement into FPGA
1. XILINX 92i
2. FPGA-SPARTAN-3
LOGIC DIAGRAM:
A B Y=AB A B Y=A+B
0 0 0 0 0 0
0 1 0 0 1 1
1 0 0 1 0 1
1 1 1 1 1 1
A B Y=(A+B)’
A B
0 0 1
0 1 0 0 0 0
1 0 0 0 1 1
1 1 0 1 0 1
1 1 0
18
XNOR GATE:
LOGIC DIAGRAM: TRUTH TABLE:
A B
0 0 1
0 1 0
1 0 0
1 1 1
VERILOG SOURCE CODE:
module logicgates1(a,b,c);
input a;
input b;
output[6:0]c;
assign c[0]= a & b;
assign c[1]= a | b;
assign c[2]= ~(a &
b); assign c[3]= ~(a |
b); assign c[4]= a ^
b; assign c[5]= ~(a ^
b); assign c[6]= ~ a;
endmodule
Simulation output:
19
Synthesis RTL Schematic:
RESULT:
Thus the OUTPUT‟s of all logic gates are verified by synthesizing and simulating the
VERILOG code.
20
EXPERIMENT: 2-DESIGN OF 2-TO-4 DECODER
AIM: To develop the source code for decoder by using VERILOG and obtain the simulation,
synthesis, place and route and implement into FPGA
1. XILINX 9.2i
2. FPGA-SPARTAN-3.
3.
LOGIC DIAGRAM: TRUTH TABLE:
0 0 1 0 1 1 1
0 1 1 1 0 1 1
1 0 1 1 1 0 1
1 1 1 1 1 1 0
21
Simulation output:
RESULT:
Thus the OUTPUT‟s of decoder are verified by synthesizing and simulating the VERILOG
Code
22
EXPERIMENT: 3- DESIGN OF 8-TO-3 ENCODER
AIM: To develop the source code for logic gates by using VERILOG and obtain the simulation, synthesis,
place and route and implement into FPGA
1. XILINX 92i
2. FPGA-SPARTAN-3
ENCODER:
TRUTH
LOGIC DIAGRAM: TABLE:
D0 D1 D2 D3 D4 D5 D6 D7 X Y Z
1 0 0 0 0 0 0 0 0 0 0
0 1 0 0 0 0 0 0 0 0 1
0 0 1 0 0 0 0 0 0 1 0
0 0 0 1 0 0 0 0 0 1 1
0 0 0 0 1 0 0 0 1 0 0
0 0 0 0 0 1 0 0 1 0 1
0 0 0 0 0 0 1 0 1 1 0
0 0 0 0 0 0 0 1 1 1 1
23
Simulation output:
RESULT:
Thus the OUTPUT‟s of Encoded are verified by synthesizing and simulating the VERILOG
code
24
EXPERIMENT: 4- 8X1 MUULTIPLEXER
AIM: To design and implement 8:1 Multiplexer.
VERILOG CODE:
input a, b, c, d, e, f, g, h;
output y;
(s1==0)? ((s1==0)?e:f):(s1==0)?g:h;
endmodule
SIMULATION:
Force commands:
force s1 0 0ns,1 5ns,0 10ns,1 15ns, 0 20ns, 1 25ns, 0 30ns, 1 35ns, 0 40ns;
Wave forms
25
SYNTHESIS RTL SCHEMATIC:
RESULT: Verilog code for 8X1 MULTIPLEXER has been simulated and synthesi
26
27
EXPERIMENT: 5-DESIGN OF 4-BIT BINARY TO GRAY CONVERTER
AIM:
To develop the source code for binary to gray converter by using VERILOG and obtained
the simulation, synthesis, place and route and implement into FPGA
1. XILINX 92i
2. FPGA-SPARTAN-3
TRUTH TABLE:
BCD GRAY
0000 0000
0001 0001
0010 0011
0011 0010
0100 0110
0101 0111
0110 0101
0111 0100
1000 1100
1001 1101
LOGIC DIAGRAM:
Behavioral Modeling:
28
always@(b)
begin g[3]=b[3];
g[2]=b[3]^b[2];
g[1]=b[2]^b[1];
g[0]=b[1]^b[0];
end
endmodule
Simulation output:
RESULT:
Thus the OUTPUT‟s of binary to gray converter are verified by synthesizing and simulating
the VERILOG code
29
EXPERIMENT: 6-DESIGN OF MULTIPLEXER AND DEMULTIPLEXER
AIM:
To develop the source code for multiplexer and Demultiplexer by using VERILOG and
obtain the simulation, synthesis, place and route and implement into FPGA
1. XILINX 92i
2. FPGA-SPARTAN-3
MULTIPLEXER:
LOGIC DIAGRAM:
TRUTH TABLE:
SELECT OUTPUT
INPUT
S1 S0 Y
0 0 D0
0 1 D1
1 0 D2
1 1 D3
p=(d[0]&s0bar&s1bar);
q=(d[1]&s0bar&s1);
30
r=(d[2]&s0&s1bar);
s=(d[3]&s0
&s1); y=p |
q |r |s;
end
endm
odule
Simulation output:
31
DEMULTIPLEXER:
LOGIC DIAGRAM:
`
TRUTH TABLE:
INPUT OUTPUT
D S0 S1 Y0 Y1 Y2 Y3
1 0 0 1 0 0 0
1 0 1 0 1 0 0
1 1 0 0 0 1 0
1 1 1 0 0 0 1
Source Code:
Simulation output:
32
Synthesis RTL schematic:
RESULT:
Thus the OUTPUT‟s of Multiplexers and Demultiplexers are verified by synthesizing and
simulating the VHDL and VERILOG code
33
EXPERIMENT: 7-DESIGN OF FULL ADDER USING THREE MODELLING
STYLES
AIM: To develop the source code for full adder using three modeling styles by using VERILOG and
obtained the simulation, synthesis, place and route and implement into FPGA
1. XILINX 92i
2. FPGA-SPARTAN-3
FULL ADDER:
A B C SUM CARRY
0 0 0 0 0
0 0 1 1 0
0 1 0 1 0
0 1 1 0 1
1 0 0 1 0
1 0 1 0 1
1 1 0 0 1
1 1 1 1 1
Dataflow Modeling:
endmodule
34
Behavioral Modeling:
Structural Modeling:
35
Simulation output:
RESULT:
Thus the OUTPUT‟s of full adder using three modeling styles are verified by
synthesizing and simulating the VERILOG code
36
EXPERIMENT: 8-DESIGN OF FLIP FLOPS (SR, JK, and D)
AIM: To develop the source code for FLIP FLOPS by using VERILOG and obtained the simulation,
synthesis, place and route and implement into FPGA
SR FLIPFLOP:
Q(t) S R Q(t+1)
0 0 0 0
0 0 1 0
0 1 0 1
0 1 1 X
1 0 0 1
1 0 1 0
1 1 0 1
1 1 1 X
Behavioral Modeling:
37
else if(s==1'b0 && r==1'b1)
begin
q= 1'b0; qbar= 1'b1;
end
else if(s==1'b1 && r==1'b0)
begin
q= 1'b1; qbar= 1'b0;
end
else
begin
q=1'bx;qbar=1'bx;
end
end
endmodule
Simulation output:
38
Synthesis RTL schematic:
JK FLIPFLOP:
Q(t) J K Q(t+1)
0 0 0 0
0 0 1 0
0 1 0 1
0 1 1 1
1 0 0 1
1 0 1 0
1 1 0 1
1 1 1 0
39
VERILOG SOURCE CODE:
Behavioral Modeling:
40
Simulation output:
D FLIPFLOP:
LOGIC DIAGRAM: TRUTH TABLE:
Q(t) D Q(t+1)
0 0 0
0 1 1
1 0 0
1 1 1
41
begin
q=1'b1
;
qbar=1
'b0;
end
e
nd
endmo
dule
Simulation output:
RESULT:
Thus the OUTPUT‟s of Flip flops using three modeling styles are verified by
synthesizing and simulating the VERILOG code
42
EXPERIMENT-9- DESIGN OF 4BIT BINARY BCD COUNTERS (SYNC& ASYNC)
AIM: To design 4-bit binary bcd counter by using VERILOG and obtained the simulation,
synthesis, place and route and implement into FPGA.
SOFTWARE: Xilinx 9.2i, Simulator: ISE Simulator. Synthesis Device: Spartan3E.
PROGRAM:
module Counter_4Bit ( clk ,reset ,dout );
input clk ;
wire clk ;
input reset ;
wire reset ;
initial dout = 0;
if (reset)
dout <= 0;
else
end
endmodule
43
SIMULATION RESULT:
RESULT: Hence BCD counter is designed by using VERILOG and obtained the simulation,
synthesis, place and route and implement into FPGA.
44
EXPERIMENT-10 -FINITE STATE MACHINE DESIGN
AIM: 1.Write a VHDL Program for a Moore machine for a given sequence 1011.
BLOCK DIAGRAM:
PS
NS
Next state Memory Output
inputs generation decoder
Elements
(Input logic) (Output
(reg)
logic)
CLK
Present state
1
VHDL PROGRAM:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
ENTITY moore_fsm_1011 IS
END moore_fsm_1011 ;
signal ps,ns:moore;
BEGIN
45
comb_part:process(x,ps)
BEGIN
case ps is
when s0=>
if x='1'then
ns<=s1;
else
ns<=s0;
end if;
when s1=>
if x='0'then
ns<=s2;
else
ns<=s1;
end if;
when s2=>
if x='1'then
ns<=s3;
else
ns<=s0;
end if;
when s3=>
if x='1'then
ns<=s4;
else
46
ns<=s2;
end if;
when s4=>
if x='1'then
ns<=s1;
else
ns<=s2;
end if;
end case;
seq_part:process(clk)
BEGIN
z <= '1';
end if;
ps<=ns;
end if;
END fsm_1011;
47
SIMULATION:
RESULT: The functionality of the more machine for a given sequnce1011 is verified by writing
the VHDL code and studying the obtained waveform and synthesis results.
48
EXPERIMENT-11 –CMOS INVERTER LAY OUT
AIM: To design CMOS inverter lay out by using Micro wind tool and obtained the simulation.
SOFTWARE: Micro wind 3.5lit.
49
CMOS INVERTER LAYOUT:
50
CMOS INVERTER SIMULATION RESULTS:
RESULT: The functionality of the CMOS INVERTER is verified by drawing layout and
obtained the simulation waveform.
51
EXPERIMENT-12 –CMOS NAND GATE LAY OUT
AIM: To design CMOS NAND gate lay out by using Micro wind tool and obtained the
simulation.
SOFTWARE: Micro wind 3.5lit.
52
53
CMOS NAND GATE SIMULATION RESULTS:
RESULT: The functionality of the CMOS NAND is verified by drawing layout and obtained the
simulation waveform.
54
EXPERIMENT-12 –CMOS NOR GATE LAY OUT
AIM: To design CMOS NOR gate lay out by using Micro wind tool and obtained the
simulation.
SOFTWARE: Micro wind 3.5lit.
55
56
CMOS NOR GATE SIMULATION RESULTS:
RESULT: The functionality of the CMOS NOR is verified by drawing layout and obtained the
simulation waveform.
57
EXPERIMENT-12 –CMOS XOR GATE LAY OUT
AIM: To design CMOS XOR gate lay out by using Micro wind tool and obtained the
simulation.
SOFTWARE: Micro wind 3.5lit.
58
CMOS XOR GATE SIMULATION RESULTS:
RESULT: The functionality of the CMOS XOR is verified by drawing layout and obtained the
simulation waveform
59