Vlsi Lab Manual - 2022
Vlsi Lab Manual - 2022
DEPARTMENT OF ECE
LAB MANUAL
Year : III
Semester : VI
Batch : 2018-2022
Programme : B.E.,
Department : ECE
MS.V.SUSHMITHA.AP/ECE
AIM:
To design an adder (min 8 bit) using HDL. Simulate it using Xilinx/Altera software and implement
by Xilinx/Altera FPGA
APPARATUS REQUIRED:
3. Enter the Project Name and select the location then click next
4. Select the Device and other category and click next twice and finish.
5. Click on the symbolof FPGAdevice and then right click>click on new source.
6. Select the Verilog Module and give the filename>click next and define ports
9. Click on the symbol of FPGA device and then right click>click on new source.
10. Select the Test Bench Waveform and give the filename>select entity click next
and finish.
11. Select the desired parameters for simulating your design.In this case combinational
circuit and simulation time click finish.
12. Assign all input signal using just click on graph and save file.
13. From the source process window. Click Behavioral simulation from drop-down
menu
14. Select the test bench file (.tbw) and click process button>double click
the Simulation Behavioral Model
15. Verify your design in wave window by seeing behavior of output signal with respect
to input signal
16. To assign package pins using corresponding CPLD manual via using constraint.
17. Assign package pins.
18. The pace file opened and give the pin details.
19. Go Implement design and generate the programming file and configure the device
(impact).
20. In configure device choose JTAG options and add the Xlinx device in boundary
scan and download the program and execute successfully.
CODING
8 BIT ADDER
module adder(s,cout,a,b,cin);
output[7:0]s;
outputcout;
input[7:0]a,b;
inputcin;
wirec1,c2,c3,c4,c5,c6,c7;
fulladd fa0(s[0],c1,a[0],b[0],cin);
fulladd fa1(s[1],c2,a[1],b[1],c1);
fulladd fa2(s[2],c3,a[2],b[2],c2);
fulladd fa3(s[3],c4,a[3],b[3],c3);
fulladd fa4(s[4],c5,a[4],b[4],c4);
fulladd fa5(s[5],c6,a[5],b[5],c5);
fulladd fa6(s[6],c7,a[6],b[6],c6);
fulladd fa7(s[7],cout,a[7],b[7],c7);
endmodule
modulefulladd(s,cout,a,b,cin);
outputs,cout;
inputa,b,cin; xor
(s,a,b,cin);
assigncout= ((a&b)|(b&cin)|(a&cin)) ;
endmodule
SIMULATION OUTPUT
RESULT
Thus an adder (min 8 bit) using HDL was simulated using Xilinx/Altera software and implement
by Xilinx/Altera FPGA.
Ex. No: 2 Date:
AIM:
To design an multiplier (min 4 bit) using HDL. Simulate it using Xilinx/Altera software and
implement by Xilinx/Altera FPGA
APPARATUS REQUIRED:
PROCEDURE:
3. Enter the Project Name and select the location then click next
4. Select the Device and other category and click next twice and finish.
5. Click on the symbolof FPGAdevice and then right click>click on new source.
6. Select the Verilog Module and give the filename>click next and define ports
9. Click on the symbol of FPGA device and then right click>click on new source.
10. Select the Test Bench Waveform and give the filename>select entity click next
and finish.
11. Select the desired parameters for simulating your design.In this case combinational
circuit and simulation time click finish.
12. Assign all input signal using just click on graph and save file.
13. From the source process window. Click Behavioral simulation from drop-down
menu
14. Select the test bench file (.tbw) and click process button>double click
the Simulation Behavioral Model
15. Verify your design in wave window by seeing behavior of output signal with respect
to input signal.
16. To assign package pins using corresponding CPLD manual via using constraint.
17. Assign package pins.
18. The pace file opened and give the pin details.
19. Go Implement design and generate the programming file and configure the device
(impact).
20. In configure device choose JTAG options and add the Xlinx device in boundary
scan and download the program and execute successfully.
COIDNG
4 BIT MULTIPLIER
modulemulti(m,a,b); input
[3:0]a;
and(p[0],a[0],b[0]);
and(p[1],a[1],b[0]);
and(p[2],a[0],b[1]);
and(p[3],a[2],b[0]);
and(p[4],a[1],b[1]);
and(p[5],a[0],b[2]);
and(p[6],a[3],b[0]);
and(p[7],a[2],b[1]);
and(p[8],a[1],b[2]);
and(p[9],a[0],b[3]);
and(p[10],a[3],b[1]);
and(p[11],a[2],b[2]);
and(p[12],a[1],b[3]);
and(p[13],a[3],b[2]);
and(p[14],a[2],b[3]);
and(p[15],a[3],b[3]);
half ha1(s[1],c[1],p[1],p[2]);
half ha2(s[2],c[2],p[4],p[3]);
half ha3(s[3],c[3],p[7],p[6]);
full fa4(s[4],c[4],p[11],p[10],c[3]);
full fa5(s[5],c[5],p[14],p[13],c[4]);
full fa6(s[6],c[6],p[5],s[2],c[1]);
full fa7(s[7],c[7],p[8],s[3],c[2]);
full fa8(s[8],c[8],p[12],s[4],c[7]);
full fa9(s[9],c[9],p[9],s[7],c[6]);
half ha10(s[10],c[10],s[8],c[9]);
full fa11(s[11],c[11],s[5],c[8],c[10]);
full fa12(s[12],c[12],p[15],s[5],c[11]);
buf(m[0],p[0]);
buf(m[1],s[1]);
buf(m[2],s[6]);
buf(m[3],s[9]);
buf(m[4],s[10]);
buf(m[5],s[11]);
buf(m[6],s[12]);
buf(m[7],c[12]);
endmodule
modulehalf(s,co,x,y);
inputx,y;
outputs,co;
xor (s,x,y);
and (co,x,y);
endmodule
module full(s,co,x,y,ci);
inputx,y,ci;
outputs,co;
wires1,d1,d2;
half ha_1(s1,d1,x,y);
half ha_2(s,d2,s1,ci);
oror_gate(co,d2,d1);
endmodule
MODEL OUTPUT 4BIT MULTIPLIER
SIMULATION OUTPUT
RESULT
Thus a multiplier (min 4 bit) using HDL was simulated using Xilinx/Altera software and
implement by Xilinx/Altera FPGA.
Ex. No: 3 Date:
AIM:
To design an ALU using HDL. Simulate it using Xilinx/Altera software and implement by
Xilinx/Altera FPGA
APPARATUS REQUIRED:
PROCEDURE:
3. Enter the Project Name and select the location then click next
4. Select the Device and other category and click next twice and finish.
5. Click on the symbolof FPGAdevice and then right click>click on new source.
6. Select the Verilog Module and give the filename>click next and define ports
9. Click on the symbol of FPGA device and then right click>click on new source.
10. Select the Test Bench Waveform and give the filename>select entity click next
and finish.
11. Select the desired parameters for simulating your design.In this case combinational
circuit and simulation time click finish.
12. Assign all input signal using just click on graph and save file.
13. From the source process window. Click Behavioral simulation from drop-down
menu
14. Select the test bench file (.tbw) and click process button>double click
the Simulation Behavioral Model
15. Verify your design in wave window by seeing behavior of output signal with respect
to input signal.
16. To assign package pins using corresponding CPLD manual via using constraint.
17. Assign package pins.
18. The pace file opened and give the pin details.
19. Go Implement design and generate the programming file and configure the device
(impact).
20. In configure device choose JTAG options and add the Xlinx device in boundary
scan and download the program and execute successfully.
CODING
MODEL OUTPUT
SIMULATION OUTPUT
RESULT
Thusa ALU using HDL was simulated using Xilinx/Altera software and implement by
Xilinx/Altera FPGA
Ex. No: 4 Date:
AIM:
To design Universal Shift Register using HDL. Simulate it using Xilinx/Altera software and
implement by Xilinx/Altera FPGA
APPARATUS REQUIRED:
PROCEDURE:
3. Enter the Project Name and select the location then click next
4. Select the Device and other category and click next twice and finish.
5. Click on the symbolof FPGAdevice and then right click>click on new source.
6. Select the Verilog Module and give the filename>click next and define ports
9. Click on the symbol of FPGA device and then right click>click on new source.
10. Select the Test Bench Waveform and give the filename>select entity click next
and finish.
11. Select the desired parameters for simulating your design.In this case combinational
circuit and simulation time click finish.
12. Assign all input signal using just click on graph and save file.
13. From the source process window. Click Behavioral simulation from drop-down
menu
14. Select the test bench file (.tbw) and click process button>double click
the Simulation Behavioral Model
15. Verify your design in wave window by seeing behavior of output signal with respect
to input signal
16. To assign package pins using corresponding CPLD manual via using constraint.
17. Assign package pins.
18. The pace file opened and give the pin details.
19. Go Implement design and generate the programming file and configure the device
(impact).
20. In configure device choose JTAG options and add the Xlinx device in boundary
scan and download the program and execute successfully.
SHIFT REGISTER:
The Shift Register is another type of sequential logic circuit that is used for the
storage or Transfer of data in the form of binary numbers and then "shifts" the data out once
every clock cycle, hence the name shift register. The data bits may be fed in or out of the register
serially. Shift Registers are used for data storage or data movement and are used in calculators or
computers to store data such as two binary numbers before they are added together, or to convert
the data from either a serial to parallel or parallel to serial format.
Generally, shift registers operate in one of four different modes
• Serial-in to Parallel-out (SIPO) - The register is loaded with serial data, one bit at a time,
with the stored data being available in parallel form.
• Serial-in to Serial-out (SISO) - The data is shifted serially "IN" and "OUT" of the register
one bit at a time in either a left or right direction under clock control.
• Parallel-in to Serial-out (PISO) - The parallel data is loaded into the register simultaneously
and is shifted out of the register serially one bit at a time under clock control.
• Parallel-in to Parallel-out (PIPO) - The parallel data is loaded simultaneously into the
register, and transferred together to their respective outputs by the same clock pulse.
LOGIC DIAGRAM:
PROGRAM:
modulesiso(q,sout,clk,sin);
inputclk, sin;
outputq,sout;
regsout=1'b0;
reg[3:0]q=0;
always@(posedgeclk)
begin
q[3]=sin;
if(sout==1'b0)
q=q>>1;
else
q=q<<1;
sout=q[0];
end
endmodule
4 BIT SERIAL IN PARALLEL OUT SHIFT (SIPO) REGISTER:
LOGIC DIAGRAM:
PROGRAM:
modulesipo(pout,q, clk,sin);
inputclk, sin;
output pout, q;
reg pout=0;
reg[3:0]q=0;
always@(posedgeclk)
begin
if(pout==1'b0)
begin
q[0]=sin;
q=q<<1;
end
else
begin
q[3]=sin;
q=q>>1;
end
pout=q;
end
endmodule
4 BIT PARALLEL IN SERIAL OUT SHIFT (PISO) REGISTER:
LOGIC DIAGRAM
PROGRAM:
modulepiso(sout,q,pin,clk);
inputpin,clk;
outputsout,q;
regsout=1'b0;
reg[3:0]q=0;
always@(posedgeclk)
begin
q=pin;
case(sout)
0:q=q<<1;
1:q=q>>1;
endcase
sout=q[0];
end
endmodule
4 BIT PARALLEL IN PARALLEL OUT SHIFT (PIPO) REGISTER:
LOGIC DIAGRAM:
PROGRAM:
modulepipo(pout, pin,clk);
input pin, clk;
output pout;
reg pout=0;
always@(posedgeclk)
begin
pout=pin;
end
endmodule
CODE – UNIVERSAL SHIFT REGISTER
Module univshift (data_out,clk,rst,mode,data_in);
Output reg[3:0]data_out;
Input[3:0]data_in;
Input[1:0]mode;
Input clk,rst;
Always @(posedge clk)
Begin
If(rst)
Data_out<=0;
Else
Begin
Case(mode)
2’b00:data_out<=data_out;
2’b01:data_out<={data_in[0],data_out[3:1]};
2’b10:data_out<={data_out[2:0],data_in[0]};
2’b00:data_out<=data_in;
Endcase
End
Endmodule
MODEL OUTPUT
SIMULATION OUTPUT
RESULT
Thus Universal Shift Register using HDL was simulated using Xilinx/Altera software and
implement by Xilinx/Altera FPGA
Ex. No: 5 Date:
AIM:
To design Finite State Machine using HDL. Simulate it using Xilinx/Altera software and
implement by Xilinx/Altera FPGA
APPARATUS REQUIRED:
S.No Nameofthe equipment/ software Quantity
1. PC with Windows 1
2. Xilinx ISE 13.4 1
3. Spartan 3E FPGA Board 1
PROCEDURE:
• Enter the Project Name and select the location then click next
• Select the Device and other category and click next twice and finish.
• Click on the symbolof FPGAdevice and then right click>click on new source.
• Select the Verilog Module and give the filename>click next and define ports
• Click on the symbol of FPGA device and then right click>click on new source.
• Select the Test Bench Waveform and give the filename>select entity click next and
finish.
• Select the desired parameters for simulating your design.In this case combinational
circuit and simulation time click finish.
• Assign all input signal using just click on graph and save file.
• From the source process window. Click Behavioral simulation from drop-down
menu
• Select the test bench file (.tbw) and click process button>double click the
Simulation Behavioral Model
• Verify your design in wave window by seeing behavior of output signal with respect to
input signal
• To assign package pins using corresponding CPLD manual via using constraint.
• Assign package pins.
• The pace file opened and give the pin details.
• Go Implement design and generate the programming file and configure the device
(impact).
• In configure device choose JTAG options and add the Xlinx device in boundary scan and
download the program and execute successfully.
CODING
module fsm( clk, rst, inp, outp);
2'b01:
begin
if( inp ) state <= 2'b11;
else state <= 2'b10;
end
2'b10:
begin
if( inp ) state <= 2'b01;
else state <= 2'b11;
end
2'b11:
begin
if( inp ) state <= 2'b01;
else state <= 2'b10;
end
endcase
end
end
always @(posedge clk, posedge rst)
begin
if( rst )
outp <= 0;
else if( state == 2'b11 )
outp <= 1;
else outp <= 0;
end
endmodule
TEST BENCH
`timescale 10ns/10ns
module fsm_test;
initial
begin
clk = 0;
rst = 1;
sequence = 16'b0101_0111_0111_0010;
#5 rst = 0;
end
task test2;
for( i = 0; i <= 15; i = i + 1)
begin
inp = $random % 2;
#2 clk = 1;
#2 clk = 0;
$display("State = ", dut.state, " Input = ", inp, ", Output = ", outp);
end
endtask
endmodule
MODEL OUTPUT
RESULT
Thus Finite State Machine using HDL was simulated using Xilinx/Altera software and
implement by Xilinx/Altera FPGA
Ex. No: 6 Date:
AIM:
To design Memories using HDL. Simulate it using Xilinx/Altera software and implement by
Xilinx/Altera FPGA
APPARATUS REQUIRED:
PROCEDURE:
3. Enter the Project Name and select the location then click next
4. Select the Device and other category and click next twice and finish.
5. Click on the symbolof FPGAdevice and then right click>click on new source.
6. Select the Verilog Module and give the filename>click next and define ports
9. Click on the symbol of FPGA device and then right click>click on new source.
10. Select the Test Bench Waveform and give the filename>select entity click next
and finish.
11. Select the desired parameters for simulating your design.In this case combinational
circuit and simulation time click finish.
12. Assign all input signal using just click on graph and save file.
13. From the source process window. Click Behavioral simulation from drop-down
menu
14. Select the test bench file (.tbw) and click process button>double click
the Simulation Behavioral Model
15. Verify your design in wave window by seeing behavior of output signal with respect
to input signal
16. To assign package pins using corresponding CPLD manual via using constraint.
17. Assign package pins.
18. The pace file opened and give the pin details.
19. Go Implement design and generate the programming file and configure the device
(impact).
20. In configure device choose JTAG options and add the Xlinx device in boundary
scan and download the program and execute successfully.
MEMORY MODULE
A memory module is another name for a RAM chip. It is often used as a general term used to
describe SIMM, DIMM, and SO-DIMM memory. While there are several different types of
memory modules available, they all serve the same purpose, which is to store temporary data
while the computer is running.
TWO BASIC MEMORY OPERATIONS:
The memory unit supports two fundamental operations: Read and Write. The read
operation read a previously stored data and the write operation stores a value in memory.
MEMORY READ AND WRITE :
The following steps have to be followed in a typical read operation:
1. Place the address of the location to be read on the address line.
integer out, i;
end
always @(*)
begin
for (i=0;i<64; i=i+1)
memory_ram_d[i] = memory_ram_q[i];
if (write_rq==1 &&read_rq==0)
memory_ram_d[rw_address] = write_data;
if (write_rq==0 &&read_rq==1)
read_data = memory_ram_d[rw_address];
end
endmodule
MODEL OUTPUT
SIMULATIONOUTPUT
CODE
Module memo(input[7:0]data,input[5:0]addr,input rst,clk,output[7:0]q);
Reg[7:0]ram[63:0];
Reg[5:0]addr_reg;
always@(posedge clk)
begin
if(rst)
ram[addr]<=data;
addr_reg<=addr;
end
assign=ram[addr];
endmodule
RESULT
Thus Memory Modules using HDL was simulated using Xilinx/Altera software and implement
by Xilinx/Altera FPGA
Ex. No: 7 Date:
AIM:
To design and Simulate a CMOS Inverter using digital flow
APPARATUS REQUIRED:
Thus the CMOS INVERTER using digitalflow was simulated and power,area timing are
analysed, pre and post layout simualtion was done
Ex. No: 8 Date:
AIM:
To design and Simulate a CMOS basic Gates and Flipflops and to analyse power ,area and timing
APPARATUS REQUIRED:
Thus the CMOS gates using digitalflow was simulated and power,area timing are analysed and
pre layout and post layout simulation was done
Ex. No: 9 Date:
AIM:
To design and Simulate A 4-Bit Synchronous Counter Using Flipflops and to Analyse Power
,Area and Timing
APPARATUS REQUIRED:
FREQUENCY VS VOLTAGE
VOLTAGE VS TIME
EYE DIAGRAM
RESULT
Thus the 4-bit synchronous counter using digital flow was simulated and power, area,timing are
analysed,pre and post layout simualtion was done
Ex. No: 10 Date:
AIM:
To design and Simulate a CMOS Inverter and to analyze the input impedance, output impedance,
gain and bandwidth
APPARATUS REQUIRED:
PROCEDURE
1. Click the start menu and open tanner EDA software
2. Create a new directory and give name of new design
3. Draw and complete the circuit as required in s-edit.exe
4. Go to tools and click T Spice ,the Tspice modules open
5. Go to command and click file , choose the simulate file
6. There browse the path ;Tanner EDA/modules/m12-123md
7. Click edit, go to insert command,choose analysis and click taransient give the following
Values
Maximum time setup- 10ns
Simulation-10ns
Output start time -0sec
8.close Tspice tool dialog box
9.Again values for the following bit source give the terminal value and for bit input choose
option of bitstream
10.Repeat process of insert command for transient analysis, output->transient->choose
plot type:give node name then click add and save the file
11.click RUN button and start simulation
CMOS INVERTER AMPLIFIER
CMO
OUTPUT
RESULT
Thus a CMOS Inverter was designed and simulated and a the input impedance, output
impedance, gain and bandwidth are analysed
Ex. No: 11 Date:
AIM:
To design Basic Common Source Common Gate and Common Drain Amplifiers.
and Simulate and toanalyze the input impedance, output impedance, gain and bandwidth
APPARATUS REQUIRED:
PROCEDURE
AIM:
To design simple 5 transistor differential amplifier and Simulate and to analyze the gain
bandwidth and CMRR
APPARATUS REQUIRED:
PROCEDURE