Design the simplest switch circuit from given truth table

WBahn

Joined Mar 31, 2012
32,887
Your truth table is incomplete. With 2 variables, you have 4 possible combinations; and don't cares aren't valid for inputs.
Sure they are. Otherwise truth tables in data sheets would be huge and largely useless. Consider the truth table for like a something with eight inputs, do we really want to wade through a 256-entry truth table.

Here's the truth table for the 74LS90 counter from TI:

1665171224300.png

Ideally, any given combination of inputs will be covered by exactly one row in the table. But as long as every row that covers it has consistent outputs, that's okay.

For instance, in the above table if all four of those inputs are LO, all of the last four rows apply, but in all four instances, the output does the same thing.
 

WBahn

Joined Mar 31, 2012
32,887
I tried but could not find another truth table that fulfills my requirement. Maybe I was trying something impossible. Sorry for asking stupid question.
It's not stupid, just a sign that you haven't given enough careful that to what your actual requirements are. You still haven't given any information as to what those are.

Consider this: Do you want someone outside the room to be able to change the state of the bulb. If it's ON, they can flip the switch and turn it OFF, or if it's OFF they can flip the switch and turn it ON. Similarly, do you want the person inside the room to be able to change the state of the bulb by flipping their switch?

If so, you want a logical-XOR function which is implemented by the classic three-way switch that is commonly found at the top and bottom of a flight of stairs or at the ends of a hallway.

If you really want one person to be able force a situation regardless of what the other person does, you need to make some more careful decisions.

Do you want either person to be able to force the bulb ON, regardless of what the other person does? If so, you want a logical-OR function.

Do you want either person to be able to force the bulb OFF, regardless of what the other person does? If so, you want a logical-AND function.

If you want one person to be able to force it ON and the other person to be able to force it OFF, you have a conflict and you must explicitly decide which person should when if they are both trying to force the result their direction.
 

djsfantasi

Joined Apr 11, 2010
9,237
I tried but could not find another truth table that fulfills my requirement. Maybe I was trying something impossible. Sorry for asking stupid question.
You don’t need to find a truth table. You need to create one that shows what you want for all possible combinations of inputs. With two inputs (switches) there are four such combinations:
Off, Off​
Off, On​
On, Off​
On, On​
Let each column represent one switch (it doesn’t matter which), Then, what do you want the light to do in each row (situation)?
 

Jerry-Hat-Trick

Joined Aug 31, 2022
827
When the switch outside is ON, the bulb must be ON regardless of inside switch. And the bulb should be off if the switch inside is OFF regardless of outsides switch.
Going back to the beginning, I've broken your two line truth table into four lines so where you have "don't care" I've created two lines with the two options, 0 or 1. From that, it's immediately clear that my lines two and three conflict:
ABOut
111
101
100
000

I'm actually wondering if what you are trying to do is something like a state machine where the action of turning either A or B on or off has a different end result depending on the state of the light immediately before that action is taken? A table could then be constructed with eight lines which show all the permuations of A,B and Out, where each of these eight lines would be duplicated to form 16 lines and a similar table side by side where alternate lines would show either A or B changing (not both) and the corresponding Out that would occur. I could contruct and post this if it's along the lines of what you are looking for?

It's probably not as complex as this if my lines 1 and 4 are always correct - both switches on, light on - both switches off - light off.
 
Top