2. Binary Logic and Gates
• Binary variables take on one of two values.
• Logical operators operate on binary values and
binary variables.
• Basic logical operators are the logic functions AND,
OR and NOT.
• Logic gates implement logic functions.
• Boolean Algebra: a useful mathematical system for
specifying and transforming logic functions.
• We study Boolean algebra as a foundation for
designing and analyzing digital systems!
Boolean Algebra and Logic
Gates 2
3. Boolean Variables and Values
A Boolean variable, usually denoted in
common letters, as a, b,..x. y etc can take
only two values 0 and 1.
So we can say x = 0 or x = 1 and y = 0 or y
= 1 but these are the ONLY values the
Boolean variables x and y can take.
3
4. Boolean functions
• A Boolean function F(x, y) takes Boolean
variables and outputs a Boolean value.
• For instance, we can have
F(x, y) = x + x.y where x and y are
Boolean variables.
• Again, F(x, y) = xy’ as taken from the Unit
notes
4
5. Logical Operators
• In the last slide, we had the Boolean
function F(x, y) = x + x.y
• Does the function expression involve
operators?
5
7. Logical Operators
• Logical operators operate on
binary values and binary variables.
• For instance 0.1 = 0 and 1 + 1 = 1
so we have to learn a new
arithmetic!
7
8. George Boole (1815-1864)
8
George Boole was
a largely self-taught
English
mathematician,
philosopher and
logician, most of
whose short career
was spent as the
first professor of
mathematics at
Queen's College,
Cork in Ireland.
10. Boolean Single Value Theorems
4–10
x 1 x + 1
0 1 1
1 1 1
We can prove the above assertions using
truth tables as follows:
How can you
interpret this
truth table?
11. 11
Absorption Law
Use a truth table to show that for two
Boolean variables x, y and z: x + xy = x
x y xy x + xy
0 0
0 1
1 0
1 1
12. 12
Absorption Law
Use a truth table to show that for two
Boolean variables x, y and z: x + xy = x
x y xy x + xy
0 0 0 0
0 1 0 0
1 0 0 1
1 1 1 1
15. Boolean Algebraic Proofs
• Our primary reason for doing proofs is to
learn:
– Careful and efficient use of the identities and
theorems of Boolean algebra, and
– How to choose the appropriate identity or
theorem to apply to make forward progress,
irrespective of the application.
Boolean Algebra and Logic
Gates 15
16. Boolean Algebra
16
Boolean algebra refers to symbolic manipulation of expressions made up of boolean
variables and boolean operators. The familiar identity, commutative, distributive, and
associative axioms from algebra define the axioms of Boolean algebra, along with the
two complementary axioms.
17. Use Boolean algebra to prove that: x + x · y = x
Proof Steps Justification
x + x · y
= x · 1 + x · y Identity element: x · 1 = x
= x · ( 1 + y) Distributive
= x · 1 1 + y = 1
= x Identity element
Boolean Algebra and Logic
Gates 17
19. Use Boolean algebra to show that (x + y) (x + z) = x + yz
19
Proof Steps Justification
(x + y)(x + z)
= x x + xz + yx + yz Expanding
= x + xz + yx + yz Idempotent Law of
Multiplication
= x + x (z + y) + yz Distributive Law
= x + yz Absorption Law
20. Use Boolean algebra to show that (x + y) (x + z) = x + yz
20
Proof Steps Justification
(x + y)(x + z)
= x + yz Absorption Law
21. Is it still true that: (x + y)(x + z) = x(x + z) + y (x + z)
21
x y z x + y x + z (x +y)(x + z) x(x + z) y(x + z) x(x+z)+y(x+z)
0 0 0
0 0 1
0 1 0
0 1 1
1 0 0
1 0 1
1 1 0
1 1 1
23. Boolean Functions
23
A Boolean function accepts binary inputs and outputs a single
binary value.
A Boolean function is a mathematical function that maps
arguments to a value where the allowable values of range (the
function arguments) and domain (the function value) are just
one of two values, 0 or 1.
We usually denote Boolean functions as F(x, y) where x and y
are Boolean variables. We use truth tables to evaluate the
functions.
https://introcs.cs.princeton.edu/java/71boolean/
24. Boolean function
• We can define a Boolean function:
F(x, y) = (x AND y) OR (NOT x AND NOT y)
• We write: F(x, y, z) = xy + x’y’
• and then write a “truth table” for it:
24
x y x’ y’ xy x’y’ F(x, y ,z) = xy + x’y’)
0 0 1 1 0 1 1
0 1 1 0 0 0 0
1 0 0 1 0 0 0
1 1 0 0 1 0 1
• Finally, use gates to implement the function: F(x, y) = xy + x’y
• We use two AND gates and one OR gate.
25. Boolean function
• Another example:
F(x, y, z) = (x AND y AND (NOT z))
OR (x AND (NOT y) AND z)
OR ((NOT x) AND Y AND Z)
OR xyz
• We write this as:
F(x, y, z) = xyz’ + xy’z + x’yz + xyz
25
• Can this function be simplified?
• We can use the Boolean Expression Calculator to help with
this…
27. Logicly [logicly.ly]
The application “Logicly” can be used to simulate the circuit as
shown:
You can take a free trial and then either download it on your
computer to use it or use it online.
27
31. Minterms
A minterm, denoted by mi, where 0
≤ I < 2n, is a product (AND) of the n
variables in which each variable is
complemented if the value
assigned to it is 0, and
uncomplemented if it is 1.
We speak of the 1-minterms =
minterms for which the function F =
1 and 0-minterms, the minterms for
which the function F = 0.
Any Boolean function can be
expressed as a sum (OR) of its 1-
minterms. We write F(x, y z) = ∑(3, 5, 6, 7)
33. Boolean Function F(x, y, z) = x + yz
33
The truth table can show us all the outputs of F(x, y, z) for various
values of the inputs:.
x y z yz x + yz
0 0 0 0 m0 = 0
0 0 1 0 m1 = 0
0 1 0 0 m2 = 0
0 1 1 1 m3 = 1
1 0 0 0 m4 = 1
1 0 1 0 m5 = 1
1 1 0 0 m6 = 1
1 1 1 1 m7 = 1
So here we have F(x, y, z) = x’yz + xy’z’ + xy’z + xyz’ +xyz
37. 37
F(x, y, z) = x’yz + xy’z’ + xy’z + xyz’ +xyz = x + yz
How many gates does each of the expressions use?
38. Recall: (x + y) (x + z) = x + yz
and now we have
x + yz = x’yz + xy’z’ + xy’z + xyz’ +xyz
Is there a way to prove all this algebraically…
38
Proof Steps Justification
x’yz + xy’z’ + xy’z + xyz’ +xyz
= x’yz + xy’z’ + xy’z + xyz’ +xyz + xyz Idempotent
= (x’ + x) yz + xy (z + z’) + xy’(z + z’) Distributive
= yz + xy + xy’ Complement law
= x(y + y’) + yz Distributive Law
= x + yz Absorption law
39. Show that: x’yz + xy’z + xyz’ +xyz = xy + yz + + yz
39
Proof Steps Justification
x’yz + xy’z + xyz’ +xyz
= x’yz + xy’z + xyz’ +xyz +xyz + xyz Idempotent
= xy(z + z’) + xz (y + y’) + yz (x + x’) Distributive
= xy + yz + xz Complement law
40. We have seen that (x + y) (x + z) = x + yz
40
(x + y) (x + z) is a Product of Sums (POS)
expression
snd x + yz is a Sum of Products (SOP)
So F(x, y z) = (x + y)(x + z) = x + yz
Ie. The same function can be represented in
SOP or POS format.
41. Express the function F(x, y, z) = x + yz as a
POS expression.
41
Proof Steps Justification
x + yz
= x + x (z + y) + yz
= x + xz + xy + yz
= xx + xz + xy + yz
= (x + y)(x + z) as per required.
42. Definitions
42
The boolean expression that we construct is
known as the sum-of-products
representation is also known as the
disjunctive normal form of the function.
A boolean expression consisting entirely
either of minterm or maxterm is called
canonical expression.
43. 43
Express the Boolean function F(a, b, c) = (b + ac’)’(ab’ + c) in
Sum-of-Products form using Boolean algebra laws and
theorems. Express in the minimal expression.
F(a, b, c) = (b + ac’)’(ab’ + c)
= (b’)(ac’)’(ab’ + c) De Morgan’s Law
= b’(a’ + c)(ab’ + c) De Morgan’s law
= (a’b’ + b’c)(ab’ + c) Distributive Law
= a’b’ab’ + a’b’c + b’cab’ + b’cc
= a’b’c + ab’c + b’c
= b’c(a’ + a + 1)
= b’c
44. 44
We had earlier expressed the Boolean function F(a, b, c) = (b + ac’)’(ab’ +
c) in Sum-of-Products form using Boolean algebra laws and theorems.
Express this in canonical form.
F(a, b, c) = (b + ac’)’(ab’ + c)
a b c b’ c’ ac’ b + ac’ (b + ac’)’ ab’ ab’ + c F(a, b, c)
0 0 0 1 1 0 0 1 0 0 0
0 0 1 1 0 0 0 1 0 1 1
0 1 0 0 1 0 1 0 0 0 0
0 1 1 0 0 0 1 0 0 1 0
1 0 0 1 1 1 1 0 1 1 0
1 0 1 1 0 0 0 1 1 1 1
1 1 0 0 1 1 1 0 0 0 0
1 1 1 0 0 0 1 0 0 1 0
F(a, b, c) = a’b’c + ab’c
45. Canonical Form
• Express in canonical form…F(X, Y, Z) = X Y + Y ‘Z
X Y Z X Y Y’ Y ‘Z F = X Y + Y ‘Z
0 0 0 0 1 0 0
0 0 1 0 1 1 1
0 1 0 0 0 0 0
0 1 1 0 0 0 0
1 0 0 0 1 0 0
1 0 1 0 1 1 1
1 1 0 1 0 0 1
1 1 1 1 0 0 1
47. Claude Shannon
47
Shannon's work became the
foundation of digital circuit
design, as it became widely
known in the electrical
engineering community during
and after World War II. The
theoretical rigor of Shannon's
work superseded the ad hoc
methods that had prevailed
previously..
48. Boolean Algebra Simplification
Boolean Algebra and Logic
Gates 48
11 1 1
11 1 0
11 0 1
11 0 0
00 1 1
00 1 0
10 0 1
00 0 0
X Y Z F(x, y, z) From the minterms expansion, we have:
F(x, y, z) = x’y’z + xy’z’ +xy’z + xyz’ + xyz
= (x’ + x)y’z + xz’(y’ + y) + xyz
= y’z + xz’y’ + xz’y + xyz
= y’z + x(yz + yz’ + z’y’)
= y’z + x(yz + yz’ + (yz)’)
= y’z + x(1 + yz’)
= x + y’z
We can use the Boolean algebra laws to simplify a function. What is the
formula for F9x, y, z) from the following?
49. From the Boolean expression to the logic gate diagram…
Boolean Algebra and Logic
Gates 49
11 1 1
11 1 0
11 0 1
11 0 0
00 1 1
00 1 0
10 0 1
00 0 0
X Y Z F(x, y, z) F(x, y, z) = x’y’z + xy’z’ +xy’z + xyz’ + xyz
= (x’ + x)y’z + xz’(y’ + y) + xyz
= y’z + xz’y’ + xz’y + xyz
= y’z + x(yz + yz’ + z’y’)
= y’z + x(yz + yz’ + (yz)’)
= y’z + x(1 + yz’)
= x + y’z
We can use the Boolean algebra laws to simplify a function. What is the
formula for F9x, y, z) from the following?
X
Y F
Z