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/div/LFSR14_23A3.vhd,v $
00015 --* $Revision: 1.4.2.3 $ *
00016 --* $Name: dev $ *
00017 --* $Author: mniegl $ *
00018 --* $Date: 2008/11/03 17:57:45 $ *
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
00033
00034 entity LFSR14_23A3 is
00035 port(
00036 clock : in ;
00037 en : in ;
00038 q : out (13 downto 0)
00039 );
00040 end;
00041
00042
00043
00044 architecture RTL of LFSR14_23A3 is
00045 signal LFSR : (13 downto 0) := (others => '0');
00046 begin
00047 q <= LFSR;
00048
00049 process(clock)
00050 begin
00051 if clock'event and clock = '1' then
00052 if en = '1' then
00053 LFSR(0) <= LFSR(0) xor LFSR(1) xor LFSR(5) xor LFSR(7) xor LFSR(8) xor LFSR(9) xor LFSR(13) xor not(LFSR(0) or LFSR(1) or LFSR(2) or LFSR(3) or LFSR(4) or LFSR(5) or LFSR(6) or LFSR(7) or LFSR(8) or LFSR(9) or LFSR(10) or LFSR(11) or LFSR(12));
00054 LFSR(13 downto 1) <= LFSR(12 downto 0);
00055 end if;
00056 end if;
00057 end process;
00058 end;