# Base 14 subtraction question

I am trying to solve the following problem.

It is not homework since I am just brushing up =) but I will try posting it here.

I have the following base 14 subtraction problem:

35 - AB = ?

I can look up the answer, which is shown as 68 (base 14).

But, for the life of my, I can figure it out...

The problem I am having is that AB appears to be larger (?) than the 35?

How do I subtract a larger number, from a smaller, and not end up with a negative number?

I can figure out the first digit (8).

Since B is larger, we gotta carry over from the 3A column, and we end up with 14+5 (=19) - B (=11), so we end up with 8.

I get confused in handling the other column, which should now read 3 minus A (and the carried over 1).

How does that turn into six?

thank you.

Subtracting a larger from a smaller will still give you a negative number, no matter what the base.

The trick is to do just what you'd do in base 10. First, flip them around (write "AB - 35"). Then, negate your final result.

In this case, once you do that, the math is straightforward. I get -76(base14). Are you sure the answer you've looked up is right?

that is the answer the book has.

I also suspect the answer is incorrect.

I got the same answer as you.

Here is the way they wrote the solution:

35
- AB
1
------
68

ok figured it out...there was a trick that I did not know...

1. apparently negative is not really allowed...

35 - AB...(base 14)

step one (from the right):
subtract 5 - B.
Since B is larger, we borrow from the left...
5 + 14 = 19, then minus B (= 11 in base 14) == 8.

step two: next spot over...we need to subtract A + 1 from 3. Since 3 is smaller, we need to borrow again, from the left.

3+14 = 17 minus (A + 1 = 11) == 6.

Per what I just found:

# A negative difference requires several steps:

* Record the result as a base-n digit at the bottom of the same column.
* Write a 1 as the borrow in the next column left.

# Any extra borrow past the leftmost column is not recorded in the answer. It is called the borrow out and is usually stored somewhere else on the computer. The answer must have the same number of digits as the two operands.

Thanks tho!

Jalisco

Ah, it sounds like you're doing modular arithmetic. Now it makes sense.

Incidentally, note that 76 + 68 = 100 in base 14, showing the equivalence of the two answers.