Last modified on 8 September 2010, at 17:34

VHDL for FPGA Design/T Flip Flop

Synchronous Positive edge T Flip-Flop with Reset and Clock enableEdit

library IEEE;
entity T_FF_VHDL is
   port( T: in  std_logic;
         Reset: in std_logic;
         Clock_enable: in std_logic;
         Clock: in std_logic;
         Output: out std_logic);
end T_FF_VHDL;
architecture Behavioral of T_FF_VHDL is
   signal temp: std_logic;
   process (Clock) 
      if Clock'event and Clock='1' then 		
         if Reset='1' then   
            temp <= '0';
         elsif Clock_enable ='1' then
 	    if T='0' then
 	       temp <= temp;
 	    elsif T='1' then
 	       temp <= not (temp);
 	    end if;
         end if;
      end if;
   end process;
   Output <= temp;
end Behavioral;

Simulation ResultsEdit

 TFF Final.png

Generated SymbolEdit

 File:T FF SCH F.png