VHDL code for FlipFlops
Some flip-flops also have Enable signals and asynchronous or synchronous Set and Reset signals:
-- template for asynchronous reset with clock enable:process(CLK, RESET)beginif RESET = '1' then -- or '0' if RESET is active low...Q <= '0';elsif rising_edge(CLK) thenif Enable = '1' then -- or '0' if Enable is active low...Q <= D;end if;end if;end process;-- template for synchronous reset with clock enable:process(CLK)beginif rising_edge(CLK) thenif RESET = '1' thenQ <= '0';elsif Enable = '1' then -- or '0' if Enable is active low...Q <= D;end if;end if;end process;
No comments:
Post a Comment