-
Notifications
You must be signed in to change notification settings - Fork 0
/
2-bit Adder.cir
42 lines (37 loc) · 1.09 KB
/
2-bit Adder.cir
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
A0 : in std_logic;
B0 : in std_logic;
Cin : in std_logic;
Cout : out std_logic;
S0 : out std_logic;
a0-1,a0-2,a0-3 : signal std_logic;
b0-1,b0-2,b0-3 : signal std_logic;
c0-1,c0-2,c0-3 : signal std_logic;
x0-1,x0-2,x0-3 : signal std_logic;
p0 : signal std_logic;
q0 : signal std_logic;
A1 : in std_logic;
B1 : in std_logic;
S1 : out std_logic;
a1-1,a1-2,a1-3 : signal std_logic;
b1-1,b1-2,b1-3 : signal std_logic;
c1-1,c1-2,c1-3 : signal std_logic;
x1-1,x1-2,x1-3 : signal std_logic;
p1 : signal std_logic;
q1 : signal std_logic;
begin arch
XOR0-1: XorGate2 (a0-2, b0-2, x0-1);
XOR0-2: XorGate2 (x0-2, c0-2, S0);
AND0-1: AndGate2 (c0-3, x0-3, p0);
AND0-2: AndGate2 (a0-3, b0-3, q0);
OR0: OrGate2 (p0, q0, c1-1);
a0-1: InBranch (A0);
b0-1: InBranch (B0);
c0-1: InBranch (Cin);
XOR1-1: XorGate2 (a1-2, b1-2, x1-1);
XOR1-2: XorGate2 (x1-2, c1-2, S1);
AND1-1: AndGate2 (c1-3, x1-3, p1);
AND1-2: AndGate2 (a1-3, b1-3, q1);
OR1: OrGate2 (p1, q1, Cout);
a1-1: InBranch (A1);
b1-1: InBranch (B1);
end arch;