I am trying to build some basic circuits to figure out how things work (mostly for fun). This one caught me off-guard today.

I want to build a module with three pushbuttons. Each one turns its own LED on and switches two other LEDs off. Initially I made a little simulation in Circuit JS:


I haven't tried actually building it, but I presume it works. So the idea is that each pushbutton activates two "reset" inputs of other buttons' NOR latches.

I thought to simplify this circuit by using diodes instead of OR gates. However, when I changed one gate, I got the following:


Why so? I fail to understand how voltage can make it through the upper diode. Initially I thought that even a resistor and a ground connection isn't necessary in this case, and I can simply connect two diodes to a NOR latch. However, it seems that even a "proper" diode OR won't work here.

(Of course, maybe Circuit JS is just tricking me, but I trust it more than my knowledge in this case).

UPDATE. Thanks to TimWescott I made it work on a simulator. It seems that additional pulldown resistors were necessary. Here is the final build.

Final build

P.S. Original schematic, Diode version.

  • 2
    \$\begingroup\$ It looks like the tool is modeling real diodes and ideal gates, or possibly CMOS gates. Real diodes will conduct in reverse, somewhat -- without pull-down resistors on the anodes of the diodes, you may end up getting what you're seeing. Try putting \$100mathrm{k\Omega}\$ or even \$1\mathrm{M\Omega}\$ resistors from the diode anodes to ground, and see what happens. \$\endgroup\$
    – TimWescott
    Commented Apr 19, 2021 at 14:40
  • \$\begingroup\$ Thank you. I tried, but no difference. Also it shows that voltage behind the upper diode is almost 5V. However, do you think that the circuit should work OK in reality, and I should try building it for real? -- Oh, I am sorry, you said 'anodes' -- yes, it looks it did the trick! \$\endgroup\$ Commented Apr 19, 2021 at 15:04
  • \$\begingroup\$ As a service to future StackExchange users, please either edit your question to show what works (and I'll answer it), or answer your question with the schematic of what works, with that explanation about diodes leaking. \$\endgroup\$
    – TimWescott
    Commented Apr 19, 2021 at 15:36
  • \$\begingroup\$ Yep, sure, I'll add the scheme in a minute, so please add your answer. \$\endgroup\$ Commented Apr 19, 2021 at 15:39
  • 1
    \$\begingroup\$ There are more things to consider about edges and states tinyurl.com/yh4yocb7 \$\endgroup\$ Commented Apr 20, 2021 at 18:35

1 Answer 1


Your simulation software appears to be modeling ideal or CMOS gates, with infinite input impedance, and real diodes, with some reverse leakage current. Consequently, when you don't use the pull-down resistors, pressing a button lets the current leak backwards through a reverse-biased diode and turn another gate on.

In an actual circuit there may be enough leakage from circuit elements to ground so that this would work -- or maybe not. At any rate, if you're driving CMOS from a switch, it's a good idea to make sure that the voltage is asserted somehow, either with the switches as pullups and pulldown resistors, or with pullup resistors and the switches pulling down.

(Note that you've left the 100\$\mathrm{k\Omega}\$ pull-down resistors off of the path with the closed switch -- that'll bite you as soon as you open it and close one of the others).


Your Answer

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

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