Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Logic Gates
Digital Computers
➢It operates on data including numbers, letters, and symbols; that are expressed in binary
code—i.e. using only the two bits 0 and 1.
➢Simply, the manipulation of binary information is done by logic circuits called gates.
➢The logic gates work together to make decisions using Boolean algebra, which is based
on the algebraic system established by mathematician George Boole.
Boolean Algebra & Logic Gates
Boolean Algebra
➢ Boolean algebra is a mathematical system for the manipulation of variables that can
have one of two values.
5
Boolean Operators (AND, OR)
6
Boolean Operator
• The NOT operation is most often
designated by an over bar. It is sometimes
indicated by a prime mark ( „ ) or an
“elbow” ().
7
Boolean Function
• A Boolean function has
• At least one Boolean variable
• At least one Boolean operator
• At least one input from the set {0,1}.
8
Boolean Function
➢ A Boolean functions can be
completely described using a truth
table.
9
Boolean Function
➢As with common arithmetic,
Boolean operations have rules of
precedence.
10
Boolean Function
Find Truth Table for the following boolean functions
➢F(x, y) = xy + x‟y‟
11
Logic Gates
12
Logic Gates
• The Boolean functions are implemented as a logic circuits using Logic
Gates.
15
Logic Gates
➢Gates can have multiple inputs and more than one output.
➢A second output can be provided for the complement of the operation.
16
Logic Gates
➢The output of the XOR operation is true only when the values
of the inputs differ.
17
Logic Gates
➢Another very useful gate is the exclusive NOR (XOR) gate.
➢The output of the XOR operation is true only when the values
of the inputs do not differ.
18
Boolean Function & Logic Gates
➢Any boolean function can be represented using AND, OR and NOT
logic gates.
19
Boolean Function & Logic Gates
➢F(x, y) = (x+y).(x‟+y‟)
➢F(a, b) = (a‟+b).(a+b‟)
➢F(x, y, z) = (x+y+z)(x‟+y+z)(x+y‟+z)(x+y+z‟)(x‟+y‟+z‟)
20
Simplification
21
Digital Computers
➢The digital computers contain circuits that implement Boolean
functions.
➢The simpler that we can make a Boolean function, the smaller the
circuit.
➢Simpler circuits are cheaper to build, consume less power, and run faster
than complex circuits.
22
Implementation of a Boolean function
23
Simplified Implementation of a Boolean function
24
Definitions
F(x, y) = x.y + x‟.y‟
x y z Minterm
➢ Minterms are easy to denote using a truth
table. 0 0 0 0 x’y’z’ = m0
0 0 1 1 x’y’z = m1
➢ Example:
Assume 3 variables x, y, z 0 1 0 0 x’yz’ = m2
(order is fixed)
0 1 1 0 x’yz = m3
1 0 1 0 xy’z = m5
1 1 0 1 xyz’ = m6
1 1 1 0 xyz = m7
Maxterm
➢Maxterm: A sum term in which all the variables appear exactly
once, either complemented or un-complemented.
0 1 1 1 x’yz = m3 x+y’+z’= M3
➢ F(x, y, z) = (x+y+z’).(x’+y’+z)
1 0 0 1 xy’z’ = m4 x’+y+z = M4
1 0 1 1 xy’z = m5 x’+y+z’ = M5
1 1 0 0 xyz’ = m6 x’+y’+z = M6
1 1 1 1 xyz = m7 x’+y’+z’ = M7
Canonical Forms (Unique)
➢Any Boolean function F( ) can be expressed as a unique sum
of minterms OR a unique product of maxterms (under a
fixed variable ordering).
➢In other words, every Boolean function F() has two canonical
forms:
➢Canonical Sum-Of-Products (Sum of minterms)
➢Canonical Product-Of-Sums (Product of maxterms)
Canonical Forms (cont.)
➢Canonical Sum-Of-Products
➢The minterms included are those mj such that F( ) = 1 in row
j of the truth table for F( ).
➢Canonical Product-Of-Sums
➢The maxterms included are those Mj such that F( ) = 0 in
row j of the truth table for F( ).
Example
➢ Truth table for f1(a, b, c) at right a b c f1
0 0 0 0
➢ The canonical sum-of-products form for f1 is
0 0 1 1
f1(a, b, c) = m1 + m2 + m4 + m6 0 1 0 1
= a’b’c + a’bc’ + ab’c’ + abc’
0 1 1 0
f’1(a, b, c) = m0 + m3 + m5 + m7 1 0 0 1
= a’b’c’ + a’bc + ab’c + abc
1 0 1 0
1 1 0 1
1 1 1 0
Example
➢ Truth table for f1(a, b, c) at right a b c f1
0 0 0 0
➢ The canonical product-of-sums form for f1 is 0 0 1 1
f1(a, b, c) = M0 • M3 • M5 • M7
= (a+b+c)•(a+b’+c’)• (a’+b+c’)•(a’+b’+c’) 0 1 0 1
➢ f’1(a, b, c) = M1 • M2 • M4 • M6 0 1 1 0
= (a+b+c’)•(a+b’+c)• (a’+b+c)•(a’+b’+c)
1 0 0 1
1 0 1 0
1 1 0 1
1 1 1 0
Shorthand: ∑ and ∏
➢ f1(a, b, c) = m1 + m2 + m4 + m6 = ∑ m(1,2,4,6)
➢ f1(a, b, c) = M0 • M3 • M5 • M7 = ∏ M(0,3,5,7)
➢ Replace ∑ with ∏ (or vice versa) and replace those j’s that appeared in
the original form with those that do not.
➢ Example:
f1(a, b, c) = a’b’c + a’bc’ + ab’c’ + abc’
= m1 + m2 + m4 + m6
= ∑(1,2,4,6)
= ∏(0,3,5,7)
= (a+b+c)•(a+b’+c’)•(a’+b+c’)•(a’+b’+c’)
Find Boolean functions & Logic circuit
a b c f1 a b c f1
0 0 0 1 0 0 0 0
0 0 1 1 0 0 1 1
0 1 0 0 0 1 0 0
0 1 1 0 0 1 1 0
1 0 0 1 1 0 0 1
1 0 1 1 1 0 1 1
1 1 0 1 1 1 0 0
1 1 1 0 1 1 1 1
Find Boolean functions & Logic circuit
a b c f1 a b c f1
0 0 0 0 0 0 0 0
0 0 1 0 0 0 1 1
0 1 0 1 0 1 0 1
0 1 1 1 0 1 1 0
1 0 0 1 1 0 0 0
1 0 1 1 1 0 1 0
1 1 0 0 1 1 0 0
1 1 1 0 1 1 1 1
Standard Forms (NOT Unique)
➢ Standard forms are ―like” canonical forms, except that not all variables
necessarily appear in the individual product (SOP) or sum (POS) terms.
➢ Example:
f1(a, b, c) = a’b’c + bc’ + ac’
is a standard sum-of-products form
➢ f1(a,b, c) = (a+b+c)•(b’+c’)•(a’+c’)
is a standard product-of-sums form.
Simplification Karnaugh Maps
➢Karnaugh maps (K-maps) are graphical representations
of boolean functions.
➢Each cell is adjacent to three other cells (left or right or top or bottom or
edge wrap)
Three-Variable Map (cont.)
➢Groups of 1, 2, 4, 8 terms are possible.
Group of 1 term
Group of 2 terms
Group of 4 terms
Simplification
➢f1(x, y, z) = ∑ m(2, 3, 5, 7)
f1(x, y, z) = x’y + xz
➢f2(x, y, z) = ∑ m (0, 1, 2, 3, 6)
f2(x, y, z) = x’+yz’
Simplification
a bc 00 01 11 10
bc 0 1 1 1
a 00 01 11 10
1 1
0 1 1 1 1
1 1
1
Problems
➢f(x, y, z) = ∑ m(1, 2,4, 7)
➢f(x, y, z) = ∑ m (0,1,5,6,7)
➢f(x, y, z) = ∑ m (0,1,5,6,7)
➢f(x, y, z) = ∑ m (0,1,5,6,7)
➢f(x, y, z) = x’yz + xz
➢f(x, y, z) = x’y + xyz’ + xyz
➢f(x, y, z) = x’y’z + x’yz’ + xy’z’ + xyz
➢f(x, y, z) = x’yz + xy’z + xyz’ + xyz
Minimization as SOP using K-map
➢Enter 1s in the K-map for each product term in the
function
00 m0 m1 m3 m2
01 m4 m5 m7 m6
10 m8 m9 m11 m10
➢ Top cells are adjacent to bottom cells. Left-edge cells are adjacent to
right-edge cells.
➢ Note variable ordering (WXYZ).
Four-variable Map Simplification
➢One square represents a minterm of 4 literals.
cd
ab
1 1 1
1 1 1
1 1 1
1 1 1
1 1
1 1
1 1 1
1 1 1
f(A,B,C,D) = c’+b’d’+a’bd
Problems
➢f(w, x, y, z) = ∑ m(1, 2, 4, 7, 9, 10)
➢f(w, x, y, z) = ∑ m (0, 2, 6, 7, 10, 14, 15 )
55
Combinational Circuits
➢Combinational logic circuit produces a specified output at the instant
when input values are applied.
56
Combinational v/s Sequential Circuits
➢Combinational logic circuit produces a specified output at the instant
when input values are applied.
57
Sequential Circuit
58
Combinational v/s Sequential Circuits
59
Combinational Circuits
➢Combinational logic circuits give us many useful devices.
60
Half Adder
■ A combinational circuit that performs the addition of two bits is
known as half adder.
■ The truth table for the half adder is listed below:
S: Sum
C: Carry
S = m1 + m2 = x’y + xy’
C = m3 = xy
62
Implementation of Half-Adder
S = m1 + m2 = x’y + xy’
C = m3 = xy
63
Full-Adder
■ A combinational circuit that performs the addition of three bits is known
as Full adder.
■ It adds two significant bits and a previous carry.
64
Full-Adder’s Truth Table
S = m1 + m2 + m4 + m7
= x’y’z + x’yz’ + xy’z’ + xyz
C = m3 + m5 + m6 + m7
= x’yz + xy’z + xyz’ + xyz
65
Simplified Expressions using K-map
67
Another implementation
■ Full-adder can also be implemented with two half adders and one
OR gate.
68
Another implementation
■ Full-adder can also be implemented with two half adders and one
OR gate.
S = z ⊕ (x ⊕ y)
C = (x ⊕ y).z + xy
69
Another implementation
■ Full-adder can also implemented with two half adders and one
OR gate.
70
Block diagram of FA
71
Ripple-Carry Adders
• Half Adder adds two binary bits (Two significant bits).
• Full Adder adds three binary bits (Two significant bits and one carry
bit).
• The carry bit ―ripples‖ from one adder to the next; hence, this
configuration is called a Ripple-Carry Adder.
72
Ripple-Carry adder
■ This is also called Ripple
Carry Adder ,because of
the construction with
full adders are
connected in cascade.
73
4-Bit Ripple Carry Adder
74
4-Bit Ripple Carry Adder/Subtractor
75
Exercise
76
Carry Propagation
77
Carry Propagation
■ The Ripple-Carry Adder causes a unstable factor on carry bit, and produces a
longest propagation delay.
■ The signal from Ci to the output carry Ci+1, propagates through an AND and OR
gates, so, for an n-bit RCA, there are 2n gate levels for the carry to propagate
from input to output.
78
4-Bit Ripple adder
79
Carry Look-ahead Adder
■ Because the propagation delay will affect the output signals on
different time, so the signals are given enough time to get the
precise and stable outputs.
80
Carry Look-ahead Adder (The Sum Bit)
Pi = Ai⊕Bi Steady state value
Gi = AiBi Steady state value
S0 = P0⊕ C0
S1 = P1⊕C!
S2 = P2⊕C2
S3 = P3⊕C3 81
Carry Look-ahead Adder (The Carry Bit)
Pi = Ai⊕Bi Steady state value
Gi = AiBi Steady state value
C0 = input carry
83
Carry Look-ahead Adder (The Carry Bit)
Using the previous equations, All output carries for all
adders can be generated using A, B and C0 only.
84
Logic diagram of Carry look-ahead generator
■ C3 is propagated at the same time as C2 and C1.
85
4-bit Carry Lookahead Adder (CLA)
■ Delay time of n-bit CLAA = XOR + (AND + OR) + XOR
86
Exercise
87
Home-Assignment
88
Find logical function & Truth Table
F2 = AB + AC + BC;
T1 = A + B + C; T2 = ABC; T3 = F2’T1;
F1 = T 3 + T 2
89
Circuit Implementation of Logic Expressions:- Examples
90
Circuit Implementation of Logic Expressions:- Homework
91
Truth Tables: Find Output
92
Find Truth Table of the logic circuit
93
Example: Find the logic expression and fill up the truth table for the circuit below.
94
Homework: Find the logic expression and fill up the truth table for the circuit below.
95
Boolean Algebra (Examples)
Simplify the expressions given below. Use truth tables to verify your results.
96
Boolean Algebra (Examples - Cont.)
Simplify the expressions given below. Use truth tables to verify your results.
97
Boolean Algebra (Examples - Cont.)
Simplify the expression given below. Use truth tables to verify your results.
98
Boolean Algebra (Examples - Cont.)
Simplify the expression given below. Use truth tables to verify your results.
99
Thank You
100