aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/gna/issue731/adder.vhdl
blob: 1a214b91a8279c50e8bea029063026d5854fd5d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;

entity Adder is
	generic (gWidth : natural);
	port(
		iA : in std_ulogic_vector(gWidth-1 downto 0);
		iB : in std_ulogic_vector(gWidth-1 downto 0);
		
		oCarry: out std_ulogic;
		oRes : out std_ulogic_vector(gWidth-1 downto 0)
	);
end entity Adder;

architecture RTL of Adder is
begin
	(oCarry, oRes) <= std_ulogic_vector(unsigned('0' & iA) + unsigned('0' & iB));
end architecture RTL;