I am trying to make a circuit using transistors that consist of an OR gate, but the output of the OR gate is used as B input.
As expected the LED should remain on as soon as an input is 1, and the output should remain 1 even after the input is 0. But I tried this circuit and it's not working.
What circuit would implement what I want, using transistors only (no ICs)?

This is my circuit which is not working:

enter image description here


2 Answers 2


You need to consider transistors as actual circuits rather than logical elements. Your second transistor has base and emitter connected which means that there will never be any base/emitter voltage, consequently no base/emitter current and it only provides the base/collector diode to external circuitry which is always reverse biased and blocks.

A single transistor cannot self-sustain since it would need to have both voltage and current amplification ≥ 1, but there is no such mode (common emitter configuration does amplify absolute voltage and current but inverts).

So you need two transistors alone for the self-sustaining part of the or gate. And then you need to find a suitable node in that circuit for the "other" input of the "gate".

  • 1
    \$\begingroup\$ Can you please elaborate what do you mean by using two transistors as self sustaining part \$\endgroup\$ Nov 21, 2022 at 15:30
  • \$\begingroup\$ @MuhammadUmerAsif Well, the answer by Tanner comes with a circuit diagram, containing two transistors in amplifying inverting configuration in a daisychain. I explained why you cannot get along with a single transistor for the holding part of your circuit. I don't quite see what you are missing. \$\endgroup\$
    – user107063
    Nov 21, 2022 at 17:56

Basically, the problem is that what you have there isn't an OR gate. An OR gate needs to have some way to convert a weak input signal into a strong output signal, and a transistor all by itself can't do that.

If you want to build your own logic gates, you'll need to build them according to some logic family. One good option is resistor–transistor logic. The most straightforward way to build a real OR gate is to build a NOR gate and a NOT gate and connect them together.

I've designed this circuit that should work. You can simulate this circuit at falstad.com.

A resistor–transistor logic circuit that implements an OR gate with one of its inputs connected to its output

The red circle on the right is an LED, and as you can see in the picture, it's currently turned on. The switch at the very top is the power switch; if you turn that off and on again, you'll see that the LED stays off. The switch on the left side is the A input switch; if you turn that off and on again, you'll see the LED turn on again and stay on.

I had to play around with the resistor values a bit to get this circuit to work. The 470 and 220 ohm resistors that are connected to the power rail are output resistors; if those are too large, then the gate will produce a weak output, and if they're too small, then they'll get too hot. The 2.2 kohm resistors that are connected to the inputs are input resistors; if those are too large, then the transistors will fail to turn on and off correctly, and if they're too small, then they'll load the output too much. I don't know what resistor values would be best, but these values seem to work okay.

  • 1
    \$\begingroup\$ An OR gate just needs to output a logic 1 if any input is logic 1. You can make an OR gate with two diodes and a resistor, 'weak' and 'strong' signals have nothing to do with it. \$\endgroup\$
    – GodJihyo
    Nov 21, 2022 at 14:26
  • \$\begingroup\$ @GodJihyo That's not quite true. Suppose that we define "logic 1" as a voltage of 3.3 V or higher. Then it's impossible to make something that "output[s] a logic 1 if any input is logic 1" with only diodes and resistors; if you feed, say, 3.6 V into a "diode OR" gate (which is a logic 1), then you'll get only 2.9 V out (which is not a logic 1). For some applications, the difference doesn't matter. For this application, it does. \$\endgroup\$ Nov 21, 2022 at 14:35
  • \$\begingroup\$ @GodJihyo Now that I think of it, I may be using the terminology wrong. To me, the phrase "OR gate" implies amplification—in order for something to count as an OR gate, it must be able to accept a relatively weak input signal (say, anything above 3.3 V) and produce a relatively strong output signal (say, something above 4 V). But maybe I'm wrong about that, and the standard definition of the phrase "OR gate" does include the thing that you can make out of diodes and a resistor. \$\endgroup\$ Nov 21, 2022 at 14:38
  • \$\begingroup\$ In any case, the asker is trying to make an "S latch" (an SR latch with no R input). You can make an S latch out of an amplifying OR gate; you can't make an S latch out of diodes and resistors. \$\endgroup\$ Nov 21, 2022 at 14:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.