Calculate CheckSum: Solve w/o Calculator

  • Thread starter Thread starter trollcast
  • Start date Start date
  • Tags Tags
    Sum
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
5 replies · 2K views
trollcast
Gold Member
Messages
282
Reaction score
13

Homework Statement


Calculate the checksum for the following 3 bytes, showing all working without the use of a calculator:

##\displaystyle 01101101 ##
##\displaystyle 00100111 ##
##\displaystyle 00101101 ##
##\displaystyle \text{------------}##

##\displaystyle \text{------------}##

Homework Equations



The Attempt at a Solution



I'm getting the correct answer but my carries are different to the solutions so I'd only 1 mark out of 3:

My answer [I'm putting the carries below the answer line in decimal so you can see them easier]:


##\displaystyle 01101101 ##
##\displaystyle 00100111 ##
##\displaystyle 00101101 ##
##\displaystyle \text{------------}##
##\displaystyle 11000001##
##\displaystyle \text{------------}##
##\displaystyle 1212211##


The solutions answer:

##\displaystyle 01101101 ##
##\displaystyle 00100111 ##
##\displaystyle 00101101 ##
##\displaystyle \text{------------}##
##\displaystyle 11000001##
##\displaystyle \text{------------}##
##\displaystyle 1012011##
 
Physics news on Phys.org
There are multiple implementations for checksum. You need to specify what checksum means for this problem.
 
rcgldr said:
There are multiple implementations for checksum. You need to specify what checksum means for this problem.

Checksum is simply the sum of all the bytes with any overflow ignored so the checksum is the same size as the original bytes.
 
It looks like the solution's method uses a different way of carrying. For example, if the sum for column N equals 4, rather than carrying a 2 to the N+1 column, a 1 is carried to the N+2 column. Both your method and the solution's method work. Now go and grub for those extra marks!
 
lewando said:
It looks like the solution's method uses a different way of carrying. For example, if the sum for column N equals 4, rather than carrying a 2 to the N+1 column, a 1 is carried to the N+2 column. Both your method and the solution's method work. Now go and grub for those extra marks!

That makes sense now.

Is that method more correct or should either be acceptable?
 
Use the one that earns you the highest score with the least amount of argument, I suppose. If you were to add a much larger set of bytes, your method of representing the carry using a single decimal value seems quicker and less error prone.