x404.co.uk
http://www.x404.co.uk/forum/

Logic Gates
http://www.x404.co.uk/forum/viewtopic.php?f=3&t=11536
Page 1 of 1

Author:  Fogmeister [ Fri Nov 19, 2010 4:10 pm ]
Post subject:  Logic Gates

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.

Author:  soddit112 [ Fri Nov 19, 2010 4:37 pm ]
Post subject:  Re: Logic Gates

would that be an XOR? output is 1 when the inputs are dissimilar, and 0 when they are the same.

Author:  JJW009 [ Fri Nov 19, 2010 5:45 pm ]
Post subject:  Re: Logic Gates

I'd say x-nor because the output is 1 when both switches are set the same.

Author:  soddit112 [ Fri Nov 19, 2010 5:54 pm ]
Post subject:  Re: Logic Gates

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 :)

Author:  JJW009 [ Fri Nov 19, 2010 6:01 pm ]
Post subject:  Re: Logic Gates

This is true, in reality.

If the diagram was labelled with 1s and 0s for an exam question, it would be more important.

Author:  dogbert10 [ Fri Nov 19, 2010 6:07 pm ]
Post subject:  Re: Logic Gates

I don't think there is one as there is no arrangement of switches that corresponds to a 1 on each gate input.

Author:  JJW009 [ Fri Nov 19, 2010 6:21 pm ]
Post subject:  Re: Logic Gates

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

Author:  stu_1701 [ Fri Nov 19, 2010 7:16 pm ]
Post subject:  Re: Logic Gates

Yes, XOR or XNOR would work. Producing these logic functions from basic NANDs, NORS and inverters is rarely elegant though.

Author:  dogbert10 [ Fri Nov 19, 2010 7:48 pm ]
Post subject:  Re: Logic Gates

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.

Author:  stu_1701 [ Fri Nov 19, 2010 8:31 pm ]
Post subject:  Re: Logic Gates

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.

Author:  JJW009 [ Sat Nov 20, 2010 1:27 am ]
Post subject:  Re: Logic Gates

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

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/