資源簡介
crc-16的編碼,使用的多項式是G(x)=x^16+x^12+x^5+1
G(X)=x^16+x^12+x^5+1)
代碼片段和文件信息
function?[resto]?=?crc16(h)
????%El?polinomio?Gx?es?un?Estandar?X^16+X^12+X^5+1
????gx?=?[1?1?1?1?0?0?1];
????%Igualamos?PX
????px?=?[1?0?1?1?0?0?1?0?0?1?1?0?1?1?];
????%Calculamos?P(x)x^r
????pxr=[px?zeros(1length(gx)-1)];
????%Realizamos?la?division?del?vector?y?obtenemos?el?cociente?(c)?y?el
????%resitudo?(r)?entre?pxr?y?gx
????[c?r]=deconv(pxrgx);
????%En?ocaciones?esta?division?nos?resulta?en?valores?negativo?(-1)?y
????%verificamos?que?sea?1?o?0
????r=mod(abs(r)2);
????%Obtenemso?el?crc-16
????resto=r(length(px)+1:end);
end
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????541??2012-11-27?22:00??crc16-CCITT\crc16.m
?????文件???????1335??2010-02-19?23:47??crc16-CCITT\license.txt
?????目錄??????????0??2012-11-27?21:52??crc16-CCITT
-----------?---------??----------?-----??----
?????????????????1876????????????????????3
評論
共有 條評論