?? crcgen1.m
字號:
function crc_data=crcgen1(data)
% k=4; % values of interest are 138, 113, 101, 87, 84, and 80
% data=randint(1,k,2)
poly=[ 1 1 1 0 1 ]; % x^4+x^3 + x^2 + 1
% poly = [1 1 1 0 1]; % x^4+x^3 + x^2 + 1
% Build the CRC with gfdeconv
[q,r]=gfdeconv(fliplr([data zeros(1,length(poly)-1)]),fliplr(poly));
r=fliplr(r); % change to descending powers
if length(r)<length(poly)-1
r=[zeros(1,length(poly)-1-length(r)),r];
end
crc_data=[data r]; % add the remainder
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -