EC 8661 Vlsi Manual
EC 8661 Vlsi Manual
TECHNOLOGY
ENGINEERING
LAB MANUAL
REGULATION 2017
EX. NO DATE NAME OF THE EXPERIMENT MARK SIGNATURE
10
11
12
EC8661 VLSI DESIGN LABORATORY LTPC 0032
Specifications:
Algorithm
STEP 1: Open ModelSim XE II / Starter 5.7C
STEP 10: Select values -> Edit -> Force -> input values
STEP 11: Add -> Wave -> Selected signals -> Run
1 1 1
1 1 1
In this gate the output is A Output Q
opposite to the input
NOT state, Mathematically, 0 1
Q=A 1 0
1 1 0
The output is active high A B Output Q
only if any one of the
NAND input is in active low 0 0 1
state, Mathematically,
0 1 1
Q = (A.B)'
1 0 1
1 1 0
The output is active high A B Output Q 7486
only if any one of the
XOR input is in active high 0 0 0
state, Mathematically,
0 1 1
Q = A.B' + B.A'
1 0 1
1 1 0
3. A basic 2-input logic circuit has a HIGH on one input and a LOW on the other input, and the output
is HIGH. What type of logic circuit is it?
4. A logic circuit requires HIGH on all its inputs to make the output HIGH. What type of logic circuit
is it?
5. Develop the truth table for a 3-input AND gate and also determine the total number of possible
combinations for a 4-input AND gate.
VERILOG Program
a) AND Gate
z=x&y;
endmodule
b) NAND Gate
z=!(x&y);
endmodule
c) OR Gate
z=x|y;
endmodule
d) NOR Gate
z=!(x|y);
endmodule
e) XOR Gate
z=x^y;
endmodule
f) XNOR Gate
z=!(x^y);
endmodule
g) NOT Gate
z=!x;
endmodule
Out put waveforms
AND Gate:
OR Gate:
NOT Gate:
NOR Gate:
NAND Gate:
XOR Gate:
RESULT
2.1 Introduction
The purpose of this experiment is to introduce the design of simple combinational circuits, in this case half
adders, half subtractors, full adders and full subtractors.
Specifications:
Algorithm
STEP 10: Select values -> Edit -> Force -> input values
STEP 11: Add -> Wave -> Selected signals -> Run
Full adder
Halfsubtractor
Full subtractor
2. Write the sum and carry expression for half and full adder.
3. Write the difference and borrow expression for half and full subtractor.
VERILOG Program
HALF ADDER:
carry=a&b;
endmodule
FULL ADDER:
endmodule
HALF SUBTRACTOR:
borrow=(~a&b);
endmodule
FULL SUBTRACTOR:
and(z,~x,c);
or(borrow,y,z);
endmodule
Output waveforms:
Half Adder:
Half subtractor:
Full adder Dataflow modeling:
RESULT
Thus the Half-adder, Full adder, Four bit adder were implemented using Xilinx.
EXP: Design of Ripple carry,Carry select and Carry save Adders
3.1 Introduction
The purpose of this experiment is to introduce the design of Ripple carry,Carry select and Carry save Adders
Specifications:
Algorithm
STEP 10: Select values -> Edit -> Force -> input values
STEP 11: Add -> Wave -> Selected signals -> Run
VHDL Program
--Outputs
signal S : std_logic_vector(3 downto 0);
signal Cout : std_logic;
BEGIN
-- Stimulus process
stim_proc: process
begin
-- hold reset state for 100 ns.
wait for 100 ns;
A <= "0110";
B <= "1100";
wait;
end process;
END;
Output Waveform
3.4 Carry select adder
Logic diagram
Verilog program
--Outputs
signal SUM : std_logic_vector(3
downto 0);
signal CARRY_OUT : std_logic;
BEGIN
-- Instantiate the Unit Under
Test (UUT)
uut: carry_select_adder PORT MAP
(
X => X,
Y => Y,
CARRY_IN => CARRY_IN,
SUM => SUM,
CARRY_OUT => CARRY_OUT
);
-- Stimulus process
stim_proc: process
begin
-- hold reset state for 100 ns.
wait for 100 ns;
X <= "1011";
Y <= "1111";
END;
VHDL Program
Structural code for CSA Test bench for CSA
ENTITY Tb_carry_save IS
entity carry_save_adder is END Tb_carry_save;
wait;
end process;
END;
Output waveform
RESULT
Thus the Ripple carry,Carry select and Carry save Adders were implemented using XILINX .
EXP: Design of Multiplexers and Demultiplexers
4.1 Introduction
The purpose of this experiment is to write and simulate a VERILOG program for Multiplexers
and Demultiplexers.
Specifications:
Algorithm
STEP 10: Select values -> Edit -> Force -> input values
STEP 11: Add -> Wave -> Selected signals -> Run
Function Table
Logic Diagram
2:1 Multiplexer
4:1 Multiplexer
endmodule
4:1 MUX
8:1 Multiplexer
VERILOG Program
8:1 MUX
endmodule endmodule
Logic Diagram
1:4 Demultiplexer
1:8 Demultiplexer
VERILOG Program
1:4 DEMUX
end
endmodule
1:8 DEMUX
3'd4:y[4]=i;
3'd5:y[5]=i;
3'd6:y[6]=i;
default:y[7]=i;
endcase
end
endmodule
Output Wave forms:
2 X 1 MUX:
VHDL Program
TEST BENCH
module multipliert_b;
reg [4:0] a;
reg [4:0] b;
wire [9:0] out;
multipliermod uut (.a(a),.b(b),.out(out) );
initial begin
#10 a=4’b1000;b=4’b0010;
#10 a=4’b0010;b=4’b0010;
#10 a=4’b0100;b=4’b0100;
#10 a=4’b1000;b=4’b0001;
#10$stop;
end
endmodule
Output waveform
RESULT
Thus the multiplexers, demultiplexers and 8 bit Multiplier were simulated using
Xilinx.
EXP 5: Design of Flip Flops
5.1 Introduction
The purpose of this experiment is to introduce you to the basics of flip-flops. In this lab, you will test
the behavior of several flip-flops and you will connect several logic gates together to create simple
sequential circuits.
Specifications:
Algorithm
STEP 10: Select values -> Edit -> Force -> input values
STEP 11: Add -> Wave -> Selected signals -> Run
51
5.3 Flip-Flops Logic diagram and their properties
Flip-flops are synchronous bitable devices. The term synchronous means the output changes state
only when the clock input is triggered. That is, changes in the output occur in synchronization with the
clock.
A flip-flop circuit has two outputs, one for the normal value and one for the complement value of the stored
bit. Since memory elements in sequential circuits are usually flip-flops, it is worth summarizing the behavior
of various flip-flop types before proceeding further.
All flip-flops can be divided into four basic types: SR, JK, D and T. They differ in the number of
inputs and in the response invoked by different value of input signals. The four types of flip-flops are
defined in the Table 5.1. Each of these flip-flops can be uniquely described by its graphical symbol,
its characteristic table, its characteristic equation or excitation table. All flip-flops have output signals Q and
Q'.
Flip-
Flip-Flop Characteristic
Flop Characteristic Table Excitation Table
Symbol Equation
Name
S R Q(next)
Q Q(next) S R
0 0 Q Q(next) = S + R'Q 0 0 0 X
SR 0 1 0 0 1 1 0
SR = 0 1 0 0 1
1 0 1
1 1 X0
1 1 ?
J K Q(next) Q Q(next) J K
0 0 Q 0 0 0 X
JK 0 1 0 Q(next) = JQ' + K'Q 0 1 1 X
1 0 1 1 0 X1 1
1 Q' 1 1 X0
Q Q(next) D
D Q(next) 0 0 0
D 0 0 Q(next) = D 0 1 1
1 1 1 0 0
1 1 1
Q Q(next) T
T Q(next) 0 0 0
T 0 Q Q(next) = TQ' + T'Q 0 1 1
1 Q' 1 0 1
1 1 0
JK Flip Flop
T Flip Flop
T Flip Flop
53
5. 4 Pre-lab Questions
1. Describe the main difference between a gated S-R latch and an edge-triggered S-R flip-flop.
6. How many flip flops due you require storing the data 1101?
Verilog prohram
T Flip Flop
D flip flop
Behavioral Modelling Structural Modelling Dataflow Modelling
module dff_df(d,c,q,q1);
Module dff_async_reset( data, clk, module dff_df(d,c,q,q1);
input d,c;
reset ,q ); input d,c;
output q,q1;
input data, clk, reset ; output q,q1;
and g1(w1,d,c);
output q; assign w1=d&c;
and g2(w2,~d,c);
reg q; assign w2=~d&c;
nor g3(q,w1,q1);
always @ ( posedgeclk or negedge q=~(w1|q1);
nor g4(q1,w2,q);
reset) q1=~(w2|q);
endmodule
if (~reset) begin endmodule
q <= 1'b0;
end
else begin
q <= data;
end
JK flip flop
Behavioral Modelling Structural Modelling Dataflow Modelling
Output Waveforms
D flip flop
T flip flop
RESULT
Thus the VHDL code for flip-flop was implemented and simulated using Xilinx.
EXP : Design of Counters
6.1 Introduction
The purpose of this experiment is to introduce the design of Synchronous Counters, asynchronous,ring,johnson up/down
Counter.
Specifications:
Algorithm
STEP 10: Select values -> Edit -> Force -> input values
STEP 11: Add -> Wave -> Selected signals -> Run
Updown Counter
Verilog program
Up down counter
Verilog code
moduleupdown(out,clk,reset,updown);
output [3:0]out;
inputclk,reset,updown;
reg [3:0]out;
always @(posedgeclk)
if(reset) begin
out<= 4'b0;
end else if(updown) begin
out<=out+1;
end else begin
out<=out-1;
end
endmodule
Asynchronous counter & Synchronous Counters
Output Waveform
Ring counter & Johnson counter
Logic diagram
Ring counter
Johnson counter
VHDL program
end Behavioral;
Output waveform
Ring counter
Johnson counter
RESULT
Thus the Counter VHDL code were implemented and simulated by using Xilinx project navigator
EXP: Design of State machines
1.1 Introduction
The purpose of this experiment is to simulate the behavior of Moore and Mealy model
Specifications:
Algorithm
STEP 10: Select values -> Edit -> Force -> input values
STEP 11: Add -> Wave -> Selected signals -> Run
Moore model
Program
end behavioral;
Output waveform
Mealy model
Moore model
RESULT
Thus the Moore and Mealy state machines code were implemented and simulated by using Xilinx
project navigator
EXP: Design of CMOS inverter
8.1 Introduction
To perform the functional verification of the CMOS Inverter through schematic entry
Algorithm
Thus the functional verification of the CMOS Inverter through schematic [Link] the
output also verified successfully.
EXP: Design of Differential Amplifier
8.1 Introduction
To calculate the gain, bandwidth and CMRR of a differential amplifier through schematic entry.
Algorithm
STEP 1: Draw the schematic of differential amplifier using S-edit and generate the symbol.
STEP 2: Draw the schematic of differential amplifier circuit using the generated symbol.
Aim:
Description:
Diagram:
Result:
EXP: DESIGN OF ALU
Aim:
To Design an ALU and simulate using Xilinx.
PROGRAM:
module alu(
input [7:0] A,B, // ALU 8-bit Inputs
input [3:0] ALU_Sel,// ALU Selection
output [7:0] ALU_Out, // ALU 8-bit Output
output CarryOut // Carry Out Flag
);
reg [7:0] ALU_Result;
wire [8:0] tmp;
assign ALU_Out = ALU_Result; // ALU out
assign tmp = {1'b0,A} + {1'b0,B};
assign CarryOut = tmp[8]; // Carryout flag
always @(*)
begin
case(ALU_Sel)
4'b0000: // Addition
ALU_Result = A + B ;
4'b0001: // Subtraction
ALU_Result = A - B ;
4'b0010: // Multiplication
ALU_Result = A * B;
4'b0011: // Division
ALU_Result = A/B;
4'b0100: // Logical shift left
ALU_Result = A<<1;
4'b0101: // Logical shift right
ALU_Result = A>>1;
4'b0110: // Rotate left
ALU_Result = {A[6:0],A[7]};
4'b0111: // Rotate right
ALU_Result = {A[0],A[7:1]};
4'b1000: // Logical and
ALU_Result = A & B;
4'b1001: // Logical or
ALU_Result = A | B;
4'b1010: // Logical xor
ALU_Result = A ^ B;
4'b1011: // Logical nor
ALU_Result = ~(A | B);
4'b1100: // Logical nand
ALU_Result = ~(A & B);
4'b1101: // Logical xnor
ALU_Result = ~(A ^ B);
4'b1110: // Greater comparison
ALU_Result = (A>B)?8'd1:8'd0 ;
4'b1111: // Equal comparison
ALU_Result = (A==B)?8'd1:8'd0 ;
default: ALU_Result = A + B ;
endcase
end
endmodule
RESULT:
EXP: DESIGN OF UNIVERSAL SHIFT REGISTER
Aim:
To Design a universal shift register and simulate using
Xilinx.
DESCRIPTION:
PROGRAM:
RESULT:
EXP: DESIGN OF MEMORY
Aim:
To Design a memory and simulate using Xilinx.
DESCRIPTION:
PROGRAM:
RESULT:
EXP: DESIGN OF CMOS INVERTING AMPLIFIER
Aim:
To Design and simulate a CMOS inverting amplifier.
DESCRIPTION:
RESULT:
EXP: DESIGN OF COMMON SOURCE, COMMON GATE AND COMMON
DRAIN AMPLIFIER
Aim:
To Design and simulate a CS,CG and CD amplifier.
DESCRIPTION:
RESULT: