LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.ALL;
USE IEEE.STD_LOGIC_UNSIGNED.ALL;
ENTITY CRC IS
PORT(CODE1:IN STD_LOGIC_VECTOR(13 DOWNTO 0);
RESULT:OUT STD_LOGIC_VECTOR(13 DOWNTO 0));
END ENTITY CRC;
ARCHITECTURE behave OF CRC IS
BEGIN
PROCESS(CODE1) IS
VARIABLE NUM:STD_LOGIC_VECTOR(4 DOWNTO 0);
VARIABLE CODE2:STD_LOGIC_VECTOR(13 DOWNTO 0);
BEGIN
NUM:="10011";
CODE2<=CODE1;
FOR i IN 0 TO 9 LOOP
IF(CODE2(13-i)='1') THEN
FOR j IN 0 TO 4 LOOP
CODE2(9-i+j):=CODE2(9-i+j) XOR NUM(j);
END LOOP;
END IF;
END LOOP;
RESULT<=CODE2;
END PROCESS;
END ARCHITECTURE behave;
你说的是啥意思,你这里就一个输入信号,是说CODE1有问题还是怎么
仿真的时候你想看什么变量的都可以。你编译通过就说明不存在语法上的错误。