跳转到内容

FPGA 设计 VHDL/T 触发器

来自维基教科书,开放的书籍,为开放的世界

带复位和时钟使能的同步正边沿 T 触发器

[编辑 | 编辑源代码]
 
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;

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	 

begin
    process (Reset,CLK) 
    variable  temp: std_logic;
    begin
        if (rising_edge(CLK)) then    --sometimes you need to include a package for rising_edge, you can use CLK'EVENT AND CLK = '1' instead
            if Reset='1' then   
                temp := '0';  		
            elsif CLK_enable ='1' then
                temp := T xor temp;
            end if;
        end if; 
    Q <= temp;	   
    end process;
end beh_t_trigger;

仿真结果

[编辑 | 编辑源代码]
 

生成的符号

[编辑 | 编辑源代码]
 File:T FF SCH F.png
华夏公益教科书