谁知道CRC算法是指什么?(50分)

P

pop11

Unregistered / Unconfirmed
GUEST, unregistred user!
请问谁知道CRC算法指的是什么?
 
循环冗余码校检
 
在设计阶段有一种 CRC卡,就是 类-职责-协作卡。
 
能不能再详细点,它有什么算法呢
 
CRC算法通常用于通讯领域检测数据的错误,数据中有一位出现错误都能检测出来,如
16进制数据123456789ABCDEF01324,产生CRC码48EC,发送时发送123456789ABCDEF0132448EC,
到了接收方,接收方将得到的数据除去CRC码48EC也校验一下,如果还得到CRC码48EC,说明
发送过程中没有错误,反之,做相应的处理.
这有一个产生CRC码的算法:
type
iArray = Record
aArray :Array[1..1024] of Byte;
aLen :Integer;
end;

function GenerateCRC(var aPackage:iArray):Word;
var
crc:Word;
ia,ib,ie,I,iCount:Integer;
caTemp:iArray;
begin
crc:=0;
ia:=0;
ib:=0;
for I:=1 to aPackage.aLendo
caTemp.aArray:=aPackage.aArray;
ie:=caTemp.aArray[1];
crc:=crc xor (ie shl 8);
crc:=crc xor caTemp.aArray[2];
iCount:=aPackage.aLen;
for I:=1 to (aPackage.aLen-2)*8do
begin
while iCount>2do
begin
if (caTemp.aArray[iCount] and 128)<>0 then
ia:=1
else
ia:=0;
caTemp.aArray[iCount]:=caTemp.aArray[iCount] shl 1;
if ib=1 then
caTemp.aArray[iCount]:=caTemp.aArray[iCount]+1;
ib:=ia;
iCount:=iCount-1;
end;
if (crc and 32768)<>0 then
begin
crc:=crc shl 1;
if ia=1 then
crc:=crc+1;
crc:=crc xor 4129;
end
else
begin
crc:=crc shl 1;
if ia=1 then
crc:=crc+1;
end;
iCount:=aPackage.aLen;
end;
Result:=crc;
end;
 
在哪里能找到这方面的信息呢,因为程序中涉及到校验传感器传送的数据的正确性,请指教!
 
顶部