CRC Using VHDL
CRC Using VHDL
The below is the code for CRC4 using VHDL. This was also
implemented on FPGA (Spartan 3). Here the data taken is 4bits.
The code can be modified for any number of data bits.
Correspondingly the length of the array should also be varied.
CODE:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity crc1 is
port(data_in:in std_logic_vector(3 downto 0);
poly:in std_logic_vector(4 downto 0):="10011";
crc:out std_logic_vector(3 downto 0));
end crc1;
end process;
end Behavioral;