You are on page 1of 20

Binary  Logic

Binary logic consists of binary variables and logical operations. The variables have only two
distinct values possible: 1 and 0. Logical operators when applied on two or more information, the
output received is in 1 and 0, and gives insight into the behaviour of the information. Three basic
logical operations: AND, OR, and NOT.
a) AND: Represented by dot or absence of an operator. Like, x.y=z ;or xy=z means that z=1 if
and only if x=1 and y=1. otherwise z=0.
b) OR: Represented by plus sign. Like, x+y=z means that z=1 if x=1 or y=1 or both x=1 and y=1.
If both x=0 and y=0, then z=0.
c) NOT: Complement operation. Represented by prime(x') or overbar(. Like, is read as ‘not x
equals to z’. It means, that if x=1, then z=0 and if x=0, then z=1.
A logic variable consists of only one value, either 0 or 1. So, in binary arithmetic, 1+1=10 but in
binary logic, 1+1= 1 (one OR one is equal to 1). For each value of input variables, the output
variable might have different output values. These combinations of possible input values, along
with the relation between input and output values, when listed together in a table, it is called a
truth table.
Logic Gates: Logic gates are electronic circuits that operate on one or more input signals to produce
an output signal. Symbols used to represent the gates are as follows. They may have more than two
inputs. AND Gate with three inputs, produces an output 1 if all the three inputs are one, and 0 if even
one of the inputs is 0. OR Gate with four input, produces output 1 if any of the input is 1, and output
becomes 0 if all the four inputs are 0.
Boolean Algebra and Logic gates
Boolean algebra is the branch of algebra in which the values of the variables are the truth
values true and false, 1 and 0 respectively; and it is used to analyse and simplify the digital (logic)
circuits. It deals with binary values and variables and logic operations. Boolean Algebra was
developed by George Boole in the year 1854. In 1904, E. V. Huntington formulated various
postulates that must be satisfied by a boolean algebraic system. These postulates are as follow:
1) Closure - A set S is closed with binary operator * if for every pair of elements of S, * specifies a
rule to obtain an element of S. Any boolean expression always follow closure with respect to binary
addition (+ operator) and binary multiplication (. operator). The result of any boolean expression is
either 0 or 1. So, it follow closure law with respect to the set (0, 1).
2) Identity - Set S is said to have an identity element with respect to binary operation * on S if there
exists an element e∈S with the property that e*x=x*e=x for every x ∈S. In a boolean system, the
identity element with respect to binary addition is 0 as for any boolean variable say x, x + 0 = 0 + x
= x. Similarly, the identity element with respect to binary multiplication is 1 as for any boolean
variable say x, x.1 = 1.x = x.
3) Commutative - Any boolean expression is commutative with respect to binary addition as well as
binary multiplication. Like if there are two boolean variables - x and y, then x + y = y + x. Similarly,
x.y = y.x.
4) Associative - Any boolean expression is also associative with respect to binary addition as well as
binary multiplication. Like if there are three boolean variables - x, y and z, then x + (y + z) = (x + y)
+ z. Similarly, x.(y.z) = (x.y).z.
5) Distributive - In boolean algebra, binary addition is distributive over binary multiplication and
binary multiplication is distributive over binary addition. So, if there are three boolean variables - x,
y and z, then x.(y + z) = (x.y) + (x.z). Similarly, x+(y.z) = (x+y). (x+z).
6) Inverse - The boolean algebra does not have additive or multiplicative inverse as there are no
subtraction and division operations in boolean algebra. Though, any boolean element say x, has a
complement x' such that x + x' = 1 and x.x' = 0.
Comparing Boolean algebra with arithmetic and ordinary algebra.
1. Huntington postulates don’t include the associative law, however, this holds for Boolean
algebra.

2. The distributive law of + over . is valid for Boolean algebra, but not for ordinary
algebra.

3. Postulate 5 defines an operator called complement that is not available in ordinary algebra.
4. Ordinary algebra deals with the real numbers. Boolean algebra deals with the as yet undefined
set of elements, B, in two-valued Boolean algebra.
5. Boolean algebra doesn’t have additive and multiplicative inverses; therefore, no subtraction or
division operations.
Prove the theorems algebraically, and also with the help of truth table.
Principle of Duality:
Duality property states that every algebraic expression deducible from the postulates of Boolean algebra remains
valid if the operators and identity elements are interchanged. If the dual of an algebraic expression is desired, we
simply interchange OR and AND operators and replace 1’s by 0’s and 0’s by 1’s. So if a statement is given to be true,
then its duality too will be true.
Eg: 1.0=0 is true
Then, interchanging 1 by 0’s and AND by OR, we have:
0+1=1, which is also true.
Eg: x+y=1
Then, x.y=0
Operator precedence:
Operator precedence for evaluating Boolean expressions is
(1) Paranthesis , (2) NOT, (3) AND, and (4) OR.
Eg: (x+y)’
Sol: First solve x+y
Next, calculate the complement: x’y’
Next, AND the results of x’ and y’
Boolean Functions:
A Boolean function describes the relationship between the binary variables, constants 0 and 1, and
operators. For any given value of the variables, function can either be equal to 0 or 1.
F= x+ y’z; F is 1 when x =1, or y’z=1 or both x=1 and y’z=1.
y’z=1 only when, y’=1 and z=1. Or, y=0 and z=1.
Boolean function can be represented in a truth table.
For, given n input variables(binary), there will be 2n combinations of input values, and function will
have either true or false values for each of the combination.
If n input variables given, then how many functions are possible?
Gate implementation for function given: F= x+y’z

x y z y’ y’z F=x+y’z
0 0 0 1 0 0
0 0 1 1 1 1
0 1 0 0 0 0
0 1 1 0 0 0
1 0 0 1 0 1
1 0 1 1 1 1
1 1 0 0 0 1
1 1 1 0 0 1

For a function with n variables, there would be 2n entries( 0 to 2n-1). Gate implementation:
x y z x’ y’ x’y’z x’yz xy’ F2=x’y’z+x’yz+xy’
Gate
0 0 0 1 1 0 0 0 0
implementation of
0 0 1 1 1 1 0 0 1
the function of : 0 1 0 1 0 0 0 0 0
F2=x’y’z+x’yz+xy’ 0 1 1 1 0 0 1 0 1
1 0 0 0 1 0 0 1 1
1 0 1 0 1 0 0 1 1
1 1 0 0 0 0 0 0 0
1 1 1 0 0 0 0 0 0
Simplification of Boolean function:
By applying identities of Boolean algebra, to reduce the number of variables required to represent
the number.
F2= x’y’z+x’yz+xy’
Simply function F:
F2= x’z(y’ +y) +xy’= x’z(1) +xy’ by, postulate 5a(Inverse Law)
= x’z+xy’ by postulate 2b(Identity law)
Therefore, after simplification, function F2= x’z+xy’
Gate implementation of the same function, after simplification:
Questions:
1. x(x’+y)
2. x+x’y
3. (x+y)(x+y’)
4. xy+x’z+yz
5. (x+y)(x’+z)(y+z)

Complement of a function: To derive complement of a function, using Demorgan’s law:


Complement of (A+B+C):
(A+B+C)’. Let, B+C=x; then,
(A+x)’= A’.x’(by Demorgan’s laws)
=A’(B+C)’= A’ (B’C’) (by Demorgan’s law)
=A’B’C’(associative law)

Q. Calculate the following:


i) F1’=(x’yz’+x’y’z)’
ii) F2’=[x(y’z’+yz)]’
Complement of a function
Using De Morgan’s law, complement (A+B+C):
(A+B+C)’= (A+x)’ , Let B+C=x;
=A’x’, using DeMorgan’s Law
=A’(B+C)’, substituting B+C=x
=A’(B’C’), using DeMorgan’s Law
=A’B’C’
Using Dual: (A+B+C)’
First taking dual: A.B.C
Complementing each literal: A’B’C’
Therefore, (A+B+C)’=A’B’C’
Canonical Forms
Minterms: When input variables are ANDed, with the condition that the variables are primed when
the corresponding bit is 0, and unprimed when the corresponding bit is 1. Eg, x’y’z’ is minterm
corresponding to the combination: x=0, y=0, z=0.

Maxterms: When input variables are ORed, with the condition that the variables are primed when the
corresponding bit is 1, and unprimed when the corresponding bit is 0. Eg, x+y+z is maxterm
corresponding to the combination: x=0, y=0, z=0.
Q. Express Boolean function F=A+B’C as a sum of minterms.
Sol. Way one:
F=A(B+B’)(C+C’)+B’C(A+A’)
=A(BC+BC’+B’C+B’C’) + B’C(A+A’)
=ABC+ABC’+AB’C+AB’C’+AB’C+A’B’C
=ABC+ABC’+AB’C+AB’C’+A’B’C
=m1+m4+m5+m6+m7, from the truth table in previous represntation.
F(A,B,C)=Σ(1,4,5,6,7)
Way two: from the truth table. Add the minterms
corresponding the combinations for which F=1.
Q. Represent F=xy+x’z as product of maxterms.
Sol. xy+x’z=(xy+x’)(xy+z)
=(x+x’)(y+x’)(x+z)(y+z)
=(y+x’)(x+z)(y+z)
Since the literals don’t have all the variables each, to comprise maxterms, add the missing variables:
(y+x’)=(y+x’+zz’)=(x’+y+z)(x’+y+z’)
(x+z)=(x+z+yy’)=(x+y+z)(x+y’+z)
(y+z)=(y+z+xx’)=(x+y+z)(x’+y+z)
Therefore, (y+x’)(x+z)(y+z)=(x’+y+z)(x’+y+z’)(x+y+z)(x+y’+z)
F=π(0,2,4,5)
Standard forms:
There are two standard forms:
a)Sum of products: ORing the minterms
b)Product of Sums: ANDing the maxterms
Q. Convert F(A,B,C)= Σ(0,4,6) to Product of sums
Q. Convert F(A,B,C)= π(1,2,4,6) to sum of products
Q. How many Boolean functions possible with 3 variable, when exactly 3 minterms are equal to 1.
Digital logic gates

You might also like