EC3561 VLSI Lab Observation - With Pre Post Lab
EC3561 VLSI Lab Observation - With Pre Post Lab
LAB OBSERVATION
Page
S. No. Date Name of the Experiment Mark Signature
No.
STUDY OF SIMULATION AND
IMPLEMENTATION OF XILINX TOOL
AIM:
To study the simulation and implementation procedures of Xilinx tool and FPGA
STEP1:
STEP2:
File ->New project and type the project name and check the top level source type as HDL
STEP5:
STEP6:
STEP8: Select user constraints-> assign package pins, set port numbers and save it then
select IO Bus delimiter as XST default<>->click ok
STEP9:
Result:
Thus the simulation and implementation procedure of Xilinx and FPGA has been studied.
Ex. No. 1 Prelab Questions Date:
1. What is Verilog HDL?
2. Differentiate simulation and synthesis.
3. What is Intrinsic and Extrinsic Semiconductor?
4. What are the advantages of IC over discrete component circuits?
5. What are four generations of Integration Circuits?
6. What is combinational circuit? Give two examples.
7. What is sequential circuit? Give two examples.
8. What is Flip flop?
9. Differentiate combinational and sequential circuits.
10. What is Multiplexer?
Exp. No.: 1
DESIGN OF COMBINATIONAL AND
Date: SEQUENTIAL CIRCUITS
AIM:
To design, simulate and implement basic combinational and sequential circuits using Verilog
HDL
APPARATUS REQUIRED:
THEORY:
HALF ADDER:
The half adder consists of two input variables designated as Augends and Addend bits. Output
variables produce the Sum and Carry. The ‘carry’ output is 1 only when both inputs are 1 and
‘sum’ is 1 if any one input is 1. The Boolean expression is given by,
FULL ADDER:
A Full adder is a combinational circuit that focuses the arithmetic sum of three bits. It consists
of 3 inputs and 2 outputs. The third input is the carry from the previous Lower Significant
Position. The two outputs are designated as Sum (S) and Carry (C). The binary variable S
gives the value of the LSB of the Sum. The output S=1 only if odd number of 1’s are present
in the input and the output C=1 if two or three inputs are 1.
sum = x ^ y ^ z
In electronics, a subtractor can be designed using the same approach as that of an adder. The
binary subtraction process is summarized below. As with an adder, in the general case of
calculations on multi-bit numbers, three bits are involved in performing the subtraction for
each bit of the difference: the minuend (X_{i}), subtrahend (Y_{i}), and a borrow in from the
previous (less significant) bit order position (B_{i}). The outputs are the difference bit
(D_{i}) and borrow bit B_{i+1}. The subtractor is best understood by considering that the
subtrahend and both borrow bits have negative weights, whereas the X and D bits are
positive.
ALGORITHM:
New project and type the project name and check the top level source type as HDL
Enter the device properties and click Next
Click New Source and Select the Verilog Module and then give the file name
Give the Input and Output port names and click finish.
Type the Verilog program and save it
Double click the synthesize XST and check syntax
Simulate the waveform by behavioral simulation
For implementation Select User constraints and give input and output port pin number
Click Implement design for Translate, map and place & route
Generate .bit file using programming file
Implement in FPGA through parallel-JTAG cable
Check the behavior of design in FPGA by giving inputs
Half Adder:
Program:
Truth table:
Half Adder
0 0 0 0
0 1 0 1
1 0 0 1
1 1 1 0
Full Adder:
Program:
Truth Table:
a b c carry Sum
- -
0 0 0 0 0
0 0 1 0 1
0 1 0 0 1
0 1 1 1 0
1 0 0 0 1
1 0 1 1 0
1 1 0 1 0
1 1 1 1 1
----- -
HALF SUBTRACTOR:
Program:
Truth Table:
- -
Input1 Input2 Borrow Difference
-
0 0 0 0
0 1 1 1
1 0 0 1
1 1 0 0
FULL SUBTRACTOR:
Program:
Truth Table:
A B Cin D Bout
0 0 0 0 0
0 0 1 1 1
0 1 0 1 1
0 1 1 0 1
1 0 0 1 0
1 0 1 0 0
1 1 0 0 0
D-FLIPFLOP:
PROGRAM:
Truth Table:
D FLIP FLOP
-
Clock Reset Input (d) Output q(~q)
0 0 0 0(1)
1 0 0 0(1)
0 0 1 0(1)
1 0 1 0(1)
0 0 0 0(1)
1 0 0 0(1)
0 1 1 0(1)
1 1 1 1(0)
0 1 0 1(0)
1 1 0 0(1)
0 1 1 0(1)
1 1 1 1(0)
0 0 0 0(1)
1 0 0 0(1)
0 0 0 0(1)
T-FLIPFLOP:
PROGRAM:
TRUTH TABLE:
-
Clock Reset Input (t) Output q(~q)
0 0 0 0(1)
1 0 0 0(1)
0 0 1 0(1)
1 0 1 0(1)
0 0 0 0(1)
1 0 0 0(1)
0 1 1 0(1)
1 1 1 1(0)
0 1 0 1(0)
1 1 0 1(0)
0 1 1 1(0)
1 1 1 0(1)
0 0 0 0(1)
1 0 0 0(1)
0 0 0 0(1)
Result:
Ex. No. 1 Postlab Questions Date:
AIM:
To design and implement 8-bit adder and multiplier using Verilog HDL.
APPARATUS REQUIRED:
ALGORITHM:
New project and type the project name and check the top level source type as HDL
Enter the device properties and click Next
Click New Source and Select the Verilog Module and then give the file name
Give the Input and Output port names and click finish.
Type the Verilog program and save it
Double click the synthesize XST and check syntax
Simulate the waveform by behavioral simulation
For implementation Select User constraints and give input and output port pin number
Click Implement design for Translate, map and place & route
Generate .bit file using programming file
Implement in FPGA through parallel-JTAG cable
Check the behavior of design in FPGA by giving inputs
PROGRAM:
ADDER
module ad(a, b, sum);
input [7:0]a, b;
output [7:0]sum;
assign sum = a+b;
endmodule
Truth Table:
A B RES
- - - - - - - -
PROGRAM:
module 8bit_fulladder(a, b, cin, sum, cout);
input [7:0]a;
input [7:0]b;
input cin;
output [7:0]sum;
output cout;
wire [7:1]c;
fulladd fa0(a[0], b[0], cin, sum[0], c[1]);
fulladd fa1(a[1], b[1], c[1], sum[1], c[2]);
fulladd fa2(a[2], b[2], c[2], sum[2], c[3]);
fulladd fa3(a[3], b[3], c[3], sum[3], c[4]);
fulladd fa4(a[4], b[4], c[4], sum[4], c[5]);
fulladd fa5(a[5], b[5], c[5], sum[5], c[6]);
fulladd fa6(a[6], b[6], c[6], sum[6], c[7]);
fulladd fa7(a[7], b[7], c[7], sum[7], cout);
endmodule
TRUTH TABLE:
--------------------------------------------------------
A B RES
---------------------------------------------------------
----------------------------------------------------------
wire p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17;
HA HA1(y[2], p1,(a[2]&b[1]),(a[1]&b[2]));
HA HA2(p2, p3, (a[2]&b[2]), a[3]&b[1]);
HA HA3(p4, p5, (a[3]&b[2]), a[4]&b[1]);
FA FA1(y[3], p6, (a[1]&b[3]), p1, p2);
FA FA2(p7, p8, (a[2]&b[3]),p3, p4);
FA FA3(p9, p10, (a[4]&b[2]), (a[3]&b[3], p5);
FA FA4(y[4], p11, (a[1]&b[4]), p6, p7);
FA FA5(p12, p13, (a[2]&b[4]), p8, p9);
FA FA6(p14, p15, (a[4]&b[3]), (a[3]&b[4]), p10);
HA HA4(y[5], p16, p11, p12);
FA FA7(y[6], p17, p13, p14, p16);
FA FA8(y[7], y[8], (a[4]&b[4]), p15, p17);
endmodule
input a, b, cin;
output s, cout;
assign s = (a^b^cin);
assign cout = (a&b)|(b&cin)|(cin&a);
endmodule
Result:
Ex. No. 2 Postlab Questions Date:
1. How the carry look ahead adder differ from 4 bit parallel full adder?
2. Draw the circuit of 4bit ripple carry adder.
3. Draw the full adder circuit using half adders.
4. Multiply the number 1101 and 1001
5. What is CMOS Technology?
6. Give the advantages of CMOS IC.
7. What is the relation between addition and multiplication operation.
8. For a particular design of multiplication unit with 6 bit multiplicand and 3 bit multiplier how
many number of adders required?
9. Draw the graph showing the five different operating regions of CMOS inverter.
10. Define Threshold voltage in CMOS.
Ex. No. 3 Prelab Questions Date:
AIM:
APPARATUS REQUIRED:
ALGORITHM:
New project and type the project name and check the top level source type as HDL
Enter the device properties and click Next
Click New Source and Select the Verilog Module and then give the file name
Give the Input and Output port names and click finish.
Type the Verilog program and save it
Double click the synthesize XST and check syntax
Simulate the waveform by behavioral simulation
For implementation Select User constraints and give input and output port pin number
Click Implement design for Translate, map and place & route
Generate .bit file using programming file
Implement in FPGA through parallel-JTAG cable
Check the behavior of design in FPGA by giving inputs
THEORY
A Universal Shift Register is a register which can shift its data in both directions i.e., left and right
directions. In other Words, a universal shift register is a bidirectional shift register. It is combination of
design of bidirectional shift register and a unidirectional shift register with the parallel load provisions. It
can perform parallel to serial operation (first loading parallel input and then shifting). A universal shift
register can also perform serial to parallel operation (first shifting and then retrieving parallel output).
LOGIC DIAGRAM
PROGRAM:
if(clr)
out=4'b0000;
else
begin
case(sel)
2'b00: out=out;
2'b01: out={parin[0],parin[3:1]};
2'b10: out={parin[2:0],parin[3]};
2'b11: out=parin;
endcase
end
end
endmodule
RESULT:
Ex. No. 3 Postlab Questions Date:
AIM:
APPARATUS REQUIRED:
ALGORITHM:
New project and type the project name and check the top level source type as HDL
Enter the device properties and click Next
Click New Source and Select the Verilog Module and then give the file name
Give the Input and Output port names and click finish.
Type the Verilog program and save it
Double click the synthesize XST and check syntax
Simulate the waveform by behavioral simulation
For implementation Select User constraints and give input and output port pin number
Click Implement design for Translate, map and place & route
Generate .bit file using programming file
Implement in FPGA through parallel-JTAG cable
Check the behavior of design in FPGA by giving inputs
THEORY:
A single port RAM is a that RAM in which only one address can be accessed at a particular time.
The address can be accessed for read operation or write operation at a particular interval of time. Single
port RAM allows only one memory cell to be read or write during each clock cycle. It has one
enable(en) input and one write(we) input. If both are logic ‘1’, data is written into RAM and enable(en)
is logic ‘1’ and write (we) is logic ‘0’, then the data is read from the RAM.
PROGRAM:
RESULT:
Ex. No. 4 Postlab Questions Date:
AIM:
APPARATUS REQUIRED:
ALGORITHM:
New project and type the project name and check the top level source type as HDL
Enter the device properties and click Next
Click New Source and Select the Verilog Module and then give the file name
Give the Input and Output port names and click finish.
Type the Verilog program and save it
Double click the synthesize XST and check syntax
Simulate the waveform by behavioral simulation
For implementation Select User constraints and give input and output port pin number
Click Implement design for Translate, map and place & route
Generate .bit file using programming file
Implement in FPGA through parallel-JTAG cable
Check the behavior of design in FPGA by giving inputs
MOORE MACHINE:
PROGRAM:
module moore( clk, rst, inp, outp);
input clk, rst, inp;
output outp;
reg [1:0] state;
reg outp;
always @(posedge clk, posedge rst)
begin
if(rst)
state <= 2'b00;
else
begin
case(state)
2'b00:
begin
if(inp)
state <= 2'b01;
else
state <= 2'b10;
end
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
MEALY MACHINE: State diagram
PROGRAM:
else
begin
case(state)
2'b00:
begin
if(inp)
begin
state <= 2'b01;
outp <= 0;
end
else
begin
state <= 2'b10;outp
<= 0;
end
end
2'b01:
begin
if(inp)
begin
state <= 2'b00;
outp <= 1;
end
else
begin
state <= 2'b10;
outp <= 0;
end
end
2'b10:
begin
if(inp)
begin
state <= 2'b01;
outp <= 0;
end
else
begin
state <= 2'b00;
outp <= 1;
end
end
default:
begin
state <= 2'b00;
outp <= 0;
end
endcase
end
end
endmodule
RESULT:
Ex. No. 5 Postlab Questions Date:
1. State the difference between System Verilog and Verilog in RTL design.
2. What are the drawbacks of Ratioed circuits
3. What is Pseudo-nMOS?
4. Draw the Pseudo-nMOS 2 input NAND gate
5. What is charge sharing in dynamic CMOS logic?
6. What is foot in Dynamic circuits?
7. Define Monotonicity problem.
8. How to avoid monotonicity problem in dynamic CMOS?
9. Compare CPL and CVSL
10. Define Pass transistors.
Ex. No. 6 Prelab Questions Date:
AIM:
To implement 3-bit Synchronous up/down counter and 4-bit Asynchronous up/down counter
using Verilog HDL
APPARATUS REQUIRED:
New project and type the project name and check the top level source type as HDL
Enter the device properties and click Next
Click New Source and Select the Verilog Module and then give the file name
Give the Input and Output port names and click finish.
Type the Verilog program and save it
Double click the synthesize XST and check syntax
Simulate the waveform by behavioral simulation
For implementation Select User constraints and give input and output port pin number
Click Implement design for Translate, map and place & route
Generate .bit file using programming file
Implement in FPGA through parallel-JTAG cable
Check the behavior of design in FPGA by giving inputs
THEORY:
A 3-bit synchronous down counter is a digital circuit that counts down from a preset value
to zero using three flip-flops to represent the binary count. It operates synchronously, utilizing clock
signals and synchronous logic to ensure precise counting in a downward sequence.
In the asynchronous 4- bit up counter, the flip flops are connected in toggle mode, so when
the when the clock input is connected to first flip flop FF0, then its output after one clock pulse will
become 20. The rising edge of the Q output of each flip flop triggers the clock input of its next flip flop.
3 BIT SYNCHRONOUS UP/DOWN COUNTER
PROGRAM:
PROGRAM:
RESULT:
Ex. No. 6 Postlab Questions Date:
1. Define TSPCR.
2. What is Pipelining?
3. Write two examples for Non-bistable circuits.
4. Write any two properties of Schmitt Trigger.
5. How to avoid clock overlapping in dynamic latches?
6. Define data path. List out its components.
7. Summarize about carry propagation delay.
8. Write the equation for critical path delay of 4bit ripple carry adder.
9. Mention the effect of carry propagation delay in circuits.
10. Mention the type of adders used in multiplier circuit.
Exp. No.: 7
LAYOUT EXTRACTION AND
Date: SIMULATIONOF C-MOS BASIC GATES
AND FLIP FLOPS
AIM:
To draw the layout of CMOS basic gates (Inverter, NAND and NOR) and flip flop.
SOFTWARE USED:
Microwind
DSCH
DESCRIPTION:
CMOS INVERTER:
The NMOS transistor and the PMOS transistor form a typical complementary MOS (CMOS)
device. When a low voltage (0 V) is applied at the input, the top transistor (P-type) is
conducting (switch closed) while the bottom transistor behaves like an open circuit.
Therefore, the supply voltage (5 V) appears at the output. Conversely, when a high voltage
(5 V) is applied at the input, the bottom transistor (N-type) is conducting (switch closed)
while the top transistor behaves like an open circuit. Hence, the output voltage is low (0 V).
NAND and NOR gates are known as universal gates as any function can be
implemented with them.
Drag the components like pmos, nmos, voltage source, ground, and LED from
the symbol library.
Make verilog file go to Microwind and compile the verilog file saved in DSCH2
Compile it and obtain the layourt diagram & draw the waveform
CIRCUIT DIAGRAM:
CMOS INVERTER
Verilog code:
NAND GATE:
Verilog code:
NOR GATE:
0
12u u
Verilog code:
D FLIP FLOP:
RESULT:
Ex. No. 7 Postlab Questions Date:
AIM:
SOFTWARE USED
Microwind
DSCH
THEORY:
Differential amplifier:
Differential Amplifier amplifies the current with very little voltage gain. It consists of two
FETs connected so that the FET sources are connected together. The common source is
connected to a large voltage source through a large resistor Re, forming the "long tail" of the
name, the long tail providing an approximate constant current source. The higher the
resistance of the current source Re, the lower Ac is, and the better the CMRR. In more
sophisticated designs, a true (active) constant current source may be substituted for the long
tail. The output from a differential amplifier is itself often differential.
ALGORITHM:
Drag the components like pmos, nmos, voltage source, ground, and LED from
thesymbol library.
Make verilog file go to Microwind and compile the verilog file saved in DSCH2
Compile it and obtain the layourt diagram & draw the waveform
CIRCUIT DIAGRAM:
DIFFERENTIAL AMPLIFIER:
Verilog code:
endmodule
RESULT:
Ex. No. 8 Postlab Questions Date: