# Logic Gates - How to show eight ways an AND function can be realized using negative and postivie logic [closed]

I am asked to use negative and positive logic (using bubbles on the gates) to show eight ways that an AND function can be realized. Im not too sure how to do this. The only way I can create an AND function is by using the Negative logic of the input and output of an OR gate. Does anyone know how to do this? I've been stuck here for quite a while now and browsing the web hasnt seem to have helped get an answer.

I'd really love it if somone could explain to me how to do this. Thanks in advance.

## closed as off-topic by Oleksandr R., Kuba♦, Michael E2, Sjoerd C. de Vries, ArtesJan 19 '15 at 14:38

• The question does not concern the technical computing software Mathematica by Wolfram Research. Please see the help center to find out about the topics that can be asked here.
If this question can be reworded to fit the rules in the help center, please edit the question.

• This has nothing to do with Mathematica. – David G. Stork Jan 19 '15 at 4:59
• Nothing to do with Mathematica. – Oleksandr R. Jan 19 '15 at 5:15
• Welcome! Could you please clarify if you are after a Mathematica solution? – Yves Klett Jan 19 '15 at 7:16

This sounds like something straight out of an undergrad EE course. If you're talking about circuits, the idea of positive and negative logic is in regard to the difference between the physical implementation of a gate and the logical Boolean operation it is meant to carry out.

A logical operation can be implemented with positive or negative logic, depending on how the signals are interpreted. In Mathematica, you could do something like this to chart the inputs and outputs of a logic function:

Grid[{{"A", "B", "And"}}~Join~
Flatten[Table[{x, y,
And[x, y]}, {x, {False, True}}, {y, {False, True}}], 1],
Frame -> All] /. {False -> "0", True -> "1"} If you chart the response of an OR function using negative logic, you can see that it returns the same output:

Grid[{{"A", "B", "Or"}}~Join~
Flatten[Table[{x, y,
Or[x, y]}, {x, {False, True}}, {y, {False, True}}], 1],
Frame -> All] /. {False -> "1", True -> "0"} and you can do something similar with Nand gates:

Grid[{{"A", "B", "Nand+Nand"}}~Join~
Flatten[Table[{x, y,
Nand[Nand[x, y], Nand[x, y]]}, {x, {False, True}}, {y, {False,
True}}], 1], Frame -> All] /. {False -> "0", True -> "1"} and with Nor gates:

Grid[{{"A", "B", "Nor"}}~Join~
Flatten[Table[{x, y,
Nor[Not@x, Not@y]}, {x, {False, True}}, {y, {False, True}}], 1],
Frame -> All] /. {False -> "1", True -> "0"} There are lots of ways to implement AND functionality by using different gates and negative or positive logic, but I'm pretty sure Mathematica includes all the logical functions you'll need to test to puzzle out the ones you don't know yet.

• Ive been trying all this while to figure out the rest. I found 1 more by using an AND gate where the inputs are in negative logic and the output is positve logic. I cant seem to find the others. Do you have any idea of what the others might be? – Nasus Jan 19 '15 at 5:37
• I added another example to get you going. – dionys Jan 19 '15 at 6:01
• Thanks alot. Could you tell me how did you figure this out? Maybe if i understand your thought process I can do it my self. – Nasus Jan 19 '15 at 6:03
• Each snippet above is just populating a table based on the given logic function, e.g. And[x,y],Or[x,y],Nand[Nand[x, y], Nand[x, y]]. You can read the Mathematica help to understand the commands and how the table is generated, but all you need to change in order to explore new logic functions is the third expression in the list given to the Table command. – dionys Jan 19 '15 at 6:19