This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

CRC Error Detection

Former Community Member
Former Community Member

 

Parents
  • Hello,

    Hope I'm not missing a trick, and apologies in advance if I am trying to oversimplify and have not caught on to what you want to do.

    But here goes (hopefully not with both feet!) ....


    I seem to remember doing similar things with Assembler a number of years ago. I think the algorithm used the basic theory that division like the "inverse of multiplication", and multiplication is a sort of "repeated addition":-

    Try repeatedly subtracting the checksum from the word, until one of the following occurs:

    (a) The remainder equals the Checksum - in which case you will have found "Remainder Zero";

    or

    (b) The remainder is smaller than the Checksum - in which case you will have found "Remainder not zero".

    Might sound like a lot of work to do, but I suppose the number of iterations depends on how large your word is compared with your checksum.

    Also, not sure whether in this simple example "the signs take care of themselves" for negative numbers - haven't thought that one through!


    Hope this helps.

    Graham Kenyon.
Reply
  • Hello,

    Hope I'm not missing a trick, and apologies in advance if I am trying to oversimplify and have not caught on to what you want to do.

    But here goes (hopefully not with both feet!) ....


    I seem to remember doing similar things with Assembler a number of years ago. I think the algorithm used the basic theory that division like the "inverse of multiplication", and multiplication is a sort of "repeated addition":-

    Try repeatedly subtracting the checksum from the word, until one of the following occurs:

    (a) The remainder equals the Checksum - in which case you will have found "Remainder Zero";

    or

    (b) The remainder is smaller than the Checksum - in which case you will have found "Remainder not zero".

    Might sound like a lot of work to do, but I suppose the number of iterations depends on how large your word is compared with your checksum.

    Also, not sure whether in this simple example "the signs take care of themselves" for negative numbers - haven't thought that one through!


    Hope this helps.

    Graham Kenyon.
Children
No Data