blob: 89405084a51c2e8c83ab18e51c31dcbe76627c37 (
plain)
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.std_logic_1164.all;
entity xor_gate is
generic (
INVERT : boolean
);
port (
a : in std_logic;
b : in std_logic;
q : out std_logic
);
end;
architecture a of xor_gate is
begin
gen: if INVERT generate
q <= not (a xor b);
else generate
q <= a xor b;
end generate;
end;
library ieee;
use ieee.std_logic_1164.all;
entity top is
port (
x : in std_logic;
y : in std_logic;
o_custom : out std_logic;
o_and : out std_logic
);
end;
architecture a of top is
component comp is
port (
a : in std_logic;
b : in std_logic;
q : out std_logic
);
end component;
begin
comp_inst: comp
port map (
a => x,
b => y,
q => o_custom
);
o_and <= x and y;
end;
configuration conf of top is
for a
for comp_inst : comp
use entity work.xor_gate
generic map (
INVERT => false
);
end for;
end for;
end configuration;
|