give me some explanation about the code.

function ab=poly_mult(a,b,mod_pol)
ab=0;
for i_bit=1:8
if bitget(a,i_bit)
b_shift=bitshift(b,i_bit-1);
ab=bitxor(ab,b_shift);
end
end
for i_bit=16:-1:9
if bitget(ab,i_bit)
mod_pol_shift=bitshift(mod_pol,i_bit-9);
ab=bitxor(ab,mod_pol_shift);
end
end

 채택된 답변

Jan
Jan 2013년 4월 4일

0 개 추천

It is much more likely that you get a helpful answer, if you try to formulate with a certain level of politeness. Currently we see the command "give me" and an unformatted pile of code. If you follow the "? Help" link, you find instructions for formatting, and inserting a detailed question, which contains a "please" would be a good idea also. Currently it is not clear, if you ask e.g. for an explanation of the "function", "for" or "if" commands also. And it is not clear, if you took the time to read the corresponding documentation already: It would not be efficient, if we rephrase the contents of "help bitget" etc, when you have this information locally on your hard disk already.

추가 답변 (1개)

Image Analyst
Image Analyst 2013년 4월 4일

0 개 추천

Usually when I've been seeing bitshift() and similar bit operations, it has to do with watermarking or steganography. Further low level details can be learned by reading the help for those functions, as Jan said, and then trying it with a known number to see what happens to its value as you do the operations. Do you know nothing about this code? Why are you concerned with it then?

카테고리

도움말 센터File Exchange에서 Electrophysiology에 대해 자세히 알아보기

질문:

2013년 4월 4일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by