Crc32?

This is a discussion on Crc32? within the A Brief History of Cprogramming.com forums, part of the Community Boards category; I can't entirely understand CRC32. I've read this , but that only deals with the long XOR division when the ...

  1. #1
    Registered User
    Join Date
    Sep 2007
    Posts
    67

    Crc32?

    I can't entirely understand CRC32. I've read this, 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%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.

    anyhoo, help please!
    Last edited by RobotGymnast; 04-16-2008 at 03:35 PM.

  2. #2
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,046
    Note: you'll get much better formatting if you use [code][/code] tags.
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  3. #3
    Registered User
    Join Date
    Sep 2007
    Posts
    67
    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)

  4. #4
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,046
    Quote Originally Posted by RobotGymnast View Post
    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.

    [edit] I'm pretty sure that "invenies" is future accusative.
    [edit=2] Removed table -- it was really badly formatted. [/edit]
    My formatting is worse than yours. It looked good in KLatin. [/edit]
    Last edited by dwks; 04-16-2008 at 05:39 PM.
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  5. #5
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,185
    Quote Originally Posted by RobotGymnast View Post
    \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?

  6. #6
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,892
    Moved. This is algorithm theory, not an actual C++ question.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  7. #7
    Malum in se abachler's Avatar
    Join Date
    Apr 2007
    Posts
    3,189
    Quote Originally Posted by RobotGymnast View Post
    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.
    Last edited by abachler; 04-17-2008 at 09:40 AM.
    Until you can build a working general purpose reprogrammable computer out of basic components from radio shack, you are not fit to call yourself a programmer in my presence. This is cwhizard, signing off.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. crc32
    By brietje698 in forum C++ Programming
    Replies: 24
    Last Post: 07-31-2007, 07:19 AM
  2. Critique / Help me make this program run faster.
    By Mastadex in forum C++ Programming
    Replies: 10
    Last Post: 06-26-2004, 11:58 AM
  3. Crc32
    By noob2c in forum C Programming
    Replies: 2
    Last Post: 05-31-2003, 05:00 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21