Professional Documents
Culture Documents
Design Specifications
Design Entry
Functional
Simulation RTL Model
(Zero Delay)
Target Device
Libraries (Vender
Synthesis
T Specific)
Gate level Gate level
E description using
S Simulation
target library cells Design Constraints
T
Area / Speed
B
E Gate level Model
N
C Timing Mapping +
H Simulation Translation Target Device
(Gate + Gate level model to Libraries (Vender
Interconnect device architecture Specific)
Delays)
Place and Route
Placing the design in Design Constraints
device while optimizing Area / Speed
it for speed and area
Programming file
generation
Libraries Bit Stream
(Simprims
and
Unisims) Download onto
FPGA/ CPLD
Prepared By:
Parag Parandkar Asst. Prof. ECE Dept., CDSE, Indore (M.P.)
parag.vlsi@gmail.com
VHDL Lab Manual Dated: 19/05/2011
Xilinx FPGAs are reprogrammable and when combined with an HDL design
flow can greatly reduce the design and verification cycle.
Prepared By:
Parag Parandkar Asst. Prof. ECE Dept., CDSE, Indore (M.P.)
parag.vlsi@gmail.com
VHDL Lab Manual Dated: 19/05/2011
VERILOG HDL/Verilog
Code Design Entry
Functional Simulation
Synthesis
Implementation
Timing Simulation
Design Entry
The first stage of Xilinx design flow is a design entry process. A design must be
specified by using either a schematic editor or HDL text-based tool.
Functional Simulation
Upon the finish of the design entry stage, the functional simulation of the design
is being performed, which is used to verify functionality of the design assuming no
delays, whatsoever. This assumes no target technology selection at this stage and hence
assumes zero delay in simulation.
Prepared By:
Parag Parandkar Asst. Prof. ECE Dept., CDSE, Indore (M.P.)
parag.vlsi@gmail.com
VHDL Lab Manual Dated: 19/05/2011
Design Synthesis
After this process, the synthesis is performed. Here for the first time in the design
flow the target technology (choice of a particular FPGA device family) is being
performed. This target technology selection will remain the same, henceforth in the
design flow, upto the final implementation stage, where finally generated Bit stream file
gets downloaded onto that FPGA.
The output of the synthesis process is creation of gate level netlist. This refers to
the EDIF implementation netlist of the FPGA design. Besides the EDIF implementation
netlist, the XNF (Xilinx netlist format) netlist can be used as well.
Although the XNF is now becoming rather obsolete. The EDIF netlist is used as
an input file to the Xilinx Implementation tool and specifies how the core will be
implemented.
The Electronic Design Interchange Format (EDIF) is a format used to exchange design
data between different CAD systems. In the world of FPGA design, it is used for
interchange of data between different EDA (Electronic Design Automation) software
tools. EDIF files are used for FPGA implementation only. They are the result of design
synthesis and can be generated from different design entry EDA tools: schematic or HDL
design tools. EDIF files are inputs to the Xilinx implementation tools during the
translation step (NGDBuild).
Design Implementation
Design Implementation includes the following steps:
i) Translate
ii) Map
iii) Place and Route
Prepared By:
Parag Parandkar Asst. Prof. ECE Dept., CDSE, Indore (M.P.)
parag.vlsi@gmail.com
VHDL Lab Manual Dated: 19/05/2011
In the Translate step, which is the first step in the implementation process, EDIF
netlist must be further converted into Native Generic Database file (NGD), by means of a
program called NGDBuild. The NGD file resulting from an NGDBuild run contains the
logical description of the design that can be mapped into a targeted Xilinx FPGA device
family. It is important to stress that NGDBuild merges all available EDIF netlists from
the working directory. This is actually the step where the black-box netlist becomes
merged with the rest of FPGA design.
In the next stage, the Map stage, the NGD file is an input into a MAP program
that maps logical design to a Xilinx FPGA. The output of the MAP program is an NCD
(Native Circuit Description) file. The NCD is a physical representation of the design
mapped to the components of internal FPGA architecture.
The mapped design is ready to be placed and routed. The PAR program does this
job. The input to PAR is a mapped (not routed) NCD file, while the output is a fully
routed NCD file.
Review reports are generated by the Implement Design process, such as the Map
Report or Place & Route Report, and change any of the following to improve your
design:
Ø Process properties
Ø Constraints
Ø Source files
Synthesis and again implementation of the design is being made until design
requirements are met.
Timing verification of the design can be made at different points in the design
flow as follows:
i) Run static timing analysis at the following points in the design flow:
Ø After Map.
Ø After Place and Route.
ii) Running Timing Simulations at the following points in the design flow:
Ø After Map (for a partial timing analysis of CLB and IOB delays).
Ø After Place and Route (for full timing analysis of block and net
delays).
Prepared By:
Parag Parandkar Asst. Prof. ECE Dept., CDSE, Indore (M.P.)
parag.vlsi@gmail.com
VHDL Lab Manual Dated: 19/05/2011
EXPERIEMENT NO. 1
Simulation using all the modeling styles and Synthesis of all the
logic gates using VHDL
AIM:
Perform Zero Delay Simulation of all the logic gates
written in behavioral, dataflow and structural modeling style in VHDL using a
Test bench. Then, Synthesize each one of them on two different EDA tools.
Block Diagram:
A And, Nand,
Or, Nor, C
Xor, Xnor
B
Truth table:
And Gate: Or Gate:
A B Y A B Y
0 0 0 0 0 0
0 1 0 0 1 1
1 0 0 1 0 1
1 1 1 1 1 1
1 1 0
Boolean Equation:
library ieee;
use ieee.std_logic_1164.all;
entity andg is
port (a,b : in std_logic;
c : out std_logic
);
end andg;
library ieee;
use ieee.std_logic_1164.all;
entity org is
port (a,b : in std_logic;
Prepared By:
Parag Parandkar Asst. Prof. ECE Dept., CDSE, Indore (M.P.)
parag.vlsi@gmail.com
VHDL Lab Manual Dated: 19/05/2011
c : out std_logic
);
end org;
entity nandg is
port (a,b : in std_logic;
c : out std_logic
);
end nandg;
Prepared By:
Parag Parandkar Asst. Prof. ECE Dept., CDSE, Indore (M.P.)
parag.vlsi@gmail.com
VHDL Lab Manual Dated: 19/05/2011
entity norg is
port (a,b : in std_logic;
c : out std_logic
);
end norg;
Prepared By:
Parag Parandkar Asst. Prof. ECE Dept., CDSE, Indore (M.P.)
parag.vlsi@gmail.com
VHDL Lab Manual Dated: 19/05/2011
library ieee;
use ieee.std_logic_1164.all;
entity xorg is
port (a,b : in std_logic;
c : out std_logic
);
end xorg;
entity Xnorg is
Prepared By:
Parag Parandkar Asst. Prof. ECE Dept., CDSE, Indore (M.P.)
parag.vlsi@gmail.com
VHDL Lab Manual Dated: 19/05/2011
begin
Prepared By:
Parag Parandkar Asst. Prof. ECE Dept., CDSE, Indore (M.P.)
parag.vlsi@gmail.com
VHDL Lab Manual Dated: 19/05/2011
Simulation Waveform:
Nand Gate:
Nor Gate:
And Gate:
Or Gate:
Xor Gate:
Xnor Gate:
EXPERIEMENT NO. 2
Simulation using all the modeling styles and Synthesis of 1-bit half
adder and 1-bit Full adder using VHDL
AIM:
Perform Zero Delay Simulation of 1-bit half adder and 1-bit Full adder written in
behavioral, dataflow and structural modeling style in VHDL using a Test bench. Then,
Synthesize each one of them on two different EDA tools.
Block Diagram:
1-bit Half Adder:
Truth table:
Half Adder:
A B Sum Carry
0 0 0 0
0 1 1 0
1 0 1 0
1 1 0 1
Prepared By:
Parag Parandkar Asst. Prof. ECE Dept., CDSE, Indore (M.P.)
parag.vlsi@gmail.com
VHDL Lab Manual Dated: 19/05/2011
Full Adder:
A B Cin Sum Cout
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
Boolean Equation:
Half Adder:
Sum = A B
Carry = A.B
Full Adder:
Sum = A B Cin
Cout = A.B + A.Cin + B.Cin
VHDL Code:
Half Adder (Using dataflow, Behavioral Modeling):
library ieee;
use ieee.std_logic_1164.all;
entity ha_1b is
port ( a, b : in std_logic;
sum, carry : out std_logic
);
end ha_1b;
Prepared By:
Parag Parandkar Asst. Prof. ECE Dept., CDSE, Indore (M.P.)
parag.vlsi@gmail.com
VHDL Lab Manual Dated: 19/05/2011
library ieee;
use ieee.std_logic_1164.all;
entity fa_1b is
port ( a, b, cin : in std_logic;
sum, cout : out std_logic
);
end fa_1b;
Prepared By:
Parag Parandkar Asst. Prof. ECE Dept., CDSE, Indore (M.P.)
parag.vlsi@gmail.com
VHDL Lab Manual Dated: 19/05/2011
begin
process (a,b)
variable v : std_logic_vector(2 downto 0);
begin
v := a & b & cin;
case v is
when "000" =>
sum <= '0';
cout <= '0';
when "001" =>
sum <= '1';
cout <= '0';
when "010" =>
sum <= '1';
cout <= '0';
when "011" =>
sum <= '0';
cout <= '1';
when "100" =>
sum <= '1';
cout <= '0';
when "101" =>
sum <= '0';
cout <= '1';
when "110" =>
sum <= '0';
cout <= '1';
when "111" =>
sum <= '1';
cout <= '1';
when others =>
sum <= 'Z';
cout <= 'Z';
end case;
end process;
end fa_1b_beh;
Prepared By:
Parag Parandkar Asst. Prof. ECE Dept., CDSE, Indore (M.P.)
parag.vlsi@gmail.com
VHDL Lab Manual Dated: 19/05/2011
begin
ha_1b_i1 : ha_1b port map ( a => a ,
b => b ,
sum => s1 ,
carry => s2
);
begin
Half Adder:
library ieee;
Prepared By:
Parag Parandkar Asst. Prof. ECE Dept., CDSE, Indore (M.P.)
parag.vlsi@gmail.com
VHDL Lab Manual Dated: 19/05/2011
use ieee.std_logic_1164.all;
end ha_1b_tst_a;
Full Adder:
library ieee;
use ieee.std_logic_1164.all;
end component;
signal a_i ,b_i, cin_i, sum_i,carry_i : std_logic;
begin
process
begin
a_i <= '0';
b_i <= '0';
cin_i <= '0';
wait for 100 ns;
a_i <= '0';
b_i <= '0';
cin_i <= '1';
wait for 100 ns;
a_i <= '0';
b_i <= '1';
cin_i <= '0';
wait for 100 ns;
a_i <= '0';
b_i <= '1';
cin_i <= '1';
wait for 100 ns;
a_i <= '1';
b_i <= '0';
cin_i <= '0';
wait for 100 ns;
a_i <= '1';
b_i <= '0';
cin_i <= '1';
wait for 100 ns;
a_i <= '1';
b_i <= '1';
cin_i <= '0';
wait for 100 ns;
a_i <= '1';
b_i <= '1';
cin_i <= '1';
wait for 100 ns;
end process;
end fa_1b_tst_a;
Prepared By:
Parag Parandkar Asst. Prof. ECE Dept., CDSE, Indore (M.P.)
parag.vlsi@gmail.com
VHDL Lab Manual Dated: 19/05/2011
Simulation Waveform:
Half Adder:
Full Adder:
Synthesis:
Half Adder:
Full Adder:
Full Adder:
Prepared By:
Parag Parandkar Asst. Prof. ECE Dept., CDSE, Indore (M.P.)
parag.vlsi@gmail.com
VHDL Lab Manual Dated: 19/05/2011
EXPERIEMENT NO. 3
Aim:
Perform Zero Delay Simulation of 2:1 Multiplexer and 4:1 Multiplexer written in
behavioral, dataflow and structural modeling style in VHDL using a Test bench. Then,
Synthesize each one of them on two different EDA tools.
Block Diagram:
2:1 Multiplexer:
A
2:1
Y
B Multiplexer
4:1 Multiplexer:
A
4:1
B Multiplexer Y
C
D
S1 S0
Prepared By:
Parag Parandkar Asst. Prof. ECE Dept., CDSE, Indore (M.P.)
parag.vlsi@gmail.com
VHDL Lab Manual Dated: 19/05/2011
Truth table:
2:1 Multiplexer:
S A B Y
0 0 0 0
0 0 1 0
0 1 0 1
0 1 1 1
1 0 0 0
1 0 1 1
1 1 0 0
1 1 1 1
4:1 Multiplexer:
A B Y
0 0 A
0 1 B
1 0 C
1 1 D
Boolean Equation:
2:1 Multiplexer:
Y = A.S’ + B.S
4:1 Multiplexer:
Y = A.S1’.S0’ + B.S1’.S0 + C.S1.S0’ + D.S1.S0
VHDL Code:
2:1 Multiplexer ( in dataflow and behavioral modeling style) :
library ieee;
use ieee.std_logic_1164.all;
entity mux21 is
port ( a,b,s : in std_logic;
y : out std_logic
);
end mux21;
begin
y <= (((not s) and a) or (s and b));
end mux21_df;
library ieee;
use ieee.std_logic_1164.all;
entity mux41 is
port ( a,b,c,d,s1,s0 : in std_logic;
y : out std_logic
);
end mux41;
y <= ((not s1) and (not s1) and a) or ((not s1) and s0 and b) or (s1 and (not s0)
and c) or (s1 and s0 and d);
end process;
end mux41_beh;
Prepared By:
Parag Parandkar Asst. Prof. ECE Dept., CDSE, Indore (M.P.)
parag.vlsi@gmail.com
VHDL Lab Manual Dated: 19/05/2011
library ieee;
use ieee.std_logic_1164.all;
entity mux21_tst is
end mux21_tst;
4: 1 Multiplexer:
library ieee;
use ieee.std_logic_1164.all;
entity mux41_tst is
end mux41_tst;
process
begin
a <= '0';
b <= '1';
c <= '1';
d <= '0';
s1 <= '0';
s0 <= '0';
wait for 100 ns;
s1 <= '0';
s0 <= '1';
wait for 100 ns;
Prepared By:
Parag Parandkar Asst. Prof. ECE Dept., CDSE, Indore (M.P.)
parag.vlsi@gmail.com
VHDL Lab Manual Dated: 19/05/2011
s1 <= '1';
s0 <= '0';
wait for 100 ns;
s1 <= '1';
s0 <= '1';
wait for 100 ns;
end process;
end mux41_tst_a;
Simulation Waveform:
Synthesis:
2 :1 Multiplexer:
EDA Tool Name: Fpga Advantage 3.1 – Leonardo spectrum
4 :1 Multiplexer:
EDA Tool Name: Fpga Advantage 3.1 – Leonardo spectrum
Prepared By:
Parag Parandkar Asst. Prof. ECE Dept., CDSE, Indore (M.P.)
parag.vlsi@gmail.com
VHDL Lab Manual Dated: 19/05/2011
EXPERIEMENT NO. 4
Aim:
Perform Zero Delay Simulation 1:4 Demultiplexer in VHDL using a Test bench. Then,
Synthesize on two different EDA tools.
Block Diagram:
1:4
A Demultiplexer Y
S
Truth Table:
Boolean Equation:
Y(3) = A.S.(1)’.S(0)’
Y(2) = B.S.(1)’.S(0)
Y(1) = C.S.(1).S(0)’
Y(0) = D.S.(1).S(0)
Prepared By:
Parag Parandkar Asst. Prof. ECE Dept., CDSE, Indore (M.P.)
parag.vlsi@gmail.com
VHDL Lab Manual Dated: 19/05/2011
VHDL Code:
library ieee;
use ieee.std_logic_1164.all;
entity demux14 is
port ( a : in std_logic;
s : in std_logic_vector(1 downto 0);
y : out std_logic_vector(3 downto 0)
);
end demux14;
architecture demux14_beh of demux14 is -- behavioral modeling using case ….. end case
begin
process(a,s)
begin
case s is
when "00" => y <= ( a & '0' & '0' & '0');
when "01" => y <= ('0' & a & '0' & '0');
when "10" => y <= ('0' & '0' & a & '0');
when "11" => y <= ('0' & '0' & '0' & a );
when others => y <= "0000";
end case;
end process;
end demux14_beh;
VHDL test bench:
library ieee;
use ieee.std_logic_1164.all;
entity demux14_tst is
end demux14_tst;
);
end component;
signal a : std_logic;
signal s : std_logic_vector(1 downto 0);
signal y : std_logic_vector(3 downto 0);
begin
demux14_tst_i : demux14 port map (a,s,y); -- positional association
process
begin
a <= '1';
s <= "00";
wait for 100 ns;
s <= "01";
wait for 100 ns;
s <= "10";
wait for 100 ns;
s <= "11";
wait for 100 ns;
end process;
end demux14_tst_a;
Simulation Waveform:
Synthesis:
Prepared By:
Parag Parandkar Asst. Prof. ECE Dept., CDSE, Indore (M.P.)
parag.vlsi@gmail.com
VHDL Lab Manual Dated: 19/05/2011
EXPERIEMENT NO. 5
Aim:
Perform Zero Delay Simulation 2:4 Decoder in VHDL using a Test bench. Then,
Synthesize on two different EDA tools.
Block Diagram:
2:4
A Decoder Y
Truth Table:
A Y
00 0001
01 0010
10 0100
11 1000
Boolean Equation:
Prepared By:
Parag Parandkar Asst. Prof. ECE Dept., CDSE, Indore (M.P.)
parag.vlsi@gmail.com
VHDL Lab Manual Dated: 19/05/2011
VHDL Code:
library ieee;
use ieee.std_logic_1164.all;
entity decod24 is
port ( a : in std_logic_vector(1 downto 0);
y : out std_logic_vector(3 downto 0)
);
end decod24;
entity decod24_tst is
end decod24_tst;
begin
process
Prepared By:
Parag Parandkar Asst. Prof. ECE Dept., CDSE, Indore (M.P.)
parag.vlsi@gmail.com
VHDL Lab Manual Dated: 19/05/2011
begin
a1 <= "00";
wait for 100 ns;
a1 <= "01";
wait for 100 ns;
a1 <= "10";
wait for 100 ns;
a1 <= "11";
wait for 100 ns;
end process;
end decod24_tst_a;
Simulation Waveform:
Synthesis:
Prepared By:
Parag Parandkar Asst. Prof. ECE Dept., CDSE, Indore (M.P.)
parag.vlsi@gmail.com
VHDL Lab Manual Dated: 19/05/2011
EXPERIEMENT NO. 6
Aim:
Perform Zero Delay Simulation 4:2 Encoder in VHDL using a Test bench. Then,
Synthesize on two different EDA tools.
Block Diagram:
A 4:2 Y
Encoder
Truth Table:
A Y
1000 00
0100 01
0010 10
0001 11
Boolean Equation:
Y(1) = A(1) + A(0)
Y(0) = A(2) + A(0)
VHDL Code:
library ieee;
use ieee.std_logic_1164.all;
entity encod42 is
port (a : in std_logic_vector(3 downto 0);
Prepared By:
Parag Parandkar Asst. Prof. ECE Dept., CDSE, Indore (M.P.)
parag.vlsi@gmail.com
VHDL Lab Manual Dated: 19/05/2011
entity encod42_tst is
end encod42_tst;
begin
process
begin
a1 <= "0001";
wait for 100 ns;
a1 <= "0010";
wait for 100 ns;
a1 <= "0100";
wait for 100 ns;
a1 <= "1000";
wait for 100 ns;
end process;
end encod42_tst_a;
Prepared By:
Parag Parandkar Asst. Prof. ECE Dept., CDSE, Indore (M.P.)
parag.vlsi@gmail.com
VHDL Lab Manual Dated: 19/05/2011
Simulation Waveform:
Synthesis:
Prepared By:
Parag Parandkar Asst. Prof. ECE Dept., CDSE, Indore (M.P.)
parag.vlsi@gmail.com
VHDL Lab Manual Dated: 19/05/2011
EXPERIEMENT NO. 7
Aim:
Perform Zero Delay Simulation 4:2 Priority Encoder in VHDL using a Test bench.
Then, Synthesize on two different EDA tools.
Block Diagram:
4:2 Y
A Priority
Encoder
Truth Table:
Prepared By:
Parag Parandkar Asst. Prof. ECE Dept., CDSE, Indore (M.P.)
parag.vlsi@gmail.com
VHDL Lab Manual Dated: 19/05/2011
1 0 1 0 1 1
1 0 1 1 1 1
1 1 0 0 1 1
1 1 0 1 1 1
1 1 1 0 1 1
1 1 1 1 1 1
Boolean Equation:
Y(1) = A(3) + A(2)
Y (0) = A(2)’.A(1) + A(3).A(2) + A(3).A(0)
VHDL Code:
library ieee;
use ieee.std_logic_1164.all;
entity pri_encod42 is
port (a : in std_logic_vector(3 downto 0);
y : out std_logic_vector(1 downto 0);
valid : out std_logic
);
end pri_encod42;
Prepared By:
Parag Parandkar Asst. Prof. ECE Dept., CDSE, Indore (M.P.)
parag.vlsi@gmail.com
VHDL Lab Manual Dated: 19/05/2011
entity pri_encod42_tst is
end pri_encod42_tst;
Simulation Waveform:
Synthesis:
Prepared By:
Parag Parandkar Asst. Prof. ECE Dept., CDSE, Indore (M.P.)
parag.vlsi@gmail.com
VHDL Lab Manual Dated: 19/05/2011
EXPERIEMENT NO. 8
Aim:
Perform Zero Delay Simulation of magnitude comparator 1-bit in VHDL using a Test
bench. Then, Synthesize on two different EDA tools.
Block Diagram:
AgtB
A Magnitude
B Comparator AltB
1-bit AeqB
Truth Table:
Boolean Equation:
AgtB = A.B’
AltB = A’.B
AeqB = A’.B’ + A.B
VHDL Code:
library ieee;
use ieee.std_logic_1164.all;
Prepared By:
Parag Parandkar Asst. Prof. ECE Dept., CDSE, Indore (M.P.)
parag.vlsi@gmail.com
VHDL Lab Manual Dated: 19/05/2011
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;
entity magcomp1 is
port (a,b : in std_logic;
agtb, aeqb, altb : out boolean
);
end magcomp1;
entity magcomp1_tst is
end magcomp1_tst;
Synthesis:
Prepared By:
Parag Parandkar Asst. Prof. ECE Dept., CDSE, Indore (M.P.)
parag.vlsi@gmail.com
VHDL Lab Manual Dated: 19/05/2011
EXPERIEMENT NO. 9
Aim:
Perform Zero Delay Simulation of d latch and d flip flop in VHDL using a Test bench.
Then, Synthesize on two different EDA tools.
VHDL Code:
D-latch:
library ieee;
use ieee.std_logic_1164.all;
entity dlatch is
port (d,en,reset : in std_logic;
q : out std_logic
);
end dlatch;
Prepared By:
Parag Parandkar Asst. Prof. ECE Dept., CDSE, Indore (M.P.)
parag.vlsi@gmail.com
VHDL Lab Manual Dated: 19/05/2011
begin
process(d,en,reset)
variable s : std_logic;
begin
if (reset = ‘1’) then
s :=’0’;
elsif (en = ‘1’) then
s := d;
else
s := s;
end if;
q <= s;
end process;
end dlatch_beh1;
library ieee;
use ieee.std_logic_1164.all;
entity dff is
port (d,clk,reset : in std_logic;
q : out std_logic
);
end dff;
end if;
end process;
end dff_asyncrst_a;
entity dlatch_tst is
end dlatch_tst;
process
begin
reset <= '1';
en <= '0';
d <= '0';
wait for 200 ns;
reset <= '0';
en <= '1';
d <= '1';
Prepared By:
Parag Parandkar Asst. Prof. ECE Dept., CDSE, Indore (M.P.)
parag.vlsi@gmail.com
VHDL Lab Manual Dated: 19/05/2011
library ieee;
use ieee.std_logic_1164.all;
entity dff_tst is
end dff_tst;
begin
dff_i : dff port map ( d,clk,reset,q);
process
begin
reset <= ‘1’;
d <= ‘0’;
wait for 200 ns;
reset <= ‘0’;
d <= ‘1’;
wait for 100 ns;
d <= ‘0’;
Prepared By:
Parag Parandkar Asst. Prof. ECE Dept., CDSE, Indore (M.P.)
parag.vlsi@gmail.com
VHDL Lab Manual Dated: 19/05/2011
Simulation Waveform:
Synthesis:
Prepared By:
Parag Parandkar Asst. Prof. ECE Dept., CDSE, Indore (M.P.)
parag.vlsi@gmail.com
VHDL Lab Manual Dated: 19/05/2011
EXPERIEMENT NO. 10
Aim:
Perform Zero Delay Simulation of JK, T, Flip flop in VHDL using a Test bench. Then,
Synthesize on two different EDA tools.
VHDL Code:
JK-flip flop:
library ieee;
use ieee.std_logic_1164.all;
entity JKff is
port (j,k,clk,reset : in std_logic;
q : out std_logic
);
end JKff;
Prepared By:
Parag Parandkar Asst. Prof. ECE Dept., CDSE, Indore (M.P.)
parag.vlsi@gmail.com
VHDL Lab Manual Dated: 19/05/2011
end if;
end if;
end process;
end JKff_beh;
T-flip flop:
library ieee;
use ieee.std_logic_1164.all;
entity tff is
port (t,clk,reset : in std_logic;
q : out std_logic
);
end tff;
library ieee;
use ieee.std_logic_1164.all;
entity JKff_tst is
end JKff_tst;
process
begin
reset <= '1';
j <= '0';
k <= '0';
wait for 200 ns;
reset <= '0';
j <= '0';
k <= '1';
wait for 100 ns;
j <= '1';
k <= '0';
wait for 100 ns;
j <= '1';
k <= '1';
wait for 100 ns;
end process;
end jkff_tst_a;
library ieee;
use ieee.std_logic_1164.all;
entity tff_tst is
end tff_tst;
begin
process
begin
reset <= '1';
t <= '0';
wait for 200 ns;
reset <= '0';
t <= '1';
wait for 100 ns;
t <= '0';
wait for 100 ns;
t <= '1';
wait for 100 ns;
t <= '0';
end process;
end tff_tst_a;
Simulation Waveform:
Synthesis:
Prepared By:
Parag Parandkar Asst. Prof. ECE Dept., CDSE, Indore (M.P.)
parag.vlsi@gmail.com