-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathC2C.vhd
43 lines (34 loc) · 863 Bytes
/
C2C.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
library ieee;
use ieee.std_logic_1164.ALL;
entity C2C is
generic(width: integer);
port(
N : in std_logic_vector(width - 1 downto 0);
S : in std_logic;
Z : out std_logic_vector(width - 1 downto 0);
COUT : out std_logic
);
end C2C;
architecture STRUCT of C2C is
component PA is
generic(width : integer := width);
port(
X : in std_logic_vector(width - 1 downto 0);
CIN : in std_logic;
S : out std_logic_vector(width - 1 downto 0);
COUT : out std_logic
);
end component;
signal PAIN : std_logic_vector(width - 1 downto 0);
signal vS : std_logic_vector(width - 1 downto 0);
begin
vS <= (others => S);
PAIN <= N xor vS;
U1: PA
port map(
X => PAIN,
CIN => S,
S => Z,
COUT => COUT
);
end STRUCT;