0

Question

This might be a naive question but hear me out, can't we just connect the two wires in parallel to build an OR gate? Like this:

schematic

simulate this circuit – Schematic created using CircuitLab

Attach maybe a resistor at the end to have a consistent value if needed.

Sujal Singh
  • 133
  • 5
  • 8
    You are shorting input 1 and 2 as well as the output. What will happen if you set input1 = HIGH and input2 = LOW? Will there be a contradiction? – Carl Sep 23 '22 at 16:29
  • 6
    Depends what's driving Input 1 and Input 2. Sometimes this is indeed all you need. – Finbarr Sep 23 '22 at 16:30
  • @Carl Again a naive guess but can I use a diode to not allow back current from one input to the other? – Sujal Singh Sep 23 '22 at 16:32
  • Sure, you can use two diodes. As long as output voltage does not decrease too much to be recognized as a high. Use open-collector outputs and a pull-up. Used a lot on Apollo computer. – StainlessSteelRat Sep 23 '22 at 16:44
  • 1
    Wired-OR is common in some places, for example it's practically the defacto standard for controlling the nRESET input on an MCU (inverted logic in that case, for reasons that are not important here). Open collector/open drain outputs are used with a (possibly internal) pull-up. – Spehro Pefhany Sep 23 '22 at 18:06
  • 2
    A logic zero is not the absence of an output, nor is the it the absence of a logic one. – DKNguyen Sep 23 '22 at 18:52

2 Answers2

2

There's some excellent discussion here but, to summarize it a bit, aside from the "shorting inputs together" part, using an OR gate gives you output drive capability, and the possibility of some level of ESD protection, as well as better-defined transitions for indeterminate or slow inputs, all without the several-hundred mV diode drop.

vir
  • 14,718
  • 13
  • 28
2

The output of an OR-gate is HIGH, if just one if the inputs are HIGH. So the truth table is

$$\begin{smallmatrix}\begin{array}{rr|c} I_1 & I_2 & O\\ \hline 0 & 0 & 0\\ 0 & 1 & 1\\ 1 & 0 & 1\\ 1 & 1 & 1 \end{array}\end{smallmatrix}$$

In your diagram, you have shorted \$I_1\$ and \$I_2\$. This means that \$I_1\$ and \$I_2\$ will be at the same potential. But what if YOU force \$I_1\$ to be HIGH and \$I_2\$ to be LOW? You are forcing them to be at a different potential, but they have to be at the same potential... so we have a contradiction.

Even if we look past this, which input will dictate the output? If \$I_1\$ is HIGH and \$I_2\$ is LOW how can you possibly conclude what the output will be? You cannot combine multiple signals into a single node.

Carl
  • 3,646
  • 1
  • 14
  • 33