00001 --**************************************************************
00002 --* *
00003 --* The source code for the ATLAS BCM "AAA" FPGA is made *
00004 --* available via the GNU General Public License (GPL) *
00005 --* unless otherwise stated below. *
00006 --* *
00007 --* In case of problems/questions/bug reports etc. please *
00008 --* contact michael.niegl@cern.ch *
00009 --* *
00010 --**************************************************************
00011
00012 --**************************************************************
00013 --* *
00014 --* $Source: /local/reps/bcmfpga/bcm_aaa/bcm_aaa/eth/onescompaccu.vhd,v $
00015 --* $Revision: 2.1.2.3 $ *
00016 --* $Name: dev $ *
00017 --* $Author: mniegl $ *
00018 --* $Date: 2008/11/03 17:57:46 $ *
00019
00020
00021 --* *
00022 --**************************************************************
00023
00024 library ieee;
00025
00026 use ieee.std_logic_1164.all;
00027
00028 use ieee.std_logic_arith.all;
00029
00030 use ieee.std_logic_unsigned.all;
00031
00032 library unisim;
00033
00034 use unisim.vcomponents.all;
00035
00036
00037
00038
00039 entity onescompaccu is
00040 port (
00041 CLK : in ;
00042 RESET : in ;
00043 EN : in ;
00044 Ain : in (15 downto 0);
00045 CARRY_OUT : out ;
00046 RES : out (15 downto 0)
00047 );
00048 end onescompaccu;
00049
00050
00051 architecture onescompaccu_arc of onescompaccu is
00052
00053 signal carry_i : := '0';
00054 signal fb : (15 downto 0) := (others => '0');
00055 signal result_i : (15 downto 0) := (others => '0');
00056
00057
00058 component onescomplementadder
00059 port(
00060 CLK : in ;
00061 RESET : in ;
00062 EN : in ;
00063 A : in (15 downto 0);
00064 B : in (15 downto 0);
00065 C_IN : in ;
00066 C_OUT : out ;
00067 Y : out (15 downto 0)
00068 );
00069 end component;
00070
00071 begin
00072
00073 fb <= (others => '0') when RESET = '1' else result_i;
00074 RES <= result_i;
00075 CARRY_OUT <= carry_i;
00076
00077 adder : onescomplementadder
00078 port map
00079 (
00080 CLK => CLK ,
00081 RESET => RESET,
00082 EN => EN ,
00083 A => Ain ,
00084 B => fb ,
00085 C_IN => carry_i,
00086 C_OUT => carry_i,
00087 Y => result_i
00088 );
00089
00090 end onescompaccu_arc;
00091