# negative logic and positive logic gates

Why is AND gate equivalent of positive logic OR gate in negative logic?

I do not get why we express AND operation as OR gate in negative logic.

And what is the advantage of negative logic systems?

Why is AND gate equivalent of positive logic OR gate in negative logic?

There is no real 'why', it is simply the case. Take the truth table of an AND gate:

   0 0 => 0
0 1 => 0
1 0 => 0
1 1 => 1


Now invert all values (as if you place inverters on the two inputs and the one output):

   1 1 => 1
1 0 => 1
0 1 => 1
0 0 => 0


As you can see, this is the truth table of a OR gate.

If you want to think deeper, consider that an AND gate 'requires' all its inputs to be high to make its output high, a single low is sufficient to get a low on the output. You can almost hear the 'OR' logic in the last part of that sentence, but applied to 0's and resulting in a 0 at the output.

I do not get why we express AND operation as OR gate in negative logic.

That's not a question.

And what is the advantage of negative logic systems?

Logically speaking: none. But it can sometimes be enlighten the mind to think of a particular circuit in negative terms. And for electrical realizations of logic gates: the electronics do not care whether we call 0V a logic 0 or a logic 1.

The definition of a state being positive logic or being negative logic is arbitrary and is dependant upon how the inputs are defined. So thinking about the problem in only +'ve terms is misleading.

You choice the polarity of your logic based upon available logic gates and how easily you can express your problem. Sometimes certain gates are faster, smaller or even just available.

And simple logic (not electronic type - logic in general) tells you that some problems are easier when in the other logic. For example I want to determine if John is standing in the door way.

For positive logic it is easier to ask " is there a door way and is john standing in it"? rather than asking " (is the doorway missing and is John standing there) or ( is the door way missing and is john not standing there ) or (is there is a door way and is john not standing there) " much longer, much more confusing and in some cases nonsense.

For negative logic, imagine a teacher taking role count and the class is empty. It would be better for Her to ask "is the room empty" before starting rather than to read out names down the list.

While there is no logical advantage to negative logic, there are often practical engineering ones, according to the electronic devices you can manufacture.

When nowadays we can manufacture NMOS and PMOS transistors on the same chip (loosely speaking, NMOS can pull a signal to 0V while PMOS can pull a signal up to +V) that wasn't always the case - in bipolar transistor processes, it was easier to build fast NPN transistors; while PNP transistors were possible, they were slower or low power. And vacuum tubes were always the equivalent of NMOS - turning them on would pull a signal down.

(Ignoring details like source follower, emitter follower or cathode follower topologies with no voltage gain)

So there have been times when turning a gate ON meant pulling a signal LOW - and it was easier to reason about such circuits in negative logic.

As another answer says, some technologies like the TTL NAND gate allowed both AND and OR logic to be built using the same gate; understanding them required a certain flexibility to think in negative logic!

And negative logic persists today in a few areas, because of the desire to retain compatibility with older (sometimes MUCH older) circuits - it is still seen in many Reset circuits (frequently active-low) and DDR DRAM memory control signals among others.

Why is AND gate equivalent of positive logic OR gate in negative logic?

For a 2 input positive true AND gate, you can say: "Two highs make a high." and that'll describe its transfer function, but you can also say: "Any low makes a low.", which is just as accurate, and makes it the DeMorgan equivalent of an AND, a negative true OR gate.

And what is the advantage of negative logic systems?

Sometimes it's easier to visualize what's happening in a circuit if you think of it from a negative true point of view.

For example, these debouncers are identical, but it seems more intuitive - to me, anyway - to show the gates as negative true since "any low makes a high", and that's what the switch is providing.

Expressed in Boolean algebra, DeMorgan's theorm states that

$$(\overline {A + B)} = \overline {A} \dot\ \overline {B}$$

This is the truth table for $$(\overline {A + B)}$$

   0 0 => 1
0 1 => 0
1 0 => 0
1 1 => 0


and this is the truth table for $$\overline {A} \dot\ \overline {B}$$

   0 0 => 1
0 1 => 0
1 0 => 0
1 1 => 0


You can see the output is the same.

Logic designers rarely use negative logic systems per se, but they very often use a variant of it using NAND gates (AND followed by a NOT in one package) and NOR gates (OR followed by a NOT in one package) instead of AND and OR gates. The first truth table above is actualy a NOR gate. (You can see from the equation it is an inverted OR gate).

Re the advantage of negative logic systems: you can make any logic element (NOT, AND, OR, XOR, NOR and NAND) using a combination of only NAND gates or a combination of only NOR gates which reduces inventory. You can't do this with just AND and OR gates. For example, a NOT is just a NAND with both inputs tied together. An AND is a NAND followed by a NOT.

Trivia fact: The Apollo Guidance Computer was built exclusively using NOR gates.

• I realise this is a very old question, but it may be worth mentioning that using a mixture of these can make a schematic clearer: if I need a gate where a low OR a low generate a low, then I can draw it that way (to make my design intent clear) although it will end up being an AND gate in terms of what is ultimately placed on my PCB. This is sometimes known as assertion level logic. embedded.com/design/other/4023166/… – Peter Smith Apr 15 '16 at 13:07

I realize that this is an old question, and thoroughly answered already, but if someone else stumble upon it as I did via a search I'd like to add my view on the matter of the last part of the question:

And what is the advantage of negative logic systems?

As some have already mentioned there are equivalent circuits only made possible with negative logic. I'd like to say what this is useful for in practice. First we should realize that "negative logic" is the same logic as "positive logic", the only difference is that it concerns what happens when data is inverted. When we realize this it is easy to see straight up that for example an AND with all input and output inverted behaves as a OR. The list of equivalent gates can be made long, but we should not restrict us to lists since the gates in the lists can also be made from other gates and so forth. We should rather look at the gates we have at our hand for the moment and think what could be made of them. This have several benefits:

• you may not have the component you need at hand, and rather than waiting for it you would like to start right away
• you may have in use already at the same board components that you don't use to it's full extent, and rather than adding another component to a cramped board you might wish to emulate the logic of this component with the ones already there
• you may have a layout that is easier to accomplish if you don't criss cross your lines for several different components, but have to emulate the logic of one component with others in order to avoid it

I'm sure there are other practical reasons, but these are the ones I've encountered in my short time in amature electronics. If it's a matter of streamlining execution time or electricity resources then this is probably not the best way of doing things, but for small one off projects or design tests and prototyping it is really handy.