You are on page 1of 2

Adding Bits

Given the following table of binary addition problems involving a single bit: 0 + 0 0 0 0 + 1 0 1 1 + 0 0 1 1 + 1 1 0

We see that when both addends are at their maximum value, a carry occurs, which is implied by moving the whole bit one place to the left (the two's column) and creating an empty bit in the 1's column, similar to mathematic arithmetic using base-ten numbers. In addition the new one in the two's column is said to be carried over to the two's column. Thus effectively when restricting to a single bit, instead of the above, we see the following table: 0 + 0 0 0 + 1 1 1 + 0 1 1 + 1 0

The extra 1 in the fourth problem is a carried bit, thus it cannot live in the bit field with the 0, because it doesn't fit. Using binary logic, we see that the pattern above, conforms to the following:

1 1 0 0

1 0 1 0

0 1 1 0

We can also derive that three of the cases are covered by a simpler operation:

1 1 0 0

1 0 1 0

0 1 1 0

Exclusive Or (XOR) is too complex to model for the purposes of this exercise, so we reduce XOR to

AND and OR statements. XOR is basically

1 1 0 0

1 0 1 0

0 1 1 0

So we need to derive how to ensure an equivalence using AND and OR.

You might also like