VHDL for FPGA Design/T Flip Flop

From Wikibooks, open books for an open world
< VHDL for FPGA Design
Jump to: navigation, search

Synchronous Positive edge T Flip-Flop with Reset and Clock enable[edit]

library IEEE;

entity t_trigger is
   port (T,Reset,CLK,CLK_enable: in std_logic;
	 Q: out std_logic);
end t_trigger;
architecture beh_t_trigger of t_trigger is	 
	signal temp: std_logic;
   process (Reset,CLK) 
	   if Reset='1' then   
		  temp <= '0'; 
	      elsif (rising_edge(CLK)) then 		
	         if CLK_enable ='1' then
	 	    temp <= T xor temp;
		 end if;
           end if; 
   end process;
   Q <= temp;	   
end beh_t_trigger;

Simulation Results[edit]

 TFF Final.png

Generated Symbol[edit]

 File:T FF SCH F.png