2 use ieee.std_logic_1164.all;
3 use ieee.std_logic_unsigned.all;
4 use ieee.numeric_std.all;
5 use work.lx_fncapprox_pkg.all;
7 -- IRC bus interconnect
8 entity lx_fncapprox_dsp48 is
10 P : out std_logic_vector(47 downto 0);
11 A : in std_logic_vector(17 downto 0) := (others => '0');
12 B : in std_logic_vector(17 downto 0) := (others => '0');
13 C : in std_logic_vector(47 downto 0) := (others => '0');
14 ADD_SUB_X : in std_logic;
18 end lx_fncapprox_dsp48;
20 architecture Behavioral of lx_fncapprox_dsp48 is
21 signal P_s : std_logic_vector(47 downto 0);
30 wait until CLK'event and CLK= '1' and CE = '1';
31 if ADD_SUB_X = '1' then
32 P_s <= std_logic_vector(unsigned(C) - unsigned(A) * unsigned(B));
34 P_s <= std_logic_vector(unsigned(C) + unsigned(A) * unsigned(B));