You are on page 1of 4

EXP.

9
Title: Design and verify truth table of D Flip Flop using data flow
modeling.

CODE:
entity dff is
Port ( d : in STD_LOGIC;
clk : in STD_LOGIC;
q : out STD_LOGIC;
qb : out STD_LOGIC;
rst : in STD_LOGIC);
end dff;

architecture Behavioral of dff is


begin
process(d.clk.rst)
begin
if(rst ='1') then
q<='0';
elseif(risng_edge(clk))then
q<=d;
qb<=not d;
endif;
end process;
end Behavioral;
Block Diagram:

Output:
EXP.10
Title: Design and verify truth table of T Flip Flop using data flow
modeling.

CODE:
entity tff is
Port ( t : in STD_LOGIC;
clk : in STD_LOGIC;
q : out STD_LOGIC;
qb : out STD_LOGIC;
rst : in STD_LOGIC);
end dff;

architecture Behavioral of tff is


begin
process(t.clk.rst)
begin
if(rst ='1') then
q<='0';
elseif(risng_edge(clk))then
q<=t;
qb<=not t;
endif;
end process;
end Behavioral;

Block Diagram:

Output:

You might also like