LIBRARY ieee USE ieee std_logic_1164 ALL ENTITY d_f_f is PORT set rese

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
ENTITY d_f_f is
PORT(set, reset, d, clk: IN std_logic;
q, nq: OUT std_logic);
END d_f_f;
ARCHITECTURE beh OF d_f_f IS
BEGIN
PROCESS(set, reset, clk)
BEGIN
IF (reset = '0') THEN
q <= '0';
nq <= '1';
ELSIF (set = '0') THEN
q <= '1';
nq <= '0';
ELSIF (clk'event AND clk = '1') then
q <= d;
nq <= not d;
END IF;
END PROCESS;
END beh;