Binary Logic
Binary Logic
The two states are also known as LOGIC HIGH STATE and LOGIC LOW STATE, respectively.
In this binary world, everything must be in one of the two possible states {TRUE, FALSE}.
We can perform various logical operations on these two states, for example AND, OR, NOT.
The result of AND operation is TRUE if and only if both the operands (statements) are TRUE.
The result of OR operation is TRUE if and only if any of the two operands (statements) are TRUE.
That means
FALSE AND FALSE = FALSE FALSE OR FALSE = FALSE
FALSE AND TRUE = FALSE FALSE OR TRUE = TRUE
TRUE AND FALSE = FALSE TRUE OR FALSE = TRUE
TRUE AND TRUE = TRUE TRUE OR TRUE = TRUE
Symbols:
Denote TRUE with the symbols 1 and
FALSE with the 0.
Let 𝑥, 𝑦, 𝑧 be binary variables which can take either of the two values: {TRUE, FALSE} i.e. {1,0}
Suppose 𝑧 = 𝑨𝑵𝑫(𝑥, 𝑦) = (𝑥 𝑨𝑵𝑫 𝑦) = (𝑥 ⋅ 𝑦) Suppose 𝑧 = 𝑶𝑹(𝑥, 𝑦) = (𝑥 𝑶𝑹 𝑦) = (𝑥 + 𝑦)
𝑧 will be 1 if and only if both 𝑥 and 𝑦 are 1. 𝑧 will be 1 if and only if at least one of 𝑥 and 𝑦 is 1.
We may summarize this using a table: We may summarize this using a table:
Arguments Result Arguments Result
𝒙 𝒚 𝒛 = (𝒙 ⋅ 𝒚) 𝒙 𝒚 𝒛 = (𝒙 + 𝒚)
0 0 0 0 0 0
0 1 0 0 1 1
1 0 0 1 0 1
1 1 1 1 1 1
This type of a table is known as a Truth Table This type of a table is known as a Truth Table
𝑥1 + 𝑥2 + 𝑥3 + ⋯ + 𝑥𝑛
= 𝑂𝑅(𝑥1 + 𝑥2 + 𝑥3 + ⋯ + 𝑥𝑛 )
= 𝑥1 𝑂𝑅 𝑥2 𝑂𝑅 𝑥3 … 𝑂𝑅 𝑥𝑛
= (((𝑥1 𝑂𝑅 𝑥2 ) 𝑂𝑅 𝑥3 ) … 𝑂𝑅 𝑥𝑛 )
1 𝑖𝑓 𝒂𝒏𝒚 𝑜𝑓 𝑥1 , 𝑥2 , 𝑥3 , … , 𝑥𝑛 𝑎𝑟𝑒 1
={
0 𝑖𝑓 𝒂𝒍𝒍 𝑜𝑓 𝑥1 , 𝑥2 , 𝑥3 , … , 𝑥𝑛 𝑖𝑠 0
𝒙 ⋅ (𝒚 + 𝒛) = 𝒙 ⋅ 𝒚 + 𝒙 ⋅ 𝒛
Proof:
One way to proof it is through a truth table
𝒙 𝒚 𝒛 𝒙 ⋅ (𝒚 + 𝒛) 𝒙⋅𝒚+𝒙⋅𝒛
0 0 0 0 ⋅ (0 + 0) = 0 0 ⋅ 0 + 0 ⋅ 0 = 0
0 0 1 0 ⋅ (0 + 1) = 0 0 ⋅ 0 + 0 ⋅ 1 = 0
0 1 0 0 ⋅ (1 + 0) = 0 0 ⋅ 1 + 0 ⋅ 0 = 0
0 1 1 0 ⋅ (1 + 1) = 0 0 ⋅ 1 + 0 ⋅ 1 = 0
1 0 0 1 ⋅ (0 + 0) = 0 1 ⋅ 0 + 1 ⋅ 0 = 0
1 0 1 1 ⋅ (0 + 1) = 1 1 ⋅ 0 + 1 ⋅ 1 = 1
1 1 0 1 ⋅ (1 + 0) = 1 1 ⋅ 1 + 1 ⋅ 0 = 1
1 1 1 1 ⋅ (1 + 1) = 1 1 ⋅ 1 + 1 ⋅ 1 = 1
Last two columns are the same. That proves the statement.
Example: 𝑥 + 𝑥𝑦 = 𝑥
Proof:
𝑥 + 𝑥𝑦
= 𝑥(𝑦 + 𝑦̅) + 𝑥𝑦
= 𝑥𝑦 + 𝑥𝑦̅ + 𝑥𝑦
= (𝑥𝑦 + 𝑥𝑦) + 𝑥𝑦̅
= 𝑥𝑦 + 𝑥𝑦̅
= 𝑥(𝑦 + 𝑦̅)
=𝑥⋅1
=𝑥
𝒙 + (𝒚 ⋅ 𝒛) = (𝒙 + 𝒚) ⋅ (𝒙 + 𝒛)
Proof:
(𝑥 + 𝑦) ⋅ (𝑥 + 𝑧)
= 𝑥𝑥 + 𝑦𝑥 + 𝑥𝑧 + 𝑦𝑧
= (𝑥 + 𝑥𝑦) + 𝑥𝑧 + 𝑦𝑧
= 𝑥 + 𝑥𝑧 + 𝑦𝑧
= 𝑥 + 𝑦𝑧
De Morgan's laws:
(1) ̅̅̅̅̅̅̅̅
(𝒙 ⋅ 𝒚) = 𝒙
̅+𝒚 ̅ ̅̅̅̅̅̅̅̅̅̅
(2) (𝒙 ̅⋅𝒚
+ 𝒚) = 𝒙 ̅
⇒ ̅̅̅̅̅̅̅
𝑥̅ + 𝑦̅ = (𝑥 ⋅ 𝑦) ⇒ ̅̅̅̅̅̅
𝑥̅ ⋅ 𝑦̅ = (𝑥 + 𝑦)
Inputs Inputs
Output Output Input Output
= ̅̅̅̅̅̅
𝑥 ⋅ 𝑥 = 𝑥̅ = ̅̅̅̅̅̅̅
𝑥 + 𝑥 = 𝑥̅
Realizing a AND gate from NAND gates Realizing a AND gate from NOR gates
𝑥̅
𝑥⋅𝑦
̅̅̅̅̅̅
= ̅̅̅̅̅̅
𝑥⋅𝑦
=𝑥⋅𝑦
= ̅̅̅̅̅̅̅
𝑥̅ + 𝑦̅
=𝑥⋅𝑦
𝑦̅
Realizing a OR gate from NAND gates Realizing a OR gate from NOR gates
𝑥̅
̅̅̅̅̅̅̅
𝑥+𝑦
= ̅̅̅̅̅̅̅
𝑥+𝑦
=𝑥+𝑦
= ̅̅̅̅̅̅
𝑥̅ ⋅ 𝑦̅
=𝑥+𝑦
𝑦̅
More Logical operators:
XOR (Exclusive OR) XNOR
Definition: Definition:
𝑋𝑂𝑅(𝑥, 𝑦) = 𝑥 ⊕ 𝑦 = 𝑥𝑦̅ + 𝑥̅ 𝑦 𝑋𝑁𝑂𝑅(𝑥, 𝑦) = 𝑥 ⊙ 𝑦 = 𝑥𝑦 + 𝑥̅ 𝑦̅
𝑋𝑂𝑅(𝑥, 𝑦) is TRUE iff x and y are not equal 𝑋𝑁𝑂𝑅(𝑥, 𝑦) is TRUE iff x and y are equal
𝒙 𝒚 𝑥 ⊕ 𝑦 = 𝑥𝑦̅ + 𝑥̅ 𝑦 𝒙 𝒚 𝑥 ⊙ 𝑦 = 𝑥𝑦 + 𝑥̅ 𝑦̅
0 0 0 0 0 1
0 1 1 0 1 0
1 0 1 1 0 0
1 1 0 1 1 1
=𝑥⊕𝑦 =𝑥⊙𝑦
𝑋𝑂𝑅(𝑥1 , 𝑥2 , 𝑥3 , … , 𝑥𝑛 ) 𝑋𝑁𝑂𝑅(𝑥1 , 𝑥2 , 𝑥3 , … , 𝑥𝑛 )
= 𝑥1 ⊕ 𝑥2 ⊕ 𝑥3 ⊕ … ⊕ 𝑥𝑛 = 𝑥1 ̅̅̅
⊕ 𝑥2 ̅̅̅
⊕ 𝑥3 ̅̅̅
⊕ … ̅̅̅
⊕ 𝑥𝑛
= ((𝑥1 ⊕ 𝑥2 ) ⊕ 𝑥3 ) … ⊕ 𝑥𝑛 = 𝑥1 ⊙ 𝑥2 ⊙ 𝑥3 ⊙ … ⊙ 𝑥𝑛
The result will be true iff odd number of = ((𝑥1 ⊙ 𝑥2 ) ⊙ 𝑥3 ) … ⊙ 𝑥𝑛
arguments are true. The result will be true iff even number of
(Justify using method of induction) arguments are true.
(Justify using method of induction)
XNOR = NOT(XOR)
Binary logic is also known as the Boolean logic after the name of the mathematician George Boole.
Boolean functions
Suppose, 𝑤, 𝑥, 𝑦, and 𝑧 are binary (Boolean) variables and 𝑧 = (𝑤 + 𝑥̅ ⋅ 𝑦) ⊕ (𝑥 + 𝑦̅). Here the value of 𝑧
depends on the values of 𝑤, 𝑥, and 𝑦. We say 𝑧 is a Boolean function of 𝑤, 𝑥, and 𝑦. We may write 𝑧 =
𝑓(𝑤, 𝑥, 𝑦).
Minterms: Suppose, 𝑤, 𝑥, and 𝑦 are three independent Boolean variables. Minterms are some very special
Boolean functions as defined below:
𝑚0 = 𝑤̅𝑥̅ 𝑦̅
𝑚1 = 𝑤̅𝑥̅ 𝑦
𝑚2 = 𝑤̅𝑥𝑦̅
𝑚3 = 𝑤̅𝑥𝑦
𝑚4 = 𝑤𝑥̅ 𝑦̅
𝑚5 = 𝑤𝑥̅ 𝑦
𝑚6 = 𝑤𝑥𝑦̅
𝑚7 = 𝑤𝑥𝑦
n independent Boolean variables yield 2𝑛 minterms.
For a particular set of values of the independent variables, exactly one minterm becomes 1, the remaining
minterms become zero. This becomes clear in the truth table of the minterms shown below:
𝒘 𝒙 𝒚 𝑚0 𝑚1 𝑚2 𝑚3 𝑚4 𝑚5 𝑚6 𝑚7
=𝑤 ̅𝑥̅ 𝑦̅ =𝑤𝑥𝑦 = 𝑤 ̅𝑥𝑦̅ =𝑤𝑥𝑦 = 𝑤𝑥̅ 𝑦̅ = 𝑤𝑥̅ 𝑦 = 𝑤𝑥𝑦̅ = 𝑤𝑥𝑦
0 0 0 1 0 0 0 0 0 0 0
0 0 1 0 1 0 0 0 0 0 0
0 1 0 0 0 1 0 0 0 0 0
0 1 1 0 0 0 1 0 0 0 0
1 0 0 0 0 0 0 1 0 0 0
1 0 1 0 0 0 0 0 1 0 0
1 1 0 0 0 0 0 0 0 1 0
1 1 1 0 0 0 0 0 0 0 1
Again
𝑧 = 𝑀4 ⋅ 𝑀6 ⋅ 𝑀7 = (𝑤 ̅ + 𝑥 + 𝑦 )(𝑤
̅ + 𝑥̅ + 𝑦)(𝑤
̅ + 𝑥̅ + 𝑦̅ )
This form of expressing a Boolean function is known as Product Of Sums (POS) or Conjunctive Normal Form
(CNF).
The function 𝑧 expressed in SOP form through equation (2) can be realized through the following logical
circuit
The function 𝑧 expressed in POS form through equation (3) can be realized through the following logical
circuit
Duality, Consensus theorem