-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFlipFlop.vhd
50 lines (45 loc) · 1.03 KB
/
FlipFlop.vhd
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.ALL;
ENTITY flip_flop IS
PORT (
reset : IN STD_LOGIC;
clock : IN STD_LOGIC;
s : IN STD_LOGIC; -- input
r : IN STD_LOGIC; -- input
q : OUT STD_LOGIC; -- output
q_n : OUT STD_LOGIC -- output
);
END flip_flop;
ARCHITECTURE Behavioral OF flip_flop IS
COMPONENT nor_p IS
PORT(
reset :IN STD_LOGIC;
clock : IN STD_LOGIC;
a : IN STD_LOGIC;
b : IN STD_LOGIC;
c : OUT STD_LOGIC;
d : OUT STD_LOGIC
);
END COMPONENT;
SIGNAL out_nor_1 : STD_LOGIC;
SIGNAL out_nor_2 : STD_LOGIC;
BEGIN
nor_1 : nor_p
PORT MAP(
reset => reset,
clock => clock,
a => s,
b => out_nor_2,
c => q_n,
d => out_nor_1
);
nor_2 : nor_p
PORT MAP(
reset => reset,
clock => clock,
a => r,
b => out_nor_1,
c => q,
d => out_nor_2
);
END Behavioral;