You are on page 1of 48

1

Introduction to Digital Electronics


Boolean Algebra
2

Introduction to Digital Electronics


Boolean Algebra

Any system or device having two physically


distinct states can be described by Boolean
variables, such as

▪ 0/1
▪ True/False
▪ On /Off (Current/Logic Gates/Devices such as motors)
▪ High/Low (Voltage)
▪ Magnetized /Demagnetized (Hard Disk Platter)
▪ Light passes/Light does not pass (Punch Card Holes)
▪ Light reflects/Light does not reflect (DVD/Optical fiber)
3

Introduction to Digital Electronics


Boolean Algebra

General systems are either ‘static’ or ‘dynamic’

Examples are typical pressure, temperature measuring systems. They


always measure the current state of pressure/temperature and do not
depend on its past/future states.

For example, measuring instantaneous acceleration of a car. Any


given time, the instantaneous acceleration of a car depends on its
current speed and already accumulated acceleration from past (from
rest).
4

Introduction to Digital Electronics


Boolean Algebra
Boolean algebra can be used to describe ‘static’ systems.
❑ Binary representation of Boolean systems uses 1’s
and 0’s
❑ A Boolean variable or an expression can have a value
of either ‘1’ or ‘0’.
5

Introduction to Digital Electronics


Boolean Algebra

Systems described by Boolean algebra are digital


systems in contrast to analog systems
Boolean Algebra Operators and Boolean Gates 6
Gates Circuit Algebraic Operator Truth
Symbol Symbol Table

NOT 𝐹 = 𝐴ҧ or 𝐴′ or ! 𝐴 or ~𝐴

AND 𝐹 = 𝐴. 𝐵 or 𝐴𝐵 or 𝐴 ∗ 𝐵

OR 𝐹 =𝐴+𝐵

NAND 𝑭 = (𝑨. 𝑩)

NOR 𝑭= 𝑨+𝑩

XOR ഥ 𝑩 + 𝑨𝑩
𝑭=𝑨 ഥ

XNOR ഥ𝑩
𝑭 = 𝑨𝑩 + 𝑨 ഥ
6
7

Introduction to Digital Electronics


Boolean Algebra

Mapping is an alternative method to truth table for


presenting the output of the Boolean gates.

Mapping process:
1. Make a matrix with cells equal to the
total number of possible output.
2. Arrange the inputs along the edges of
the matrix.
3. Put the output corresponding to the
combination of the row-column
inputs into the cells.
8

Introduction to Digital Electronics


Boolean Algebra
▪ All the gates can be created with a series of NAND gates, or a series of
NOR gates.
▪ In a NAND gate,
(i) if the two inputs are shorted (joined together), one can have a
NOT (inverter) gate;
(ii) Adding an inverter to the output, one has an AND gate;
(iii) Inverting the inputs makes an OR gate.
▪ Theoretically, one could design an entire computer out of nothing but
NAND gates.
▪ NAND gate and NOR gate are called universal gates.
▪ NAND gates are used as a string of bits in flash storage (USB pen
drive)- NAND Flash has high density data storage capabilities.
9

Introduction to Digital Electronics


Boolean Algebra
NOT gate

AND gate

OR gate
10

Introduction to Digital Electronics


Boolean Algebra
Hierarchy of Boolean Operations
▪ Equations are written in the ‘normal’ way
▪ Hierarchy and parentheses usage are same as ‘ordinary’ algebra
▪ For gates, first NOT, then AND and lastly OR are in hierarchy.

Duality of Boolean Operators


▪ “duality of operators”, i.e., when in an expression
• all the AND is substituted by OR
• all the OR is substituted by AND
• All 1’s substituted by 0’s
• All 0’s substituted by 1’s
(note that these operations must be done simultaneously in the whole expression),
the value of the expression remains unchanged.
For example: 𝑨 + 𝟎 = 𝑨 has the dual identity 𝑨. 𝟏 = 𝑨.
Similarly, 𝑨 + 𝑨
ഥ = 𝟏 has its dual as 𝑨. 𝑨
ഥ=𝟎
11

Introduction to Digital Electronics


Boolean Algebra

De Morgan’s Therem
If the inputs are passed first through NOT gates and then through an OR gate, the final
output is the same as putting the inputs first through AND gate and then the output inverted
by a NOT gate, i.e., ഥ+𝑩
𝑨 ഥ = 𝑨. 𝑩

Using duality of operators, ഥ. 𝑩


𝑨 ഥ =𝑨+𝑩
12

Introduction to Digital Electronics


Boolean Algebra

12
13

Introduction to Digital Electronics


Boolean Algebra
Example Problems of Boolean Algebra
Example-1 Example-2 Example-3
𝐹 = 𝐴𝐵 + 𝐴𝐵′ 𝐹 = 𝐴𝐵 + 𝐴𝐵′ 𝐶 + 𝐴𝐵′ 𝐶′ 𝑋 = 𝐿𝑀𝑁 + 𝑀𝐿
= 𝐴(𝐵 + 𝐵′ )
= 𝐴(𝐵 + 𝐵′ 𝐶 + 𝐵′ 𝐶′) = 𝑀𝐿𝑁 + 𝑀𝐿
= 𝐴. 1
= 𝐴(𝐵 + 𝐵′ 𝐶 + 𝐶 ′ ) = 𝑀𝐿(𝑁 + 1)
=𝐴
Truth Table = 𝐴 𝐵 + 𝐵′ . 1 = 𝑀𝐿. 1
A B F=AB = 𝐴 𝐵 + 𝐵′ = 𝑀𝐿
+AB’
0 0 0 = 𝐴. 1

0 1 0 =𝐴
1 0 1
1 1 1
14

Introduction to Digital Electronics


Boolean Algebra
Example Problems of Boolean Algebra
Example-4 Example-5
𝐺 = 𝐴 + 𝐵 (𝐴 + 𝐵′ )(𝐴′ + 𝐵)(𝐴′ + 𝐵′ ) 𝑇 = 𝐴𝐵 + 𝐵(𝐵 + 𝐶′) + 𝐵′ 𝐶

= (𝐴 + 𝐵𝐵′ )(𝐴′ + 𝐵𝐵′ ) = 𝐴𝐵 + 𝐵𝐵 + 𝐵𝐶′ + 𝐵′ 𝐶 =

= (𝐴 + 0)(𝐴′ + 0) 𝐴𝐵 + 𝐵 + 𝐵𝐶 ′ + 𝐵′𝐶

= 𝐴. 𝐴′ = 𝐵 𝐴 + 1 + 𝐶 ′ + 𝐵′𝐶

=0 = 𝐵 𝑨 + 𝑪′ + 𝟏 + B′C

= 𝐵. 1 + 𝐵′ 𝐶

= 𝐵 + 𝐵′ 𝐶

=𝐵+𝐶
15

Introduction to Digital Electronics


Boolean Algebra
Example-6
ഥ. 𝑩
𝑿= 𝑨 ഥ. 𝑫
ഥ. 𝑪 ഥ +𝑨 ഥ. 𝑫
ഥ . 𝑩. 𝑪 ഥ

𝑿𝒙 ഥ. 𝑩
𝑿 = (𝑨 ഥ 𝑫) . ( 𝑨. 𝑩. 𝑪.
ഥ . 𝑪. ഥ 𝑫ഥ)

𝑋 = 𝐴ҧ + 𝑩 ഥ+𝑫
ഥ +𝑪 ഥ . (𝑨
ഥ+𝑩 ഥ+𝑫
ഥ +𝑪 ഥ)

𝑋 = 𝐴 + 𝐵 + 𝐶 + 𝐷 (𝐴 + 𝐵ത + 𝐶 + 𝐷)


𝑿= 𝒀+𝑩 . 𝒀+𝑩 [taking A+C+D=Y]

𝑋 = 𝑌 + 𝐵 . 𝑌 + 𝑌 + 𝐵 . 𝐵ത


ഥ + 𝑩𝑩
𝑋 = 𝑌𝑌 + 𝐵𝑌 + 𝑌B ഥ 𝒀+𝟎
= Y+ B+B

⇒ 𝑿 = 𝒀 + 𝟏. 𝒀 = 𝒀 + 𝒀 = 𝒀 = 𝑨 + 𝑪 + 𝑫
16

Introduction to Digital Electronics


Boolean Algebra

Example: Electronic Door Lock


17

Introduction to Digital Electronics


Boolean Algebra

(SOP)

variables.

▪ Treat ones in the truth table as uncomplemented variables,


and zeros as complemented variables.
▪ Drop terms corresponding to an output of zero in the truth
table
18

Introduction to Digital Electronics


Boolean Algebra
19

Introduction to Digital Electronics


Boolean Algebra

(POS)
▪ Treat zeros in the truth table as uncomplemented
variables, and ones as complemented variables.
▪ Drop terms corresponding to an output of one in the
truth table
L = (B1+B2). (B1+B2’). (B1’+B2). (B1’+B2’)

= (B1+B2). (B1+B2’). (B1’+B2’)

= [B1 B1 + B2′ + B2(B1 + B2′ )](B1′ + B2′ )

= (𝐵1 + 𝐵1. 𝐵2)(𝐵1′ + 𝐵2′ )

= 𝐵1′ 𝐵1 + 𝐵1. 𝐵2 + 𝐵2′(𝐵1 + 𝐵1. 𝐵2)

= 𝐵1′ . 𝐵1 + 𝐵1′ . 𝐵1. 𝐵2 + 𝐵2′ . 𝐵1 + 𝐵2′ . 𝐵1. 𝐵2

L = 𝐵1. 𝐵2
20

Introduction to Digital Electronics


Boolean Simplification Let’s simplify

= 𝐵1. 𝐵1. 𝐵2 + 𝐵2

= 𝐵1. 𝐵1. 𝐵2 + 𝐵1. 𝐵2 = 𝐵1. 𝐵2 + 𝐵1. 𝐵2

= 𝐵1. (𝐵2 + 𝐵2) = 𝐵1.1 = 𝐵1


𝑦 = 𝐵1
Let’s simplify

= 𝐵1. 𝐵1 + 𝐵2 + 𝐵2. (𝐵1 + 𝐵2)

= 𝐵1. 𝐵1 + 𝐵1. 𝐵2 + 𝐵1. 𝐵2

= 𝐵1 + 𝐵1. 𝐵2 + 𝐵1. 𝐵2

= 𝐵1 + 𝐵1. (𝐵2 + 𝐵2) = 𝐵1 + 𝐵1.1 = 𝐵1 + 𝐵1


𝑦 = 𝐵1
21

Introduction to Digital Electronics


Boolean Simplification

Let’s simplify

= 𝐵2. 𝐵1. 𝐵2 + 𝐵1

= 𝐵2. 𝐵1. 𝐵2 + 𝐵2. 𝐵1 = 𝐵2. 𝐵1 + 𝐵1. 𝐵2

= 𝐵2. (𝐵1 + 𝐵1) = 𝐵2.1 = 𝐵2


𝑦 = 𝐵2
22

Introduction to Digital Electronics


Boolean Algebra
23

Introduction to Digital Electronics


Boolean Simplification Binary Truth Table
S1 S2 S3 M

Device operation can often be


defined in a Truth Table as
follows:

OFF
OFF
ON ❖ Both S1 and S3
ON change values while
S2 remains fixed

ON ❖ The result of the


minimization should
ON be
M = S2
24

Introduction to Digital Electronics


(SOP)
S1 S2 S3 M 0
𝑀 = 𝑆1. 𝑆2. 𝑆3 + 𝑆1. 𝑆2. 𝑆3 + 𝑆1. 𝑆2. 𝑆3 + 𝑆1. 𝑆2. 𝑆3 +
𝑆1. 𝑆2. 𝑆3 + 𝑆1. 𝑆2. 𝑆3 + 𝑆1. 𝑆2. 𝑆3+S1. 𝑆2. 𝑆3

𝑀 = 𝑆1. 𝑆2. 𝑆3 + 𝑆1. 𝑆2. 𝑆3 + 𝑆1. 𝑆2. 𝑆3+S1. 𝑆2. 𝑆3

𝑀 = 𝑆1. 𝑆2(𝑆3 + 𝑆3) + 𝑆1. 𝑆2(𝑆3+S3)


𝑀 = 𝑆1. 𝑆2.1 + 𝑆1. 𝑆2.1

𝑀 = 𝑆1. 𝑆2 + 𝑆1. 𝑆2
𝑀 = 𝑆2(𝑆1 + 𝑆1)
𝑀 = 𝑆2.1
𝑀 = 𝑆2
25

Introduction to Digital Electronics


(POS)
S1
𝑀
S2 S3 M
= 𝑆1 + 𝑆2 + 𝑆3 . 𝑆1 + 𝑆2 + 𝑆3′ . 𝑆1 + 𝑆2′ + 𝑆3 . (𝑆1 + 𝑆2′
+ 𝑆3′ ). 𝑆1′ + 𝑆2 + 𝑆3 . 𝑆1′ + 𝑆2 + 𝑆3′ . 𝑆1′ + 𝑆2′ + 𝑆3 . (𝑆1′ + 𝑆2′
+ 𝑆3′ )
𝑀 = 𝑆1 + 𝑆2 + 𝑆3 . 𝑆1 + 𝑆2 + 𝑆3′ . 𝑆1′ + 𝑆2 + 𝑆3 . 𝑆1′ + 𝑆2 + 𝑆3′
Let, 𝑀 = 𝑋. 𝑌
𝑋 = (𝑆1 + 𝑆2). (𝑆1 + 𝑆2 + 𝑆3′ ) + 𝑆3. (𝑆1 + 𝑆2 + 𝑆3′ )
𝑋 = 𝑆1 + 𝑆2 + 𝑆3. 𝑆1 + 𝑆2 = 𝑆1 + 𝑆2 1 + 𝑆3 = 𝑆1 + 𝑆2
𝑋 = 𝑆1 + 𝑆2
𝑌 = 𝑆1′(𝑆1′ + 𝑆2 + 𝑆3′) + 𝑆2(𝑆1′ + 𝑆2 + 𝑆3′ ) + 𝑆3(𝑆1′ + 𝑆2 + 𝑆3′)
𝑌 = 𝑆1′ + 𝑆2 + 𝑆3 𝑆1′ + 𝑆2 = 𝑆1′ + 𝑆2
𝑀 = (𝑆1 + 𝑆2). (𝑆1′ + 𝑆2)
𝑀 = 𝑆1 𝑆1′ + 𝑆2 + 𝑆2 𝑆1′ + 𝑆2
𝑀 = 𝑆1𝑆2 + 𝑆2 = S2 1 + S3 = S2 𝑴 = 𝑺𝟐
26

Introduction to Digital Electronics


Boolean Algebra

K-Mapping (Karnaugh Mapping) Process:


1. Make a matrix with cells equal to the total number of possible output. For
example, for a 2 input system 22 = 4 cells, 3 input system 23=8 cells, 4 input
system 24= 16 cells, i.e., n input system 2n number of cells.

2. Arrange the inputs variables along the edges of the matrix. For 2 input variable
system, 1 input variable along the row and 1 input variable along the column;
For 3 input variable system, 1 input variable along the row and 2 input variables
along the column or vice versa; For 4 input variable system, 2 input variables
along the row and 2 input variables along the column or 1 input variable along
the row and 3 input variables along the column or vice versa.

Note that NO TWO input variables should change values simultaneously


while traversing between two adjacent cells either row-wise or column- wise.

For example, for 2 input variables along the row (or column) the values should
be taken as 00, 01, 11 and 10 sequentially.
For 3 input variable traverse, the sequence should be 000, 001, 011, 010, 110,
111, 101 and 100.
27

Introduction to Digital Electronics


Boolean Algebra

K-Mapping Process:
3. Put the outputs (0’s or 1’s) corresponding to the combination of the row-
column input variables into the cells.

4. Mark the large block(s) (rectangular or square) of 1’s in the output


matrix consisting 1, 2, 4, 8, 16….number of 1’s.

Multiple Blocks of 1’s can overlap each other.

5. For each block of 1’s, traverse both row-wise and column-wise and list the
input variable(s) which remain unchanged.

In the expression, write all the unchanged input variables for each block
AND-ing them together. If the value of the unchanged input variable is 0,
then write its compliment in the expression.

Unchanged input variables for each block are OR-ed with other block.
28

Introduction to Digital Electronics


Boolean Algebra

K-Mapping
S1 S2 S3 M

S1S2
Motor

S3

1. At first, a matrix is created with total cells of 8 equal to the number of possible output.
2. 1 input variable (S3) is arranged in the row and 2 input variables (S1 and S2) in the column
with their values in proper sequence.
3. Output values are put into the cells.
4. For the square block of 1’s, as row traversing is done, input variable S3 changes and as
column traversing is done, input variable S1 changes, while input variable S2 remains fixed.
5. The result of the minimization is M = S2
29

Introduction to Digital Electronics


Boolean Algebra

K-Mapping (Same example – different approach)


S1 S2 S3 M

S1S2S3 000 001 011 010 110 111 101 100

0 0 1 1 1 1 0 0

1. At first, a matrix is created with total cells of 8 equal to the number of possible output.
2. All 3 input variables (S1, S2 and S3) are arranged in the column with their values in proper sequence.
3. Output values are put into the cells.
4. For the rectangular block of 1’s, as column traversing is done, input variable S1 and input variable S3
change values, while input variable S2 remains fixed.
5. The result of the minimization is M = S2
30

Introduction to Digital Electronics


Boolean Algebra

K-Mapping (Same example – different approach)


S1 S2 S3 M
S1 0 1

S2S3 00 0 0

01 0 0

11 1 1

10 1 1

1. At first, a matrix is created with total cells of 8 equal to the number of possible output.
2. 2 input variables (S2 and S3) are arranged in the row with their values in proper sequence and 1
input variable (S1) in the column
3. Output values are put into the cells.
4. For the square block of 1’s, as column traversing is done, input variable S1 changes, while row
traversing done, input variable S3 changes, while input variable S2 remains fixed.
5. The result of the minimization is M = S2
31

Introduction to Digital Electronics


Boolean Algebra

Rules to remember for grouping in K-Mapping


(i) Groups may NOT include any cell containing a zero

(ii) Groups may be horizontal or vertical, but NOT diagonal


32

Introduction to Digital Electronics


Boolean Algebra

Rules to remember for grouping in K-Mapping


(iii) Groups must contain 1, 2, 4, 8, or in general 2n cells.
That is if n = 1, a group will contain two 1's since 21 = 2.
If n = 2, a group will contain four 1's since 22 = 4.
33

Introduction to Digital Electronics


Boolean Algebra

Rules to remember for grouping in K-Mapping


(iv) Each group should be as large as possible.

(v) Each cell containing a one must be in at least one group.


34

Introduction to Digital Electronics


Boolean Algebra

Rules to remember for grouping in K-Mapping


(vi) Groups may overlap.
35

Introduction to Digital Electronics


Boolean Algebra

Rules to remember for grouping in K-Mapping


(vii) Groups may wrap around the table. The leftmost cell in a row may be
grouped with the rightmost cell and the top cell in a column may be
grouped with the bottom cell.

(viii) There should be as few groups as possible, as long as this does not
contradict any of the previous rules.
36

Introduction to Digital Electronics


Boolean Algebra
Logic Circuit Simplification

Let’s consider the logic circuit below. Assuming the input signals “A”, “B”
and “C” are provided from switches, sensors or other gate circuits.
37

Introduction to Digital Electronics


Boolean Algebra
Logic Circuit Simplification

Step-1:
Write a Boolean expression for the output.
38

Introduction to Digital Electronics


Boolean Algebra
Logic Circuit Simplification
Step-2:
Simplify the Boolean expression for the output by using either
Boolean algebra or K-Mapping for reducing the number of
gates.
𝑄𝑄 = 𝐴𝐵 + 𝐵𝐶(𝐵 + 𝐶)
⇒ 𝑄 = 𝐴𝐵 + 𝐵𝐵𝐶 + 𝐵𝐶𝐶
𝑄 ⇒ 𝑄 = 𝐴𝐵 + 𝐵𝐶 + 𝐵𝐶
𝑄 ⇒ 𝑄 = 𝐴𝐵 + 𝐵𝐶
𝑄 ⇒ 𝑄 = 𝐵(𝐴 + 𝐶)
Step-3:
Draw the simplified logic circuits.
39

Introduction to Digital Electronics


Boolean Algebra
Logic Circuit Simplification
Step-4:
Check both the original and reduced circuits using truth table.
40

Introduction to Digital Electronics


Boolean Algebra
Logic Circuit Simplification
Another Example
Simplify the following circuit.

A+B
A 𝑄𝐹𝑄 = 𝐴 + 𝐵 . 𝐵 + 𝐶ҧ )
B
Q
B 𝑄𝐹𝑄 = 𝐴 + 𝐵 + (𝐵 + 𝐶)ҧ

C 𝑄𝐹𝑄 = 𝐴 + 𝐵 + 𝐵 + 𝐶ҧ
B+C
C
𝑄𝐹𝑄 = 𝐴 + 𝐵 + 𝐶ҧ
Simplified circuit.

A
B
Q
C
41

Introduction to Digital Electronics


Boolean Algebra
Logic Circuit Simplification
Yet Another Example
Simplify the following circuit.
𝐴𝐵ത ҧ + 𝐴𝐵
𝑄𝐹𝑄 = 𝐴𝐵ത + 𝐴𝐵
ҧ + 𝐴𝐵
𝑄𝐹𝑄 = 𝐴𝐵ത + 𝐴𝐵
ҧ
𝐴𝐵 Q ҧ 𝐴𝐵
ത 𝐴𝐵.
𝑄𝐹𝑄 = 𝐴𝐵.
ഥ + 𝐵 𝐴 + 𝐵ത 𝐴ҧ + 𝐵ത
𝑄𝐹𝑄 = A
𝐴𝐵
𝑄𝐹𝑄 = 𝐴.ҧ 𝐴 + 𝐵ത
𝑄𝐹𝑄 = 𝐴.ҧ 𝐴 + 𝐴ҧ𝐵ത
From Example-6:
𝑄𝐹𝑄 = 𝐴ҧ𝐵ത = 𝐴ҧ + 𝐵ത = 𝐴 + 𝐵
𝒀+𝑿 𝒀+𝑿 ഥ =𝒀

Simplified circuit.
𝑄
42
Introduction to Digital Electronics
Practice Problems

1. Show the universality of NAND and NOR gates.

2. Show the duality of Boolean Expression.

3. Simplify the following Boolean Expressions:

(i) 𝐴𝐵 + 𝐴𝐵𝐶 + 𝐴𝐵𝐶𝐷 + 𝐴𝐵𝐶𝐷𝐸 + 𝐴𝐵𝐶𝐷𝐸𝐹


(ii) 𝑋𝑍 + 𝑍(𝑋ത + 𝑋𝑌)
(iii) 𝐴 + 𝐵 + 𝐶 + (𝐴 + 𝐵 + 𝐶)(𝐷 + 𝐸)
(iv) 𝐴𝐵ത + 𝐴𝐵 ҧ 𝐴+𝐵
(v) 𝐴𝐵ത 𝐴 + 𝐶 + 𝐴𝐵. ҧ 𝐴 + 𝐵ത + 𝐶ҧ
(vi) 𝐴 + 𝐵ത + 𝐶 + 𝐷 . 𝐴 + 𝐵ത + 𝐶ҧ + 𝐷
43
Introduction to Digital Electronics
Practice Problems

4. Using SOP and/or POS, find the simplified Boolean


expression for the following control circuit:

Inputs Output
A B C X
0 0 0 0
0 0 1 1
0 1 0 0
0 1 1 1
1 0 0 0
1 0 1 1
1 1 0 0
1 1 1 1
44
Introduction to Digital Electronics
Practice Problems

5. Using k-map, find the Boolean expression for the following


control circuit:

(i)
45

Introduction to Digital Electronics


Practice Problems

(ii) (iii)
46

Introduction to Digital Electronics


Practice Problems

6. Draw the more simplified logic circuit of


the following::
(i)

B
Q

Note: XOR(A,B) is A'B + AB' and XNOR(A,B) is AB+A'B'


47

Introduction to Digital Electronics


Practice Problems

(ii)

X
48

Introduction to Digital Electronics


Practice Problems

(iii)

You might also like