EDIT: There is a flaw with the XOR circuit, see More Discrete Logic.
Continuing on from Sum of Two Bits, I now need to make logic using only discrete components. Addition of one bit requires two AND gates, two XOR gates, and one OR gate.
Originally I had planned to make the OR gates using transistors, I had already ordered 500 NPN and 500 PNP from Farnell so I have plenty to spare for a while. But with my new found love of pull down resistors, I realised that using diodes I could make OR gate.
If A or B are high then Out will be high too. If neither are high, then the pull down resister will pull Out down to ground.
When A and B are low, voltage on the right transistor will be pulled up to high, turning it ‘on’, causing Out to be grounded.
When both A and B are high, a circuit is formed and the base of the right transistor is grounded, turning it ‘off’, allowing Out to be pulled up to high.
If only A or only B is on, a circuit to ground won’t be formed so the right transistor will remain ‘on’.
This one I used iCircuit on iOS to design. It uses two PNP transistors.
If the left switch is high and the right switch is low, the left transistor is turned ‘on’. If the right switch is on, the left transistor turn off, with a pull down resister added it can be pulled to ground.
If both switches are high, neither transistor will allow the circuit to complete.