# Calculate check sum

1. Jun 1, 2013

### trollcast

1. The problem statement, all variables and given/known data
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{------------}$

2. Relevant equations

3. 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$

$\displaystyle 01101101$
$\displaystyle 00100111$
$\displaystyle 00101101$
$\displaystyle \text{------------}$
$\displaystyle 11000001$
$\displaystyle \text{------------}$
$\displaystyle 1012011$

2. Jun 1, 2013

### rcgldr

There are multiple implementations for checksum. You need to specify what checksum means for this problem.

3. Jun 1, 2013

### trollcast

Checksum is simply the sum of all the bytes with any overflow ignored so the checksum is the same size as the original bytes.

4. Jun 2, 2013

### lewando

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!

5. Jun 2, 2013

### trollcast

That makes sense now.

Is that method more correct or should either be acceptable?

6. Jun 2, 2013

### lewando

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.