-
Notifications
You must be signed in to change notification settings - Fork 0
/
MODUL_SIMULARE.vhd
112 lines (99 loc) · 2.22 KB
/
MODUL_SIMULARE.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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
use types.all;
entity MUX_SUB is
port(A:in matrix8(15 downto 0);
S:in STD_LOGIC_VECTOR (3 downto 0);
B:out STD_LOGIC_VECTOR (7 downto 0));
end;
architecture MUX_SUB of MUX_SUB is
begin
process(S)
variable sel:integer;
begin
sel:=to_integer(unsigned(S));
B<=A(sel);
end process;
end;
library ieee;
use ieee.std_logic_1164.all;
use types.all;
entity SUBMARIN is
port(
RESET: in STD_LOGIC;
SWITCH:in BIT;
DATA_IN:in STD_LOGIC_VECTOR (3 downto 0);
ANODE : out STD_LOGIC_VECTOR (3 downto 0);
CATHODE : out STD_LOGIC_VECTOR (6 downto 0);
INTERRUPT:in BIT;
CLK:in BIT;
CLK_SWITCH:in STD_LOGIC
);
end;
architecture SUBMARIN of SUBMARIN is
component MUX_SUB
port(A:in matrix8(15 downto 0);
S:in STD_LOGIC_VECTOR (3 downto 0);
B:out STD_LOGIC_VECTOR (7 downto 0));
end component;
component AFISOR is
port ( clock_100Mhz : in BIT;
RESET : in STD_LOGIC;
DATA_IN:in STD_LOGIC_VECTOR (7 downto 0);
SWITCH:in BIT;
OUTPUT1:in integer range 0 to 255;
OUTPUT2:in integer range 0 to 255;
ANODE : out STD_LOGIC_VECTOR (3 downto 0);
CATHODE : out STD_LOGIC_VECTOR (6 downto 0)
);
end component;
component MICROCONTROLLER_BLACK_BOX is
port(
RESET: in STD_LOGIC;
REG_MATRIX: out matrix8(15 downto 0);
CLK :in STD_LOGIC;
INTER:in BIT;
OUTPUT1:out integer range 0 to 255;
OUTPUT2:out integer range 0 to 255
);
end component;
signal REG_M: matrix8(15 downto 0);
signal DATA : STD_LOGIC_VECTOR (7 downto 0);
signal INTERUPT: BIT;
signal OTPT1,OTPT2: integer range 0 to 255;
signal AUX1,AUX2,AUX3:BIT;
begin
process(CLK)
begin
if CLK='1' and CLK'EVENT then
AUX1<=INTERRUPT;
AUX2<=AUX1;
AUX3<=AUX2;
INTERUPT<= AUX1 and AUX2 and AUX3;
end if;
end process;
L1:MICROCONTROLLER_BLACK_BOX port map(
RESET,
REG_M,
CLK_SWITCH,
INTERUPT,
OTPT1,
OTPT2
);
L2:MUX_SUB port map(
REG_M,
DATA_IN,
DATA
);
L3:AFISOR port map(
CLK,
RESET,
DATA,
SWITCH,
OTPT1,
OTPT2,
ANODE,
CATHODE
);
end;