-
Notifications
You must be signed in to change notification settings - Fork 0
/
topo.vhd
62 lines (56 loc) · 1.57 KB
/
topo.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
LIBRARY ieee;
USE ieee.numeric_std.ALL;
USE ieee.std_logic_1164.ALL;
USE ieee.std_logic_unsigned.ALL;
ENTITY topo IS
PORT (
clk : IN STD_LOGIC;
reset : IN STD_LOGIC
);
END ENTITY topo;
ARCHITECTURE behavior OF topo IS
COMPONENT fsm IS
PORT (
clk : IN STD_LOGIC;
reset : IN STD_LOGIC;
flag_zero : IN STD_LOGIC;
flag_negative : IN STD_LOGIC;
decoder : IN STD_LOGIC_VECTOR(3 DOWNTO 0);
count_load : OUT STD_LOGIC;
enable_ula : OUT STD_LOGIC
);
END COMPONENT fsm;
COMPONENT neander IS
PORT (
reset : IN STD_LOGIC;
clk : IN STD_LOGIC;
count_load : IN STD_LOGIC;
en_ULA : IN STD_LOGIC;
-- saidas
Z : OUT STD_LOGIC;
N : OUT STD_LOGIC;
decoder : OUT STD_LOGIC_VECTOR(3 DOWNTO 0)
);
END COMPONENT neander;
SIGNAL count_load, enable_ula, flag_zero, flag_negative : STD_LOGIC := '0';
SIGNAL decoder : STD_LOGIC_VECTOR(3 DOWNTO 0) := "0000";
BEGIN
neander_inst : neander PORT MAP(
clk => clk,
reset => reset,
count_load => count_load,
en_ULA => enable_ula,
Z => flag_zero,
N => flag_negative,
decoder => decoder
);
fsm_inst : fsm PORT MAP(
clk => clk,
reset => reset,
flag_zero => flag_zero,
flag_negative => flag_negative,
decoder => decoder,
count_load => count_load,
enable_ula => enable_ula
);
END ARCHITECTURE behavior;