-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathlatches_ffs.vhd
71 lines (61 loc) · 1.34 KB
/
latches_ffs.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
-- brief : lab06 - question 1
library ieee;
use ieee.std_logic_1164.all;
use work.latches_ffs_pack.all;
entity latches_ffs is
port (
clock : in std_logic;
preset : in std_logic;
clear : in std_logic;
A : in std_logic;
B : in std_logic;
Q : out std_logic_vector(1 to 6)
);
end latches_ffs;
architecture structural of latches_ffs is
begin
lff1: latch_sr_nand port map (
S_n => NOT(A),
R_n => NOT(B),
Qa => Q(6), -- << CHANGE HERE OK
Qb => open
);
lff2: latch_sr_gated port map (
S => A,
R => B,
Clk => clock,
Q => Q(4), -- << CHANGE HERE OK
Q_n => open
);
lff3: latch_d_gated port map (
D => A,
Clk => clock,
Q => Q(1), -- << CHANGE HERE OK
Q_n => open
);
lff4: ff_d port map (
D => A,
Clk => clock,
Q => Q(3), -- << CHANGE HERE OK SUBIDA
Q_n => open,
Preset => preset,
Clear => clear
);
lff5: ff_jk port map (
J => A,
K => B,
Clk => clock,
Q => Q(5), -- << CHANGE HERE OK SUBIDA
Q_n => open,
Preset => preset,
Clear => clear
);
lff6: ff_t port map (
T => A,
Clk => clock,
Q => Q(2), -- << CHANGE HERE OK SUBIDA
Q_n => open,
Preset => preset,
Clear => clear
);
end structural;