Author |
Message |
Fogmeister
I haven't seen my friends in so long
Joined: Thu Apr 23, 2009 7:35 pm Posts: 6580 Location: Getting there
|
I learnt about logic gates and stuff at school but I asked my teacher a question that he couldn't answer. If you had a circuit thus... ... i.e. the setup of a light in the upstairs hall in a house with a light switch downstairs and upstairs. By pressing either switch it will alternate the state of the light. What would it be called as a logic gate? You can't really call it as two separate gates as the state of each alters the effect of each.
|
Fri Nov 19, 2010 4:10 pm |
|
 |
soddit112
Spends far too much time on here
Joined: Thu Apr 23, 2009 6:12 pm Posts: 2020 Location: Mute City
|
would that be an XOR? output is 1 when the inputs are dissimilar, and 0 when they are the same.
|
Fri Nov 19, 2010 4:37 pm |
|
 |
JJW009
I haven't seen my friends in so long
Joined: Thu Apr 23, 2009 6:58 pm Posts: 8767 Location: behind the sofa
|
I'd say x-nor because the output is 1 when both switches are set the same.
_________________jonbwfc's law: "In any forum thread someone will, no matter what the subject, mention Firefly." When you're feeling too silly for x404, youRwired.net
|
Fri Nov 19, 2010 5:45 pm |
|
 |
soddit112
Spends far too much time on here
Joined: Thu Apr 23, 2009 6:12 pm Posts: 2020 Location: Mute City
|
i dont think it would matter tremendously whether its an XOR or an XNOR gate in this example, as long as toggling either input also toggles the output. but i could be wrong 
|
Fri Nov 19, 2010 5:54 pm |
|
 |
JJW009
I haven't seen my friends in so long
Joined: Thu Apr 23, 2009 6:58 pm Posts: 8767 Location: behind the sofa
|
This is true, in reality.
If the diagram was labelled with 1s and 0s for an exam question, it would be more important.
_________________jonbwfc's law: "In any forum thread someone will, no matter what the subject, mention Firefly." When you're feeling too silly for x404, youRwired.net
|
Fri Nov 19, 2010 6:01 pm |
|
 |
dogbert10
Doesn't have much of a life
Joined: Thu Apr 23, 2009 8:23 pm Posts: 638 Location: 3959 miles from the centre of the Earth - give or take a bit
|
I don't think there is one as there is no arrangement of switches that corresponds to a 1 on each gate input.
_________________ i7 860 @ 3.5GHz, GTX275, 4GB DDR3
|
Fri Nov 19, 2010 6:07 pm |
|
 |
JJW009
I haven't seen my friends in so long
Joined: Thu Apr 23, 2009 6:58 pm Posts: 8767 Location: behind the sofa
|
The position of the switch represents the input. Consider an AND gate drawn the same way: Battery --- switch A --- switch B --- bulb The bulb is on if A and B are on. If each switch was a relay, then you'd have your electrical inputs. The thing to do is simply draw a table. For the original question, if you define "up" as a 1 then: A B Out 0 0 1 0 1 0 1 0 0 1 1 1
_________________jonbwfc's law: "In any forum thread someone will, no matter what the subject, mention Firefly." When you're feeling too silly for x404, youRwired.net
|
Fri Nov 19, 2010 6:21 pm |
|
 |
stu_1701
Has a life
Joined: Fri Apr 24, 2009 12:34 pm Posts: 98 Location: in The Village
|
Yes, XOR or XNOR would work. Producing these logic functions from basic NANDs, NORS and inverters is rarely elegant though.
_________________
|
Fri Nov 19, 2010 7:16 pm |
|
 |
dogbert10
Doesn't have much of a life
Joined: Thu Apr 23, 2009 8:23 pm Posts: 638 Location: 3959 miles from the centre of the Earth - give or take a bit
|
From what I understood, the switches aren't wired so that they both have to be closed for the light to be on (in which case they would resemble a gate), but are wired such that either one can turn the light on or off, and each switch can turn the light off if it's already on or on if it's off. If this is the case then there isn't a logic gate that meets that criteria.
_________________ i7 860 @ 3.5GHz, GTX275, 4GB DDR3
|
Fri Nov 19, 2010 7:48 pm |
|
 |
stu_1701
Has a life
Joined: Fri Apr 24, 2009 12:34 pm Posts: 98 Location: in The Village
|
Admittedly using logic gates would mean dissipating power 100% of the time as the gates need a supply, so it is far from the best solution. I know what you mean; it is probably some kind of relay system needed, similar to the way the same light in a house can be controlled by multiple switches.
_________________
|
Fri Nov 19, 2010 8:31 pm |
|
 |
JJW009
I haven't seen my friends in so long
Joined: Thu Apr 23, 2009 6:58 pm Posts: 8767 Location: behind the sofa
|
Yes there is. That's the exclusive nor, as everyone has pretty much agreed on. It's the one in the table I wrote. Whatever the state of the light (output), reversing the state of one of the switches (inputs) reverses it. There's probably a wiki. *looks* http://en.wikipedia.org/wiki/XNOR_gate Remember this is just an analogy meant to help you understand. Rarely would one use solid state logic to turn the landing light on...
_________________jonbwfc's law: "In any forum thread someone will, no matter what the subject, mention Firefly." When you're feeling too silly for x404, youRwired.net
|
Sat Nov 20, 2010 1:27 am |
|
|