-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFull_Adder.vhd
More file actions
39 lines (34 loc) · 1.11 KB
/
Copy pathFull_Adder.vhd
File metadata and controls
39 lines (34 loc) · 1.11 KB
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
library ieee;
use ieee.std_logic_1164.all;
entity Full_Adder_32bits is
port(
entry_a, entry_b: in std_logic_vector(31 downto 0);
mode: in std_logic;
carry_out: out std_logic;
result: out std_logic_vector(32 downto 0) := (others => '0')
);
end Full_Adder_32bits;
architecture A_Full_Adder_32bits of Full_Adder_32bits is
signal internal_carry: std_logic_vector(32 downto 0) := (others => '0');
component Full_Adder_1bit
port(
bit_a, bit_b, carry_in, mode : in std_logic;
result, carry_out: out std_logic
);
end component;
begin
internal_carry(0) <= mode;
gen_adder: for i in 0 to 31 generate
Full_Adder_i: Full_Adder_1bit
port map(
bit_a => entry_a(i),
bit_b => entry_b(i),
carry_in => internal_carry(i),
mode => mode,
result => result(i),
carry_out => internal_carry(i+1)
);
end generate gen_adder;
result(32) <= internal_carry(32);
carry_out <= internal_carry(32);
end A_Full_Adder_32bits;