Week 2
Binary Logic and Logic Gates
Week 2: Boolean Logic and Logic Gates
Learning Outcomes
1. Describe the logical operators using truth tables
2. Recognize the different graphical symbols associated with the logical operators
3. Evaluate the output of a simple logic circuit.
Week 2: Binary Logic and Logic Gates
Binary Logic
• Consists of binary variables and logical operators
• Variables are designated by letters of the alphabet and have only two possible values:
1 and 0
• Three basic logical operations: AND, OR, and NOT, each resulting in one binary value
• A truth table or a Boolean equation can be used to describe the relationship between
inputs and the output.
Week 2: Binary Logic and Logic Gates
AND Operation
• Represented by a dot, or the absence of a dot
• The output is 1 if and only if both inputs are 1
• Below is the truth table of the AND operations with 𝑥 and 𝑦 being input variables,
and 𝑧 being output variable
• The number of rows indicates the number of possible combinations of inputs and
corresponding outputs.
𝒙 𝒚 𝒛 = 𝒙𝒚
0 0 0
0 1 0
1 0 0
1 1 1
Week 2: Binary Logic and Logic Gates
OR Operation
• Represented by a plus sign
• The output is 1 if either input, or both inputs, is 1. The output is 0 if both inputs are 0
• Below is the truth table for the OR operation, with 𝑥 and 𝑦 being inputs, and 𝑧 being
output
𝒙 𝒚 𝒛=𝒙+𝒚
0 0 0
0 1 1
1 0 1
1 1 1
Week 2: Binary Logic and Logic Gates
NOT Operation
• Represented by a prime or an overbar, e.g. 𝑧 = 𝑥′ or 𝑧 = 𝑥ҧ
• It negates or complements the input variable so that if the input is 1, the output is 0,
and if the input is 0, the output is 1
• Below is the truth table of the NOT operation, where 𝑥 is the input, and 𝑧 is the
output.
𝒙 𝒛 = 𝒙′
0 1
1 0
Week 2: Binary Logic and Logic Gates
Other Logic Operations
• NAND operation – AND followed by a NOT operation. The output is the negation of
the AND operation.
• NOR operation – OR followed by a NOT operation. The output is the negation of the
OR operation
• XOR operation – Exclusive-OR operation. The output is 1 if and only if either input
(not both!) is 1.
• XNOR operation – Exclusive-OR operation followed by a NOT operation. The output
is the negation of the XOR operation 𝒙 𝒚 𝒛 = (𝒙𝒚)′ 𝒛 = (𝒙 + 𝒚)′ 𝒛 = 𝒙 ⊕ 𝒚 𝒛 = (𝒙 ⊕ 𝒚)′
0 0 1 1 0 1
0 1 1 0 1 0
1 0 1 0 1 0
1 1 0 0 0 1
Week 2: Binary Logic and Logic Gates
Graphical Symbols of Logic Gates
The AND gate: The NAND gate:
The OR gate: The NOR gate:
The NOT gate: The Buffer gate:
The XOR gate: The XNOR gate:
Week 2: Binary Logic and Logic Gates
Combinational Circuits
• Made of one or more interconnected logic gates
• The output is immediately produced when
input values change
• Requires analysis of individual gate’s inputs and
output until the final gate that will determine
𝒙 𝒚 𝒛 𝒇= 𝒙+𝒚 𝒛
the output of the entire circuit
0 0 0 0
• The truth table is useful for tracing the signals 0 0 1 0
from the input to the output. 0 1 0 0
0 1 1 1
• There are 2𝑛 possible combinations of input 1 0 0 0
values, where 𝑛 is the number of input 1 0 1 1
variables. 1 1 0 0
1 1 1 1
• Example 𝑓 = 𝑥 + 𝑦 𝑧
Thank You!