Electrical – Implement AND gate multiple ways (positive & negative logic)

digital-logicnandnegative

Could somebody explain to me how how negative and positive logic works? If I have an AND gate the truth table will be

x y z
0 0 0
0 1 0
1 0 0
1 1 1

If I wanted to implement an AND gate another way, I know i can use De'Morgans law and convert it to an OR gate while inverting all the inputs/outputs. How does this work with a NAND gate? If i invert all the inputs/outputs I would get something that isn't the truth table as an AND gate

x y z
0 0 1
0 1 0
1 0 0
1 1 0

edit: Would the NAND gate use negative logic for output and positive logic for it's input to implement it as a AND gate?

Best Answer

Positive logic assigns logic '1' to high voltage and logic '0' to low voltage. Negative logic does the opposite ie. logic '1' = low voltage and logic '0' = high voltage.

A truth table only tells you the logic values, not the voltages that produce them. However if you are changing from positive to negative logic then logic '1' in positive logic translates to logic '0' in negative logic. So to convert a gate from positive to negative logic you just have to invert (negate) all the signals.

For example if you had a positive logic AND gate that you wanted to use in a negative logic circuit, you would have to put inverters on both the inputs and the output. That combination is then a negative logic AND gate, and its truth table (in negative logic) is the same as the bare AND gate was in positive logic. However its truth table in positive logic has all the '1's and '0's inverted.

De Morgan's law says that an AND gate with inverted output (ie a NAND gate) is equivalent to an OR gate with inverted inputs, and an AND gate with inverted inputs is equivalent to an OR gate with inverted output (ie. a NOR gate). This is useful when for example you only have NAND gates and need to create a NOR function, or you want to reduce the number of gates in a circuit.

Applying De Morgan's law will not change positive logic into negative logic, but it helps when you want to invert a lot of signals with the minimum number of gates. So your AND gate with 3 inverters could be converted to a NOR gate with one inverter on the output - which reduces the number of gates from 4 to 2.