-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathArtyAdder.vhd
38 lines (30 loc) · 829 Bytes
/
ArtyAdder.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
-- Load the standard libraries
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity ARTY_ADDER is
port (
sw : in std_logic_vector(3 downto 0);
btn : in std_logic_vector(3 downto 0);
led : out std_logic_vector(3 downto 0);
led0_g : out std_logic
);
end entity ARTY_ADDER;
architecture BEHAVIORAL of ARTY_ADDER is
-- Reference the previous definition of the 4-bit adder
component ADDER4NATIVE is
port (
A4 : in std_logic_vector(3 downto 0);
B4 : in std_logic_vector(3 downto 0);
SUM4 : out std_logic_vector(3 downto 0);
C_OUT4 : out std_logic
);
end component;
begin
ADDER : ADDER4NATIVE
port map (
A4 => sw,
B4 => btn,
SUM4 => led,
C_OUT4 => led0_g
);
end architecture BEHAVIORAL;