shiny1
Junior Member level 1
Hi I need to pass my output through a D FF.
i.e. IF I set clk enable= 1; o/p should be equal to input but
when clk enable =0 output should be 0 .
For this am hard coding set= 0 and reset = 0. But my input pattern is changing with clock. So what should I do to get the same input pattern??!!!
i.e. IF I set clk enable= 1; o/p should be equal to input but
when clk enable =0 output should be 0 .
For this am hard coding set= 0 and reset = 0. But my input pattern is changing with clock. So what should I do to get the same input pattern??!!!
Code VHDL - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 entity DFF is port ( clk : in std_logic; clk_ena : in std_logic; data : in std_logic; reset : in std_logic; q : out std_logic ); end entity; architecture.... signal internal_state : std_logic; begin process(data, clk, clk_ena, reset) begin if(reset = '0') then if rising_edge(clk) then if(clk_ena = '1') then internal_state <= data; --latch input end if; q <= internal_state; end if; else internal_state <= '0'; end if; end process;
Last edited by a moderator: