Building an Adder with Switches

Now that you are comfortable adding binary numbers together, let's see how we could make an adding machine using transistors. We will use simple light switches here to make things clearer—but this is not an oversimplification: the transistor logic works very similarly. For this example, we will build part of an adding machine that can add two binary digits (bits) together.

Here are the possible answers obtained from adding two bits:

A B   Carry Sum
0 0   0 0
0 1   0 1
1 0   0 1
1 1   1 0

We'll just design the "Carry" output of the adder here (the Sum is a bit harder, but also can be done using only transistor switches). The Carry is 1 only if both of our inputs are 1. That is, the Carry is 1 when input A AND input B are 1. Thus we can use two switches in a row just as shown above to build the Carry output of our adding machine.

Switch A in series with Switch B to get to lightbulb

 

Using combinations of transistor switches, we can build circuits to add, subtract, multiply, and divide. We can also use them to make very simple decisions, by using the logical AND or the logical OR functions.