Professional Documents
Culture Documents
co
1
www.gradeup.co
DIGITAL LOGIC
1 BASICS
1. LOGIC OPERATIONS
In Boolean algebra, all the algebraic functions performed is logical. The AND, OR and NOT are
the basic operations that are performed in Boolean algebra. There are some derived operations
such as NAND, NOR, EX-OR, EX-NOR that are also performed in Boolean algebra.
1.1. NOT operation:
Symbol:
NOT
A ⎯⎯⎯⎯ → A or A (Complementation law)
Input Output
A Y=A
0 1
1 0
Switch diagram of NOT gate:
A buffer is a basic logic gate that passes its input, unchanged, to its output. Its
behaviour is the opposite of a NOT gate.
2
www.gradeup.co
The main purpose of a buffer is to regenerate the input, usually using a strong high
and a strong low. Buffers are also used to increase the propagation delay of circuits
by driving the large capacitive loads.
Input Output
0 0
1 1
Input Output
A B Y = AB
0 0 0
0 1 0
1 0 0
1 1 1
1.3. OR operation:
Symbol:
A + A = A, A + 0 = A, A + 1 = 1, A + A = 1
Truth table for OR operation:
Input Output
A B Y = A+B
0 0 0
0 1 1
1 0 1
1 1 1
3
www.gradeup.co
Example 1.1:
Reduce the combinational logic circuit shown figure such that the desired output can be
obtained using only one gate.
Solution:
P = A, Q = B, R = C
S = A· B · C
V = U = ABC
X=U+V+D
= ABC + ABC + D
=A+B+C+D
Enable:
Allow a signal to pass when the control signal is HIGH.
Prevent a signal from passing when the control signal is LOW.
4
www.gradeup.co
Disable:
Prevent a signal from passing when the control signal is HIGH.
Allow a signal to pass when the control signal is LOW.
Enable and Disable Functions:
AND and OR gates can both be used to enable or disable a transmitted waveform.
For a two input AND gate:
• One input is the signal and the other input is the enable pulse.
• The enable of an AND gate is high active. That is, when the enable is high the input
signal will appear on the output.
• When the AND gate enable input is low, the output will remain a constant low signal.
For a two input OR gate:
• A two OR gate can also be used with one input the desired signal and the other input
is the enable.
• The enable input an OR gate is low active. This means that the output will be copy of
the input signal when the enable is low.
• When the enable input of an OR gate is high, the output of the gate will be constant
high signal.
Example 1.2:
Show the control enable and disable outputs for AND and OR gate.
Solution:
Control ‘0’ disable
5
www.gradeup.co
a. Commutative Law:
The commutative law allows change in position of AND or OR variables. There are
two commutative laws.
A +B =B+ A
A B = B A
b. Associative Law:
( A + B ) + C = A + (B + C )
( A B ) C = A (B C )
1.5. Switch Diagram for AND/OR gate
The circuit shown below shows the switch representation of OR gate which is basically
the parallel connection of switches A and B.
The circuit shown below shows the switch representation of AND gate which is basically
the series connection of switches A and B.
6
www.gradeup.co
2. LOGIC GATES
A B Y = AB
0 0 1
0 1 1
1 0 1
1 1 0
7
www.gradeup.co
All the logic gate functions can be created using only NAND gates. Therefore, it is also
known as a Universal logic gate.
2.2. NOR gate:
A NOR gate is equivalent to OR gate followed by a NOT gate.
Symbol:
A B Y = A +B
0 0 1
0 1 0
1 0 0
1 1 0
8
www.gradeup.co
All the logic gate functions can be created using only NOR gates. Therefore, it is also
known as a Universal logic gate.
2.3. XOR gate:
Symbol of two input XOR gate
Input Output
A B Y=A⨁B
0 0 0
0 1 1
1 0 1
1 1 0
9
www.gradeup.co
Truth Table:
A B Y
0 0 0
0 1 1
1 0 1
1 1 0
(
Y = ( A + B) A + B )
= AB + AB
= A B
EX-OR Gate using basic Logic Gates:
NOR Gate:
y = A B
= AB + AB
= AB + A B + A A + BB
(
= (A + B) A + B )
10
www.gradeup.co
NAND Gate:
y = A B
= AB + AB
= AB + A B + A A + BB
(
= (A + B) A + B )
Implementing this using NAND Gates:
A B = AB + A B
Now:
For commutative law:
A B = AB + B A
and
B A = B A + AB
Since A B = B A
Therefore: EX-OR is commutative
11
www.gradeup.co
b. Associative Laws:
Symbolically, it can be written as follows as:
a(bc)=(ab)ca(bc)=(ab)c
a+(b+c)=(a+b)+c
let us assme EX-OR gate with three inputs A, B and C
there,
A (B C) = A (B C + B C)
= A (B C + B C) + B C + B C A
= A B C + A B C + (B + C).(C + B ) A
A = A
= A B C + A B C + (BC + B B + C C + C B ) A
= A B C + AB C + (BC + 0 + 0 + C B ) A A A = 0
= A B C + A B C + ABC + A B C
And
(A B) C = (AB + B A) C
= A B + B A C + (A B + B A) C
= A B + B A C + A B C + B A C
= A + B . B + A C + A B C + A B C
= (A + B ) . (B + A) C + A B C + A B C
= (AB + AA + B B + A B ) C + A B C + A B C
= (AB + 0 + 0 + A B )C + A B C + A B C
= A B C + A B C + ABC + A B C
Since; A (B C) = (A B) C
12
www.gradeup.co
Solution:
Output of 1 is F1 = x x = 0
Output of 2 is F2 = x 0 = x
Output of 3 is F = x x = 0
i.e. F = 0
2.4. X-NOR gate:
It is EX-OR gate followed by NOT gate.
It is also known as equality checking gate or coincidence logic gate.
Symbol for two input X-NOR gate
Input Output
A B Y=A⨀B
0 0 1
0 1 0
1 0 0
1 1 1
( )( )
A B = AB + AB = AB.AB = A + B A + B = AB + AB
The output of a two input EX-NOR gate is logic '1' when the inputs are same and a logic
'0' when they are different.
X-NOR equivalent circuit:
13
www.gradeup.co
Truth Table:
A B Y
0 0 1
0 1 0
1 0 0
1 1 1
Y = (A + B̄)(Ā + B̄)
= AB + ĀB̄
=A⊙B
14
www.gradeup.co
( A + B ) + C = A + (B + C )
( A B ) C = A (B C )
4.3. Distributive Law:
The distributive law allows factoring or multiplying out of expressions. There are two
distributive laws.
( A + B ) + C = A + (B + C )
( A B ) C = A (B C )
4.4. Idempotence Law:
Idempotence means the same value. These are two idempotence laws.
AA = A
A+A=A
4.5. Absorption Law:
There are two absorption laws.
A + AB = A (1 + B ) = A
A ( A + B) = A
AB + AC + BC = AB + AC
( A + B ) ( A + C ) (B + C ) = ( A + B ) ( A + C )
4.7. Involution Law:
This law states that, for any variable A
A = ( A ) = A
I.
A.B = A + B
II.
A + B = A.B
15
www.gradeup.co
The above two laws can be extended for 'n' variables as,
A1.A2.A3... + An = A1 + A2 + ...An
( ) (
Example 1.1: Prove that: ( A + B ) B + C ( C + A ) = ( A + B ) B + C . )
Solution: Taking L.H.S:
( A + B ) (B + C ) ( C + A )
( )
= AB + AC + BC ( C + A )
= ABC + AC + BC + AB + AC + ABC
= AC + BC + AB
( )
Now, R.H.S = ( A + B ) B + C = AB + AC + BC = L.H.S
Now, Interchanging the ‘+’ and ‘·’ operator in the given expression.
So, expression becomes x ( x + y ) = xy
1. A + 0 = A 7. A · A = A
2. A + 1 = 1 8. A · A = 0
3. A · 0 = 0 9. A = A
4. A · 1 = A 10. A + AB =
5. A + A = A 11. A + AB = A + B
6. A + A = 1 12. (A + B) (A + C) = A + BC
16
www.gradeup.co
Y = ABC + AB + AC
Y = AB + BC
SOP forms are used to write logical expression for the output becoming logic '1'.
Example 5.1:
A B C Y
0 0 0 0
0 0 1 0
0 1 0 0
0 1 1 1
1 0 0 0
1 0 1 1
1 1 0 1
1 1 1 1
( )(
Y = A + B + C BC + D )
Each individual term in standard POS form is called maxterm.
POS forms are used to write logical expression for output be coming logic '0'.
we get f(A, B, C) = πM(0, 1, 2, 4)
Y = M0.M1.M2.M4
( )( )(
Y = ( A + B + C) A + B + C A + B + C A + B + C )
∴ We can also conclude from Table 2 and from above equations:
if Y = Σm(3, 5, 6, 7) or Y = πM(0, 1, 2, 4)
17
www.gradeup.co
The K-map is a graphical method which provides a systematic method for simplifying the
18
www.gradeup.co
7. SIMPLIFICATION RULES
1. Construct the K-map and place 1's in those cells corresponding to the 1's in the truth table.
Place the 0's in the other cells.
2. Examine the map for adjacent 1's and loop those 1's which are not adjacent to any other
1's. These are called isolated 1's.
3. Next, look for those 1's which are adjacent to only one other 1. Loop any pair containing
such a 1.
4. Loop any octet even if it contains some 1's that have already been looped.
5. Loop any quad that contains one or more 1's which have not already been looped, making
sure to use the minimum number of loops.
6. Form the OR sum of all the terms generated by each loop.
Example 7.1: Simply a four variable logic function using K-map
f(A, B, C, D) = Σm(0, 1, 2, 4, 5, 6, 8, 9, 12, 13, 14) also implement the simplified expression
with AND-OR logic.
Solution:
19
www.gradeup.co
f = C + AD + BD
∴
octet quad − II quad − I
⇒ Gate implementation:
8. REDUNDANT GROUP
If all the 1's in a group are already involved in some other groups, then that group is caused
as a redundant group. A redundant group has to be eliminated, because it increases the no of
gates required.
The combinations for which the values of the expression are not specified are called don't care
conditions.
Example 9.1:
Simply the given equation in part (i) and (ii)
(i) In terms of SOP. and don't care conditions
f(A, B, C, D) = Σm(1, 3, 7, 11, 15) + d(0, 2, 5)
(ii) In terms of POS and don't care conditions.
f(A, B, C, D) = πM(4, 5, 6, 7, 8, 12) + d(1, 2, 3, 4, 11, 14)
Solution:
(i)
20
www.gradeup.co
(ii)
10.1. Implicants:
Implicants is a product term on the given function for that combination the function
output must be 1.
10.2. Prime Implicant (PI)
Prime implicant is a smallest possible product term of the given function,
10.3. Essential Prime Implicants (EPI)
EPI is a prime implicant it must cover at least one minterms, which is not covered by
other PI.
Example 10.1: For the given K-map, find Implicant, PI and EPI
Solution:
Here, total no of 1's = 5
∴ Implicants = 5
( )(
∴ Implicants = A B C . A B C ) ( ABC ) ( A B C )( ABC )
and prime implicant = AB, A C, AB, BC
PI = 4
EPI = 2
****
21
www.gradeup.co
22