VLSI Lab Manual With Solution
VLSI Lab Manual With Solution
Government of India
Aurangabad.
LABORATORY MANUAL
For
VLSI DESIGN
DEPM
Name: _____________________________________
Class: ________ Branch: ______ Roll No: ______
University Exam /
Seat No.
Academic year
20xx-20xx
Ministry of Electronics & Information Technology
Government of India
Aurangabad.
Department of Electronics & Telecommunication
Engineering
Roll No. ………, of VIth/VIIth Semester of Diploma in Electronics has completed the
Term-work / Practical satisfactorily in VLSI DESIGN for the academic year …….
to …… as prescribed by MSBT.
APPARATUS REQUIRED:
Basys 3 Kit
Power Cord
Interfacing cable
PC
PROCEDURE:
1) Open Xilinx Vivado 2017 software to write a program for
Basic Gate
2) Declare input and output in entity.
3) Write VHDL code for Basic Gate in architecture.
4) Save the program and check the syntax.
5) Assign the package pins for input and output which is
mentioned in entity.
6) Configuring the impact in generating programming to
download the program.
7) Write Test Bench Code for Observe the Output in software
simulation.
8) Then check the result in Basys 3 kit.
AND GATE:
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. Bear in mind that this dot is sometimes omitted i.e. AB
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.
NOT GATE:
NAND GATE:
NOR GATE:
Ex-OR GATE:
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.
Ex-NOR GATE:
The 'Exclusive-NOR' gate circuit does the opposite to the EXOR gate. It
will give a low output if either, but not both, of its two inputs are high. The
symbol is an EXOR gate with a small circle on the output. The small circle
represents inversion.
VLSI Lab Manual Page 3
PROGRAMS:
OR GATE
1) VHDL CODE
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity OrGate is
Port ( A : in STD_LOGIC;
B : in STD_LOGIC;
Y : out STD_LOGIC);
end OrGate;
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
ENTITY or1_tb IS
END or1_tb;
COMPONENT OrGate
PORT(
A : IN std_logic;
B : IN std_logic;
Y : OUT std_logic
);
END COMPONENT;
signal A : std_logic := '0';
BEGIN
uut: OrGate PORT MAP (
A => A,
B => B,
Y => Y
);
stim_proc: process
begin
wait for 100 ns;
A <= '0';
B <='0';
wait for 100 ns;
A <= '0';
B <='1';
wait for 100 ns;
A <= '1';
B <='0';
wait for 100 ns;
A <= '1';
B <='1';
wait for 100 ns;
wait;
end process;
end Behavioral;
AND GATE
1) VHDL CODE
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity AndGate is
Port ( A : in STD_LOGIC;
B : in STD_LOGIC;
Y : out STD_LOGIC);
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
ENTITY and1_tb IS
END and1_tb;
BEGIN
uut: AndGate PORT MAP (
A => A,
B => B,
Y => Y
);
stim_proc: process
begin
wait for 100 ns;
A <= '0';
B <='0';
wait for 100 ns;
A <= '0';
B <='1';
wait for 100 ns;
VLSI Lab Manual Page 6
A <= '1';
B <='0';
wait for 100 ns;
A <= '1';
B <= '1';
wait for 100 ns;
wait;
end process;
End Behavioral;
NOT GATE
1) VHDL CODE
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity NotGate is
Port ( A : in STD_LOGIC;
Y : out STD_LOGIC);
end NotGate;
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
ENTITY not1_tb IS
END not1_tb;
COMPONENT NotGate
PORT(
A : IN std_logic;
stim_proc: process
begin
wait for 100 ns;
A <= '0';
wait for 100 ns;
A <= '1';
wait for 100 ns;
wait;
end process;
end Behavioral;
NAND GATE
1) VHDL CODE
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity NandGate is
Port ( A : in STD_LOGIC;
B : in STD_LOGIC;
Y : out STD_LOGIC);
end NandGate;
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
ENTITY nand1_tb IS
END nand1_tb;
NOR GATE
1) VHDL CODE
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity NorGate is
Port ( A : in STD_LOGIC;
B : in STD_LOGIC;
Y : out STD_LOGIC);
end NorGate;
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
ENTITY nor1_tb IS
END nor1_tb;
Ex-OR GATE
1) VHDL CODE
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity XorGate is
Port ( A : in STD_LOGIC;
B : in STD_LOGIC;
Y : out STD_LOGIC);
end XorGate;
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
ENTITY xor1_tb IS
END xor1_tb;
Ex-NOR GATE
1) VHDL CODE
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity XnorGate is
Port ( A : in STD_LOGIC;
B : in STD_LOGIC;
Y : out STD_LOGIC);
end XnorGate;
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
ENTITY xnor1_tb IS
END xnor1_tb;
Observation:
1) K- map whenever required
2) Truth table whenever required
3) RTC Schematic for all
4) Technological Schematic for all
5) Test Bench output for all
6) Screen Shot for Basys 3 Kit FPGA Board
Simulation Result:
OR GATE
Vivado Testbench:
AND GATE
NOT GATE
NAND GATE
NOR GATE
Ex-OR GATE
Ex-NOR GATE
Experiment No. 2
APPARATUS REQUIRED:
Basys 3 Kit
Power Cord
Interfacing cable
PC
PROCEDURE:
1) Open Xilinx Vivado 2017 software to write a program for
Half Adder.
2) Declare input and output in entity.
3) Write VHDL code for Half Adder in architecture.
4) Save the program and check the syntax.
5) Assign the package pins for input and output which is
mentioned inentity.
6) Configuring the impact in generating programming to
download the program.
7) Write Test Bench Code for Observe the Output in software
simulation.
8) Then check the result in Basys 3 kit.
THEORY:
PROGRAM:
1) VHDL CODE
entity Half_Adder is
Port ( A : in STD_LOGIC;
B : in STD_LOGIC;
Sum : out STD_LOGIC;
Carry : out STD_LOGIC);
end Half_Adder;
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
ENTITY halfaddertb IS
END halfaddertb;
BEGIN
uut: Half_Adder PORT MAP (
A => A,
B => B,
Sum => Sum,
Carry => Carry
);
process
begin
wait for 100 ns;
A <= '0';
B <= '0';
wait for 100 ns;
A <= '0';
B <= '1';
VLSI Lab Manual Page 25
wait for 100 ns;
A <= '1';
B <= '0';
wait for 100 ns;
A <= '1';
B <= '1';
end process;
end Behavioral;
Observation:
1) K- map whenever required
2) Truth table whenever required
3) RTC Schematic for all
4) Technological Schematic for all
5) Test Bench output for all
6) Screen Shot for Basys 3 Kit FPGA Board
SIMULATION RESULT:
Experiment No.3
APPARATUS REQUIRED:
Basys 3 Kit
Power Cord
Interfacing cable
PC
PROCEDURE:
1) Open Xilinx Vivado 2017 software to write a program for
Full Adder.
2) Declare input and output in entity.
3) Write VHDL code for Full Adder in architecture.
4) Save the program and check the syntax.
5) Assign the package pins for input and output which is
mentioned inentity.
6) Configuring the impact in generating programming to
download the program.
7) Write Test Bench Code for Observe the Output in software
simulation.
8) Then check the result in Basys 3 kit.
THEORY:
Full Adder is the circuit which consists of two EX-OR gates, two
AND gates and one OR gate. Full Adder is the adder which adds
three inputs and produces two outputs which consists of two
EX-OR gates, two AND gates and one OR gate. The first two
inputs are A and B and the third input is an input carry as C-IN.
VLSI Lab Manual Page 28
The output carry is designated as C-OUT and the normal output
is designated as S which is SUM.
Logical Expression :
PROGRAMS:
1) VHDL CODE:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity Full_Adder is
Port ( A : in STD_LOGIC;
B : in STD_LOGIC;
Cin : in STD_LOGIC;
Sum : out STD_LOGIC;
Cout : out STD_LOGIC);
end Full_Adder;
ENTITY fulladdertb IS
END fulladdertb;
COMPONENT Full_Adder
PORT(
A : IN std_logic;
B : IN std_logic;
Cin : IN std_logic;
Cout : OUT std_logic;
Sum : OUT std_logic
);
END COMPONENT;
signal A : std_logic := '0';
signal B : std_logic := '0';
signal Cin : std_logic := '0';
signal Cout : std_logic;
signal Sum : std_logic;
BEGIN
uut: Full_Adder PORT MAP (
A => A,
B => B,
VLSI Lab Manual Page 31
Cin => Cin,
Cout => Cout,
Sum => Sum
);
process
begin
wait for 100 ns;
A <= '0';
B <= '0';
Cin <= '0';
wait for 100 ns;
A <= '0';
B <= '0';
Cin <= '1';
wait for 100 ns;
A <= '0';
B <= '1';
Cin <= '0';
wait for 100 ns;
A <= '0';
B <= '1';
Cin <= '1';
wait for 100 ns;
A <= '1';
B <= '0';
Cin <= '0';
wait for 100 ns;
VLSI Lab Manual Page 32
A <= '1';
B <= '0';
Cin <= '1';
wait for 100 ns;
A <= '1';
B <= '1';
Cin <= '0';
wait for 100 ns;
A <= '1';
B <= '1';
Cin <= '1';
end process;
end Behavioral;
Observation:
1) K- map whenever required
2) Truth table whenever required
3) RTC Schematic for all
4) Technological Schematic for all
5) Test Bench output for all
6) Screen Shot for Basys 3 Kit FPGA Board
SIMULATION RESULT:
Experiment No.4
APPARATUS REQUIRED:
Basys 3 Kit
Power Cord
Interfacing cable
PC
PROCEDURE:
1) Open Xilinx Vivado 2017 software to write a structural
program for Half Adder andFull Adder.
2) Declare input and output in entity.
3) Write VHDL code for Half Adder and Full Adder in
architecture.
4) Save the program and check the syntax.
5) Assign the package pins for input and output which is
mentioned inentity.
6) Configuring the impact in generating programming to
download the program.
7) Write Test Bench Code for Observe the Output in software
simulation.
8) Then check the result in Basys 3 kit.
THEORY:
HALF ADDER
The output obtained from the EX-OR gate is the sum of the two
numbers while that obtained by AND gate is the carry. There
will be no forwarding of carry addition because there is no
logic gate to process that. Thus, this is called Half Adder
circuit.
Logical Expression :
Sum = A XOR B
Carry = A AND B
FULL ADDER
VLSI Lab Manual Page 36
Full Adder is the circuit which consists of two EX-OR gates,
two AND gates and one OR gate. Full Adder is the adder which
adds three inputs and produces two outputs which consists of
two EX-OR gates, two AND gates and one OR gate. The first
two inputs are A and B and the third input is an input carry as
C-IN. The output carry is designated as C-OUT and the normal
output is designated as S which is SUM.
HALF ADDER
1) VHDL CODE
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity halfAdder is
Port ( A : in STD_LOGIC;
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity XOR1 is
port(I1, I2 : in std_logic;
O1 : out std_logic);
end XOR1;
VLSI Lab Manual Page 39
architecture Behavioral of XOR1 is
begin
O1 <= I1 XOR I2;
end Behavioral;
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity AND1 is
port (I1, I2 : in std_logic;
O1 : out std_logic);
end AND1;
architecture Behavioral of AND1 is
begin
O1 <= I1 AND I2;
end Behavioral;
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity halfAdder_testbench is
end halfAdder_testbench;
FULL ADDER
1) VHDL CODE
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity fullAdder is
Port ( A : in STD_LOGIC;
B : in STD_LOGIC;
Cin : in STD_LOGIC;
Sum : out STD_LOGIC;
Cout : out STD_LOGIC);
end fullAdder;
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity HA is
port(I1, I2 : in std_logic;
O1,O2 : out std_logic);
end HA;
architecture Behavioral of HA is
begin
O1 <= I1 XOR I2;
O2 <= I1 AND I2;
end Behavioral;
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity fullAdder_testbench is
end fullAdder_testbench;
architecture Behavioral of fullAdder_testbench is
COMPONENT fullAdder
PORT(
A : IN std_logic;
B : IN std_logic;
Cin : IN std_logic;
Cout : OUT std_logic;
Sum : OUT std_logic
VLSI Lab Manual Page 44
);
END COMPONENT;
signal A : std_logic := '0';
signal B : std_logic := '0';
signal Cin : std_logic := '0';
signal Cout : std_logic;
signal Sum : std_logic;
BEGIN
uut: fullAdder PORT MAP (
A => A,
B => B,
Cin => Cin,
Cout => Cout,
Sum => Sum
);
process
begin
wait for 100 ns;
A <= '0';
B <= '0';
Cin <= '0';
wait for 100 ns;
A <= '0';
B <= '0';
Cin <= '1';
wait for 100 ns;
A <= '0';
VLSI Lab Manual Page 45
B <= '1';
Cin <= '0';
wait for 100 ns;
A <= '0';
B <= '1';
Cin <= '1';
wait for 100 ns;
A <= '1';
B <= '0';
Cin <= '0';
wait for 100 ns;
A <= '1';
B <= '0';
Cin <= '1';
wait for 100 ns;
A <= '1';
B <= '1';
Cin <= '0';
wait for 100 ns;
A <= '1';
B <= '1';
Cin <= '1';
end process;
end Behavioral;
Observation:
1) K- map whenever required
VLSI Lab Manual Page 46
2) Truth table whenever required
3) RTC Schematic for all
4) Technological Schematic for all
5) Test Bench output for all
6) Screen Shot for Basys 3 Kit FPGA Board
SIMULATION RESULT:
HALF ADDER
VIVADO Schematic Diagram
Experiment No.5
APPARATUS REQUIRED:
Basys 3 Kit
Power Cord
Interfacing cable
PC
VLSI Lab Manual Page 49
PROCEDURE:
1) Open Xilinx Vivado 2017 software to write aprogram for
4-bit Adder.
2) Declare input and output in entity.
3) Write VHDL code for 4-bit Adder in architecture.
4) Save the program and check the syntax.
5) Assign the package pins for input and output which is
mentioned inentity.
6) Configuring the impact in generating programming to
download the program.
7) Write Test Bench Code for Observe the Output in software
simulation.
8) Then check the result in Basys 3 kit.
THEORY:
PROGRAMS:
1) VHDL CODE
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity adder_4bit is
Port ( A : in STD_LOGIC_VECTOR (3 downto 0);
B : in STD_LOGIC_VECTOR (3 downto 0);
Cin : in STD_LOGIC;
Sum : out STD_LOGIC_VECTOR (3 downto 0);
Cout : out STD_LOGIC);
end adder_4bit;
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity fa is
port( a,b,c:in std_logic;
co:out std_logic;
s:out std_logic);
end fa;
architecture Behavioral of fa is
begin
s <= a xor b xor c;
co <= (a and b) or (c and (a or b));
end Behavioral;
library IEEE;
VLSI Lab Manual Page 53
use IEEE.STD_LOGIC_1164.ALL;
entity adder_4bit_testbench is
-- Port ( );
end adder_4bit_testbench;
BEGIN
uut: adder_4bit PORT MAP (
A => A,
VLSI Lab Manual Page 54
B => B,
Cin => Cin,
Sum => Sum,
Cout => Cout
);
stim_proc: process
begin
A <= "0000"; B <= "0101"; -- 0 + 5 => 05 (0 0101)
WAIT FOR 100 ns;
A <= "0001"; B <= "0111"; -- 1 + 7 => 08 (0 1000)
WAIT FOR 100 ns;
A <= "0010"; B <= "1001"; -- 2 + 9 => 0B (0 1011)
WAIT FOR 100 ns;
A <= "0011"; B <= "1011"; -- 3 + B => 0E (0 1110)
WAIT FOR 100 ns;
A <= "0100"; B <= "1101"; -- 4 + D => 11 (1 0001)
WAIT FOR 100 ns;
A <= "0101"; B <= "1111"; -- 5 + F => 14 (1 0100)
WAIT FOR 100 ns;
A <= "0110"; B <= "0001"; -- 6 + 1 => 07 (0 0111)
WAIT FOR 100 ns;
A <= "0111"; B <= "0011"; -- 7 + 3 => 0A (0 1010)
WAIT FOR 100 ns;
A <= "1000"; B <= "0101"; -- 8 + 5 => 0D (0 1101)
WAIT FOR 100 ns;
A <= "1001"; B <= "0111"; -- 9 + 7 => 10 (1 0000)
WAIT FOR 100 ns;
VLSI Lab Manual Page 55
end process;
end Behavioral;
Observation:
1) K- map whenever required
2) Truth table whenever required
3) RTC Schematic for all
4) Technological Schematic for all
5) Test Bench output for all
6) Screen Shot for Basys 3 Kit FPGA Board
SIMULATION RESULT:
Experiment No.6
APPARATUS REQUIRED:
Basys 3 Kit
Power Cord
Interfacing cable
PC
THEORY:
4:1 Multiplexer
4:1 Multiplexer has four data inputs I3, I2, I1 & I0, two
selection lines s1 & s0 and one output Y. The block
diagram of 4:1 Multiplexer is shown in the following figure.
One of these 4 inputs will be connected to the output based on
the combination of inputs present at these two selection
lines. Truth table of 4:1 Multiplexer is shown below.
VLSI Lab Manual Page 58
From Truth table, we can directly write the Boolean
function for output, Y as
Y=S1′S0′I0+S1′S0I1+S1S0′I2+S1S0I3
We can implement this Boolean function using Inverters, AND
gates & OR gate. The circuit diagram of 4:1 multiplexer is
shown in the following figure.
4:1 MULTIPLEXER
1) VHDL CODE
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity Multiplexer4to1 is
Port ( I3 : in STD_LOGIC_VECTOR (2 downto 0);
I2 : in STD_LOGIC_VECTOR (2 downto 0);
I1 : in STD_LOGIC_VECTOR (2 downto 0);
I0 : in STD_LOGIC_VECTOR (2 downto 0);
S : in STD_LOGIC_VECTOR (1 downto 0);
Y : out STD_LOGIC_VECTOR (2 downto 0));
end Multiplexer4to1;
entity Mux_TB is
end Mux_TB;
8:1 MULTIPLEXER
1) VHDL CODE
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity multiplexer8_to_1 is
Port ( I : in STD_LOGIC_VECTOR (7 downto 0);
S : in STD_LOGIC_VECTOR (2 downto 0);
Y : out STD_LOGIC);
end multiplexer8_to_1;
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity multiplexer8_to_1testbench is
-- Port ( );
end multiplexer8_to_1testbench;
Observation:
1) K- map whenever required
2) Truth table whenever required
3) RTC Schematic for all
4)Technological Schematic for all
5) Test Bench output for all
6) Screen Shot for Basys 3 Kit FPGA Board
SIMULATION RESULT:
4:1 MULTIPLEXER
VIVADO Schematic Diagram
8:1 MULTIPLEXER
Experiment No.7
APPARATUS REQUIRED:
Basys 3 Kit
Power Cord
Interfacing cable
PC
PROCEDURE:
1) Open Xilinx Vivado 2017 software to write aprogram for 1:4
and 1:8 Demultiplexers.
2) Declare input and output in entity.
3) Write VHDL code for 1:4 and 1:8Demultiplexers in
architecture.
4) Save the program and check the syntax.
5) Assign the package pins for input and output which is
mentioned inentity.
6) Configuring the impact in generating programming to
download the program.
7) Write Test Bench Code for Observe the Output in software
simulation.
8) Then check the result in Basys 3 kit.
THEORY:
1:4 DEMULTIPLEXER
The 1:4 demultiplexer consists of one input, four outputs, and
two control lines to make selections The below diagram shows
the circuit of 1:4 demultiplexer.
If the control input changes to AB=10 all the gates are disabled
except the third AND gate from the top. Then D is transmitted
to output Y2.
1:4 DEMULTIPLEXER
1) VHDL CODE
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity demultiplexer1_4 is
Port ( D : in STD_LOGIC;
S : in STD_LOGIC_VECTOR (1 downto 0);
I : out STD_LOGIC_VECTOR (3 downto 0));
end demultiplexer1_4;
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity demultiplexer1_4testbench is
-- Port ( );
end demultiplexer1_4testbench;
1:8 DEMULTIPLEXER
1) VHDL CODE
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity demultiplexer1_8 is
Port ( D : in STD_LOGIC;
S : in STD_LOGIC_VECTOR (2 downto 0);
I : out STD_LOGIC_VECTOR (7 downto 0));
end demultiplexer1_8;
entity demultiplexer1_8testbench is
end demultiplexer1_8testbench;
Observation:
1) K- map whenever required
2) Truth table whenever required
3) RTC Schematic for all
4) Technological Schematic for all
5) Test Bench output for all
6) Screen Shot for Basys 3 Kit FPGA Board
SIMULATION RESULT:
1:4 DEMULTIPLEXER
VIVADO Schematic Diagram
Experiment No.8
APPARATUS REQUIRED:
Basys 3 Kit
Power Cord
Interfacing cable
PC
PROCEDURE:
1) Open Xilinx Vivado 2017 software to write aprogram for
4-bit ALU.
2) Declare input and output in entity.
3) Write VHDL code for 4-bit ALU in architecture.
4) Save the program and check the syntax.
5) Assign the package pins for input and output which is
mentioned inentity.
6) Configuring the impact in generating programming to
download the program.
7) Write Test Bench Code for Observe the Output in software
simulation.
8) Then check the result in Basys 3 kit.
THEORY:
PROGRAMS:
1) VHDL CODE
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity ALU4bit is
Port ( A : in STD_LOGIC_VECTOR (3 downto 0);
B : in STD_LOGIC_VECTOR (3 downto 0);
VLSI Lab Manual Page 83
S : in STD_LOGIC_VECTOR (2 downto 0);
Y : out STD_LOGIC_VECTOR (3 downto 0));
end ALU4bit;
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity ALU4bit_testbench is
-- Port ( );
end ALU4bit_testbench;
Observation:
1) K- map whenever required
SIMULATION RESULT:
Experiment No.9
APPARATUS REQUIRED:
Basys 3 Kit
Power Cord
Interfacing cable
PROCEDURE:
1) Open Xilinx Vivado 2017 software to write aprogram for Flip
Flops.
2) Declare input and output in entity.
3) Write VHDL code for Flip Flops in architecture.
4) Save the program and check the syntax.
5) Assign the package pins for input and output which is
mentioned inentity.
6) Configuring the impact in generating programming to
download the program.
7) Write Test Bench Code for Observe the Output in software
simulation.
8) Then check the result in Basys 3 kit.
THEORY:
A) SR Flip-Flop
The circuit above shows an SR flip-flop with two inputs and two
outputs. The outputs are complementary to each other. The SR
in SR flip-flop stands for Set-Reset.
Characteristics Equation
Q(next) = S + R'Q
Characteristics Equation
Q(next) = JQ' + K'Q
C) D Flip-Flop
Characteristics Equation
Q(next) = D
D) T Flip-Flop
PROGRAMS:
A) SR Flip-Flop
1) VHDL CODE
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity SR_FLIPFLOP_1 is
Port ( S : in STD_LOGIC;
R : in STD_LOGIC;
RST : in STD_LOGIC;
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity SR_FLIPFLOP_1Testbench is
end SR_FLIPFLOP_1Testbench;
B) JK Flip-Flop
1) VHDL CODE
entity JK_FLIPFLOP_1 is
Port ( J : in STD_LOGIC;
K : in STD_LOGIC;
clk : in STD_LOGIC;
rst : in STD_LOGIC;
Q : out STD_LOGIC;
Qbar : out STD_LOGIC);
end JK_FLIPFLOP_1;
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity JK_FLIPFLOP_1Testbench is
end JK_FLIPFLOP_1Testbench;
C) D Flip-Flop
1) VHDL CODE
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity D_FLIPFLOP_1Testbench is
end D_FLIPFLOP_1Testbench;
Clock : process
begin
CLK <= '0';
wait for 10 ns;
CLK <= '1';
wait for 10 ns;
end process;
stim : process
begin
RST <= '0';
D <= '0';
wait for 40 ns;
D <= '1';
wait for 40 ns;
end process;
end Behavioral;
D) T Flip-Flop
1) VHDL CODE
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity T_FLIPFLOP_1 is
Port ( T : in STD_LOGIC;
CLK : in STD_LOGIC;
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity T_FLIPFLOP_1Testbench is
end T_FLIPFLOP_1Testbench;
Observation:
1) K- map whenever required
2) Truth table whenever required
3) RTC Schematic for all
4) Technological Schematic for all
5) Test Bench output for all
6) Screen Shot for Basys 3 Kit FPGA Board
SIMULATION RESULT:
B) JK FLIP-FLOP
C) D FLIP-FLOP
D) T FLIP-FLOP