PDA

View Full Version : Crc32?

RobotGymnast
04-16-2008, 03:05 PM
I can't entirely understand CRC32. I've read this (http://www.employees.org/~surendra/asic/crc.html), but that only deals with the long XOR division when the first w+1 digits of the message are greater than the CRC.. if it's something like
_______________
10011 ) 11010110110000
--------10011
------------------------
---------10011
---------10011
------------------------
----------00001
----------00000
------------------------
-----------00010
-----------00000
------------------------
------------00101
------------00000
------------------------
-------------01011
-------------00000
------------------------
--------------10110
--------------10011
------------------------
---------------01010
---------------00000
------------------------
----------------10100
----------------10011
------------------------
-----------------01110
-----------------00000
------------------------
------------------1110 = Remainder

If it doesn't make sense because of the alignment, check the original one in the aforementioned link.. it's in part 5

that's easy because the first "dividend" (11010) is greater than the first "divisor" (which is 10011), if it's smaller though (I'll change the divisor), wouldn't it be like:

_______________
11100 ) 11010110110000
--------00000
------------------------
--------110101
--------011100
------------------------
--------1010011
--------0011100
------------------------
--------10011110
--------00011100
------------------------
--------100000101
--------000011100
------------------------
--------1000111011
--------0000011100
------------------------
--------10001001110
--------00000011100
------------------------
--------100010100100
--------000000011100
------------------------
--------1000101110000
--------0000000011100
------------------------
--------10001011011000
--------00000000011100
------------------------
--------10001011000100 = remainder?

I don't know what I'm missing, help please!

If you need help understanding the long division just because of the way it's arranged, I'll do it like:

23) 358819
----23
-------------
----128
----115
-------------
----0138
----0138
-------------
----00001
----00000
-------------
----000019
----000000
-------------
---------19 = remainder

basically in every block (seperated by the -------------), the first number is the remainder from last subtraction, and the second number is first number-(first number&#37;divisor), AKA the number you subtract..

Well that was a tangent just in case you didn't get the division pattern.. if you still don't, sorry.

dwks
04-16-2008, 05:23 PM
Note: you'll get much better formatting if you use
tags.

RobotGymnast
04-16-2008, 05:26 PM
oh that's true. I forgot completely rofl.. but I'd probably have to reformat it all if I did that now so I'll leave it.

Oh and just to be incredibly annoying, your sig: search and you find. not seek and ye shall find.. I guess it's all the same though =P (sry I'm taking latin right now)

dwks
04-16-2008, 05:31 PM
oh that's true. I forgot completely rofl.. but I'd probably have to reformat it all if I did that now so I'll leave it.
Yes, I tried it myself, but you added some extra spaces and stuff in.

Oh and just to be incredibly annoying, your sig: search and you find. not seek and ye shall find.. I guess it's all the same though =P (sry I'm taking latin right now)
Yes, Latin is fun, isn't it?

quaero is most often translated as "I seek", if that's what you mean. http://en.wiktionary.org/wiki/quaero. I went through my dictionary, and it was the best word I could find.

Perhaps you were referring to the fact that my translation is actually singular, while "ye" is technically plural. I could use a plural translation, I suppose, but I always thought that the saying meant the singular tense. Besides, singular looks better. :)

I'm pretty sure that "invenies" is future accusative.
Removed table -- it was really badly formatted.
My formatting is worse than yours. ;) It looked good in KLatin.

tabstop
04-16-2008, 05:31 PM
\I don't know what I'm missing, help please!

If you need help understanding the long division just because of the way it's arranged, I'll do it like:

23) 358819
----23
-------------
----128
----115
-------------
----0138
----0138
-------------
----00001
----00000
-------------
----000019
----000000
-------------
---------19 = remainder

And what would happen if you had 43 divided into 358819?

Once you do that: Why wouldn't you do the same thing in your original problem?

CornedBee
04-17-2008, 01:25 AM
Moved. This is algorithm theory, not an actual C++ question.

abachler
04-17-2008, 09:23 AM
Oh and just to be incredibly annoying, your sig: search and you find. not seek and ye shall find.. I guess it's all the same though =P (sry I'm taking latin right now)

Then you know that synonyms don't always have direct forms in other languages. Seek and ye shall find is the (middle?) english version. The modern translation of the latin would be search and you find, im not sure if the tense is correct on the find. English and most other germanic languages use additonal words to modify the tense, where latin and most other 'romance' languages modify the verb directly.

The verb seek/quaere should be in the imperative tense while invenies is perhaps the wrong verb as it means more along the lines of create/invent than find, but in any case should be in the future simple. For that matter quaere means more like want/need/desire than to search for.