4 -- part of LXPWR motion control board (c) PiKRON Ltd
5 -- idea by Pavel Pisa PiKRON Ltd <pisa@cmp.felk.cvut.cz>
6 -- code by Marek Peca <mp@duch.cz>
13 use ieee.std_logic_1164.all;
14 use ieee.numeric_std.all;
20 reset_i : in std_logic;
21 input_i : in std_logic;
22 crc_o : out std_logic_vector(7 downto 0)
26 architecture behavioral of crc is
27 signal reg_s, next_reg_s : std_logic_vector(7 downto 0);
31 comb: process (reset_i, input_i, reg_s)
34 next_reg_s <= (others => '1');
36 next_reg_s(4 downto 0) <= reg_s(5 downto 1);
37 next_reg_s(5) <= reg_s(0) xor reg_s(6);
38 next_reg_s(6) <= reg_s(0) xor reg_s(7);
39 next_reg_s(7) <= reg_s(0) xor input_i;
45 wait until clk_i'event and clk_i = '1';