2
\$\begingroup\$

I'm looking for an IC or small circuit that implements the following truth table:

Input Output 1 Output 2
H H L
L L H
Z H H

Is this possible?

The purpose is to keep an SPI SS signal pulled high for two devices when the input is high-Z, and to otherwise select one of two devices. It would be possible to simply use an inverter but then one of the SS signals would always be active.

\$\endgroup\$
3
  • 1
    \$\begingroup\$ High-Z is a state of an output. An output is high-Z when both the output transistor to GND as well as the transistor to VCC are not conducting. You have to add a voltage divider of two resistors to set a certain voltage for the high-Z state. If the L-voltage is about 0 V and H-voltage about 3 V, the Z-voltage should be about 1.5 V using two equal resistors for the voltage divider. \$\endgroup\$
    – Uwe
    Commented Jan 22 at 9:17
  • \$\begingroup\$ It should be possible. However, I believe you have an X-Y problem, and are trying to solve problem X with Y but are asking how to implement Y. If you would ask what is the best way to solve your original problem X, there might be better solutions than trying to do it via Y. Please define your original problem of using SPI chips in your system. \$\endgroup\$
    – Justme
    Commented Jan 22 at 10:43
  • \$\begingroup\$ What propagation delay is allowed? 5 V logic or 3.3 V logic? \$\endgroup\$
    – Jens
    Commented Jan 22 at 21:52

1 Answer 1

5
\$\begingroup\$

If there's nothing else connected to the line, a circuit like this will do:

schematic

simulate this circuit – Schematic created using CircuitLab

Run simulation to see how it behaves.

Note that comparators are required, because the logic levels are non-standard. A simpler transistor-based version could be used, but probably takes as many or more components, even if resistor packs are considered.

If IN is not allowed to float (something else is pulling on it), or must meet valid logic threshold voltage otherwise (because other CMOS/TTL inputs are connected), another solution is required, or no solution may be possible.

I am assuming the tristate pin is available in isolation by itself.

\$\endgroup\$
1
  • \$\begingroup\$ Compared to the truth table in the question, I believe the OUT1 and OUT2 labels are reversed. \$\endgroup\$
    – Ben Voigt
    Commented Jan 22 at 19:33

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.