-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest-latch-sre-nand.vhd
94 lines (76 loc) · 1.43 KB
/
test-latch-sre-nand.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
library ieee;
use ieee.std_logic_1164.all;
entity test_latch_sre_nand is
end entity;
architecture behavior of test_latch_sre_nand is
component latch_sre_nand is
port (
S : in std_logic;
R : in std_logic;
E : in std_logic;
PS : in std_logic;
PR : in std_logic;
Q : inout std_logic;
NQ : inout std_logic
);
end component;
signal S : std_logic := '0';
signal R : std_logic := '0';
signal E : std_logic := '0';
signal PS : std_logic := '0';
signal PR : std_logic := '0';
signal Q : std_logic;
signal NQ : std_logic;
begin
latch_0: latch_sre_nand port map (S => S, R => R, E => E, PS => PS, PR => PR, Q => Q, NQ => NQ);
process
begin
wait for 10 ms;
PS <= '1';
wait for 1 ms;
assert Q = '1';
PS <= '0';
wait for 10 ms;
assert Q = '1';
PR <= '1';
wait for 1 ms;
assert Q = '0';
PR <= '0';
wait for 10 ms;
assert Q = '0';
S <= '1';
wait for 1 ms;
assert Q = '0';
S <= '0';
wait for 10 ms;
assert Q = '0';
E <= '1';
wait for 10 ms;
assert Q = '0';
S <= '1';
wait for 1 ms;
assert Q = '1';
S <= '0';
wait for 10 ms;
assert Q = '1';
E <= '0';
wait for 10 ms;
assert Q = '1';
R <= '1';
wait for 1 ms;
assert Q = '1';
R <= '0';
wait for 10 ms;
assert Q = '1';
E <= '1';
wait for 10 ms;
assert Q = '1';
R <= '1';
wait for 1 ms;
assert Q = '0';
R <= '0';
wait for 10 ms;
assert Q = '0';
E <= '0';
end process;
end architecture;