求助:如何用VHDL语言实现CRC译码

来源:百度知道 编辑:UC知道 时间:2024/05/14 10:38:05
简单译码就可。
感谢回应!
但是,我想要的是译码,不是编码。

--**************************************************
--CRC生成多项式为P(x)= X5+X4+X2+1(即110101)
--**************************************************
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;
--**************************************************
entity crc_5 is
port(
rst : in std_logic;
clk : in std_logic;
din : in std_logic;
crc_en: in std_logic; --其高电平要一直持续到din输入完毕
dout : out std_logic
);
end crc_5;

--**************************************************
architecture a of crc_5 is
signal shift_reg : std_logic_vector(4 downto 0);

begin
process(rst,clk)
begin
if(rst='1') then
shift_reg<=(others=>'0');
elsif clk'event and clk='1' then
if crc_en='1' then
shift_reg(0)<=shift_reg(4) xor din;
shift_reg(1)<=shift