Rocco has a PhD. in Electrical Engineering, a graduate certificate in Cybersecurity, and has taught university Math, Physics, Engineering, and Computer Science.
Logic Truth Tables & Logic Gates
The three basic Boolean logic operations of AND, OR, and NOT are the most familiar in human language and the most intuitive to understand. To a computer, however, they are just a collection of binary truth tables. For a general logic gate with two inputs and a single output, there are 16 possible outcomes (2^4), two of which are covered by the AND and OR gates. The single-input NOT gate adds a 17th outcome. Figure 1 reviews the truth tables that correspond to the AND, OR, and NOT gates.
It is useful in practical digital systems design to have more truth table options to choose from. The NAND, NOR, and XOR gates add additional diversity to the set of binary truth tables and each have their own useful properties.
An error occurred trying to load this video.
Try refreshing the page, or contact customer support.
You must cCreate an account to continue watching
Register to view this lesson
As a member, you'll also get unlimited access to over 84,000 lessons in math, English, science, history, and more. Plus, get practice tests, quizzes, and personalized coaching to help you succeed.
Get unlimited access to over 84,000 lessons.Try it now
Already registered? Log in here for accessBack
NAND, NOR, and XOR Logic Gates
The negated AND operation, or NAND gate, is the binary complement of an AND operation:
NAND(X,Y) = NOT(AND(X,Y))
Since the NOT operation is invertible, this relationship can also be written as:
AND(X,Y) = NOT(NAND(X,Y))
Similarly, the NOR gate is defined as a negated OR operation:
NOR(X,Y) = NOT(OR(X,Y))
OR can also be expressed in terms of NOR:
OR(X,Y) = NOT(NOR(X,Y))
The definition of the OR operation is that it is TRUE if either input is TRUE. This includes the possibility that both inputs are TRUE. In contrast, the exclusive OR operation or XOR (sometimes called EOR) gate is TRUE if and only if a single input is true.
This relationship has two equally correct expressions in terms of the basic logic gates:
XOR(X,Y) = OR(AND(X, NOT(Y)),AND(NOT(X),Y)) = AND(OR(X,Y), OR(NOT(X), NOT(Y)))
The truth tables and distinctive shape set symbols are given for NAND, NOR, and XOR in Figure 2. It is readily evident that the outputs of NAND and NOR are the exact complement of AND and OR, respectively.
If the two inputs to a NAND gate are shorted together, as shown in Figure 3, the only relevant portions of the truth table are the ones for which the two inputs are equal.
This behavior is precisely equivalent to that of a negation operation. Thus, a NOT gate can be defined in terms of only a NAND gate.
NOT(X) = NAND(X,X)
This allows the AND gate to be reformulated in terms of only NAND gates.
AND(X,Y) = NAND(NAND(X,Y),NAND(X,Y))
An OR gate equivalent can also be constructed using only NAND gates, by putting two shorted (equivalent to NOT) NAND gates each at the input of a third NAND gate as shown in Figure 4.
This circuit corresponds to the following NAND-only equation:
OR(X,Y) = NAND(NAND(X,X),NAND(Y,Y))
A similar process can be repeated using only OR gates. It turns out that any logic gate can be emulated using only NAND gates or only NOR gates. This property is known as functional completeness. This means that an entire logic circuit can be built using only a single type of gate throughout the design. NAND and NOR gates also require the fewest number of transistors in their construction, making them an efficient choice for large microprocessors.
Let's take a few moments to review!
AND, OR, and NOT gates are the most fundamental logic gates because they relate to the three base operations of Boolean logic. Additional gates, however, like NAND, NOR, and XOR provide more design options for logic circuits with their unique truth tables. NAND and NOR gates are of particular interest because each can be used exclusively in a circuit to emulate the behavior of any other logic operation. This is called functional completeness.
To unlock this lesson you must be a Study.com Member.
Create your account
Register to view this lesson
Unlock Your Education
See for yourself why 30 million people use Study.com
Become a Study.com member and start learning now.Become a Member
Already a member? Log InBack
NAND, NOR & XOR Logic Gates
Related Study Materials
Explore our library of over 84,000 lessons
- College Courses
- High School Courses
- Other Courses
- Create a Goal
- Create custom courses
- Get your questions answered