I started building basic logic gates. I wanted to start basic and understandable so I started building some NAND gates just using two transistors. On its own hooked up to a switch and a LED they work as they should, so I continued chaining them.
I first tried to simulate this circuit using LTspice where everything looked fine. However testing them out with hardware does not result the same way. I chained 4 NAND gates to form a XOR gate. If I add an extra NAND gate like shown below, the output of the XOR gate does not work anymore.
The probes are as follow:
- V2
- V3
- Q19 Collector
- Q5 Collector
But my measurements (in V) are (* means using 1k for all pull-up resistors):
V2 | V3 | Q19 Collector | Q5 Collector | Q19 Collector * | Q5 Collector * |
---|---|---|---|---|---|
5.00 | 5.00 | 0.03 | 5.00 | 3.10 | 4.18 |
0 | 5.00 | 2.22 | 1.36 | 3.70 | 2.88 |
5.00 | 0 | 5.00 | 0.08 | 3.33 | 2.86 |
0 | 0 | 0.03 | 1.36 | 2.69 | 2.88 |
This is my circuit build on a breadboard (same wire colors are connected together, except the green and red going out of the picture are where I measured the values. And the black and yellow wires are where I set my input signals):
My questions are:
- Why is the LTspice simulation wrong (This is my asc file)?
- Why does this behave like that and how can I get the gates to work as they should?