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

Back to eFEX documentation
parity_checker_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_checker IS
13  PORT (
15  Clk :IN std_logic;
17  Data_in :IN std_logic_vector(9 downto 0);
19  Data_out :OUT std_logic_vector(8 downto 0);
21  even_parity :OUT std_logic
22  );
23 END ENTITY parity_checker;
25 
26 ARCHITECTURE spec OF parity_checker IS
27 
28 BEGIN
29  parity_check: process(clk)
30  variable parity: std_logic := '0';
31 
32  Begin
33 
34  if clk' event and clk ='1' then
35  parity := '0';
36  for i in 0 to 9 loop
37  if data_in(i) = '1' then
38  parity := not parity;
39  end if;
40  end loop;
41 
42  even_parity<=parity;
43  Data_out <= data_in(8 downto 0);
44  end if;
45 
46  end process;
47 END ARCHITECTURE spec;
48 
out even_parity std_logic
parity bit
in Clk std_logic
clock 125 MHz
in Data_in std_logic_vector( 9 downto 0)
master rx data with parity bit
out Data_out std_logic_vector( 8 downto 0)
master rx data