XOR gate problem with GND - Page 1
Forum section: electronics / beginners

author: Fuldup
author_rank: Contributor
timestamp: April 24, 2024, 02:20:34 pm
content: i was building a XOR gate and it seems to work, but when both the inputs are HIGH the current goes still goes through the output instead of going through the NAND gate transistor, which are connected to the GND. The NAND transistors are connected to the GND with a 1k ohm resistor (so the circuit works like an OR gate) if i use a normal jumper or a resistor with less resistance the circuit stops working, i don't undertstand why, but it has to do with the resistance of the output path and the GND path.green jumpers: output of NAND gate and OR gate.white jumpers : input of the swithces (connected with 10k ohm resistors)black jumpers: connection to GNDred jumpers: connection to the power supplyin the picture:both inputs are HIGH, but the light diode is still onthe marked resistor is the that has the problem

author: Ian.M
author_rank: Super Contributor
timestamp: April 24, 2024, 03:19:56 pm
content: You expect anyone to figure out what you are even trying to do from crappy breadboard photos with half or more of the interconnect wiring going out of frame, unreadable component markings, and no schematic?Life's too short for that s--t!OTOH if you had provided a clear and conventionally drafted schematic (i.e. most positive power rail at the top, most negative at the bottom, signal flow left to right, all interconnects drawn, not just net labelled), with part numbers, there are many here who would take an interest and help you figure it out. You've been asked for schematics before, so *PLEASE* just take it as standard to provide them when ever you are asking a question about circuit theory, operation, and/or troubleshooting!

author: Fuldup
author_rank: Contributor
timestamp: April 24, 2024, 03:38:17 pm
content: this is a schematic of the XOR gate circuit

author: Ian.M
author_rank: Super Contributor
timestamp: April 24, 2024, 04:07:01 pm
content: Wont work, cant work!The inputs are effectively paralleled at the base of Q5 so it has no way of discriminating between either input active and both active. Also with the Vce_sat of Q1 and Q2 in series and at least 0.7V drop across R4, they cant get Q4's base voltage low enough to turn it off. The design is too broken to be easy to fix, and if not your own design, you should be very suspicious of any other circuits from the same source!Try the attached circuit or sim it inLTspice.N.B. Vcc is the positive of your battery, and the input switches should be wired between that and InA, InB (without the pulse voltage sources). To probe logic levels without disturbing circuit operation, use another NPN transistor as an emitter follower to drive the LED. (i.e. signal to base, collector to Vcc, emitter to a 1K resistor, to the LED anode, cathode to ground)Theory: Q3,Q4 perform a NOR function and Q5 inverts that to an OR. Q1, Q2 perform a NAND function which is wire-ORed*with the Q5 OR to make the output low when both inputs are high, thus giving XOR.*wire-ORing refers to the operation of combining open drain or open collector outputs if the logic is active low. For active high logic as in this circuit, the actual operation is AND.

author: RFDx
author_rank: Regular Contributor
timestamp: April 24, 2024, 05:13:32 pm
content: XNOR gate with 2 transistors. Inputs must toggle between 5V and GND! LED is on when inputs are different and off when the same.

author: Ian.M
author_rank: Super Contributor
timestamp: April 24, 2024, 05:23:34 pm
content: That's clever, but the simplification makes it non-cascadable and, as you noted, not suitable for simple switch inputs. Add two input buffers and an inverter on the output, to get XOR rather than XNOR, and and you are back up to five transistors.

author: Zero999
author_rank: Super Contributor
timestamp: April 24, 2024, 09:51:31 pm
content: Is the output inverter needed? The OP has it pulling down an LED.I'd just stick a transistor on each input..

author: Ian.M
author_rank: Super Contributor
timestamp: April 24, 2024, 11:04:39 pm
content: Certainly that's another way of implementing an XNOR which is all you need if the load is active low.Before turning this into a Muntzing competition, please consider the need to maintain VOLand the implications for fan-in and fan-out. A possible target to aim for could be to match 74xx TTL, which had a fan-in of four in all of AND, NAND, OR, and NOR simple gates (and eight for the 7430 NAND) and a fan-out of ten. Obviously an unbuffered stacked BJT NAND is going to run into problems getting a low enough VOLif you try for many more inputs.

author: amyk
author_rank: Super Contributor
timestamp: April 25, 2024, 04:11:37 am
content: Here is what a real RTL NOR gate looks like, from a 1968 databook.They wouldn't use that many transistors if they didn't need to. Transistors were much more expensive back then too!