CRC16
От: Аноним  
Дата: 10.06.05 10:24
Оценка:
Приветствую всех
смысл такой надо реализовать следующее
ITU-T Q.921

2.7 Frame Check Sequence (FCS) field
The FCS field shall be a 16-bit sequence. It shall be the ones complement of the sum (modulo 2) of:
a) the remainder of xk (x15 + x14 + x13 + x12 + x11 + x10 + x9 + x8 + x7 + x6 + x5 + x4 + x3 + x2 + x +
1) divided (modulo 2) by the generator polynomial x16 + x12 + x5 + 1, where k is the number
of bits in the frame existing between, but not including, the final bit of the opening flag and
the first bit of the FCS, excluding bits inserted for transparency; and
b) the remainder of the division (modulo 2) by the generator polynomial x16 + x12 + x5 + 1, of
the product of x16 by the content of the frame existing between, but not including, the final
bit of the opening flag and the first bit of the FCS, excluding bits inserted for transparency.
As a typical implementation at the transmitter, the initial content of the register of the device
computing the remainder of the division is preset to all 1s and is then modified by division by the
generator polynomial (as described above) on the address, control and information fields; the ones
complement of the resulting remainder is transmitted as the 16-bit FCS.
As a typical implementation at the receiver, the initial content of the register of the device computing
the remainder is preset to all 1s. The final remainder, after multiplication by x16 and then division
(modulo 2) by the generator polynomial x16 + x12 + x5 + 1 of the serial incoming protected bits and
the FCS, will be 0001110100001111 (x15 through x0, respectively) in the absence of transmission
errors.

поискал в форумах нашел что то похожее
как я понял алгоритм должен здесь присутствовать именно этот(табличный вариант не подходит)
http://www.rsdn.ru/Forum/Message.aspx?mid=439709&only=1
Автор: selectron
Дата: 11.11.03

однако немного непонятно каким образом получить при проверке пакета 0001110100001111
Насколько я знаю после того как приходит пакет мы обычно вычисляем CRC
вместе с самим полем CRC и в результате должны получить нуль
Разъясните пожалуйста
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.