Reply to topic  [ 11 posts ] 
Logic Gates 
Author Message
I haven't seen my friends in so long
User avatar

Joined: Thu Apr 23, 2009 7:35 pm
Posts: 6580
Location: Getting there
Reply with quote
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...
Code:
             ---\
[battery]--<     >---[light]
            \---

... 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.

_________________
Oliver Foggin - iPhone Dev

JJW009 wrote:
The count will go up until they stop counting. That's the way counting works.


Doodle Sub!
Game Of Life

Image Image


Fri Nov 19, 2010 4:10 pm
Profile WWW
Spends far too much time on here

Joined: Thu Apr 23, 2009 6:12 pm
Posts: 2020
Location: Mute City
Reply with quote
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
Profile
I haven't seen my friends in so long
User avatar

Joined: Thu Apr 23, 2009 6:58 pm
Posts: 8767
Location: behind the sofa
Reply with quote
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
Profile WWW
Spends far too much time on here

Joined: Thu Apr 23, 2009 6:12 pm
Posts: 2020
Location: Mute City
Reply with quote
JJW009 wrote:
I'd say x-nor because the output is 1 when both switches are set the same.


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
Profile
I haven't seen my friends in so long
User avatar

Joined: Thu Apr 23, 2009 6:58 pm
Posts: 8767
Location: behind the sofa
Reply with quote
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
Profile WWW
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
Reply with quote
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
Profile
I haven't seen my friends in so long
User avatar

Joined: Thu Apr 23, 2009 6:58 pm
Posts: 8767
Location: behind the sofa
Reply with quote
dogbert10 wrote:
I don't think there is one as there is no arrangement of switches that corresponds to a 1 on each gate input.

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
Profile WWW
Has a life
User avatar

Joined: Fri Apr 24, 2009 12:34 pm
Posts: 98
Location: in The Village
Reply with quote
Yes, XOR or XNOR would work. Producing these logic functions from basic NANDs, NORS and inverters is rarely elegant though.

_________________
Image


Fri Nov 19, 2010 7:16 pm
Profile
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
Reply with quote
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
Profile
Has a life
User avatar

Joined: Fri Apr 24, 2009 12:34 pm
Posts: 98
Location: in The Village
Reply with quote
dogbert10 wrote:
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.


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.

_________________
Image


Fri Nov 19, 2010 8:31 pm
Profile
I haven't seen my friends in so long
User avatar

Joined: Thu Apr 23, 2009 6:58 pm
Posts: 8767
Location: behind the sofa
Reply with quote
dogbert10 wrote:
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.

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

Image

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
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 11 posts ] 

Who is online

Users browsing this forum: No registered users and 34 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software.