eFEX firmware  1.7.3
ATLAS l1-calo - electron and tau feature extraction firmware for eFEX boards

Back to eFEX documentation
parity_gen_spec.vhd
Go to the documentation of this file.
1 
6 
7 LIBRARY ieee;
8 USE ieee.std_logic_1164.all;
9 USE ieee.std_logic_arith.all;
10 
12 ENTITY parity_gen IS
13 
14  Generic( width :integer:= 9);
15  PORT
16  (
17  CLK :IN std_logic;
19  Data_in :IN std_logic_vector(width-1 downto 0);
21  data_Parity :OUT std_logic_vector(width downto 0)
22  );
23 
24 END ENTITY parity_gen;
25 
27 ARCHITECTURE spec OF parity_gen IS
28 
29 BEGIN
30 
31 odd_parity: Process(clk)
32 
33 variable temp: std_logic:='0';
34 
35  Begin
36 
37 
38  if CLK' event and CLK ='1' then
39  temp := '0';
40 
41  for i in 0 to width-1 loop
42 
43  temp := temp xor data_in(i);
44 
45  end loop;
46 
47  data_parity <= (temp & data_in);
48 
49  end if;
50 
51  end process;
52 
53 
54 
55 END ARCHITECTURE spec;
56 
parity genrator
parity genrator
out data_Parity std_logic_vector( width downto 0)
data with parity
in CLK std_logic
clock 125 MHz
in Data_in std_logic_vector( width- 1 downto 0)
data in to the parity generator block