You are on page 1of 23

CHP 2

Boolean operations

EE202-Boolean Operations

BASIC LOGIC GATES


INTRODUCTION
Logic Gates are the basic building blocks for forming digital electronic circuitary.
A logic gate has one output terminal and one or more input terminals.
Its output will be HIGH (1) or LOW (0) depending on the digital level at the input terminal.
The SEVEN basic logic gates are AND,OR,NAND,NOR,NOT,XOR and
XNOR.
The operation of basic logic gates can be described with a Boolean expression.
Truth table is a table used to show the action of a device as it reacts to all possible input
combinations.
Timing Diagram is a diagram of waveforms showing the proper time relationship of all of
the waveforms.
Logic gates with a large number of inputs will have a large number of input combinations;
however the gates operation expression will still be the same.To calculate the number of
possible input combinations,the following formula can be use.
N = 2n

where : N = number of input combinations


n = number of inputs

(i) AND GATE

An AND gate can have two or more inputs but will always have a single output.

Table 2.1 shows the symbol, Boolean Expression and truth table for two input AND gate.

AND gate operation : Any LOW input will cause a LOW output and only when ALL inputs
are HIGH the output will be HIGH.

In Boolean Algebra the AND operation is indicated with a .. This . is also used to
indicate multiplication.

EE202-Boolean Operations
Table 2.1 : AND gate
LOGIC GATE

BOOLEAN
EXPRESSION

SYMBOL

X = A B
AND

TRUTH TABLE

A
0
0
1
1

B
0
1
0
1

X
0
0
0
1

AND gate timing diagram/waveform :

EXERCISE

Draw a symbol, write a boolean


expression and construct the truth
table for a three-input AND gate.
Lets Try!

EE202-Boolean Operations

(ii) OR GATE

The OR gate can have two or more inputs but will always have a single output.

Table 2.2 shows the symbol, Boolean Expression and truth table for two inputs OR gate.

OR gate operation : The OR gate produces a HIGH output if any input is HIGH; if all inputs
are LOW, the output is LOW.

In Boolen expression ,the + sign is used to indicate the OR operation.

Table 2.2 : OR gate


LOGIC GATE

SYMBOL

BOOLEAN
EXPRESSION

X = A+ B

OR

TRUTH TABLE
A
0
0
1
1

B
0
1
0
1

X
0
1
1
1

OR gate timing diagram/waveform :

EXERCISE

Draw a symbol, write a boolean


expression and construct the truth
table for a three-input OR gate.
Lets Do it!

EE202-Boolean Operations

(iii) NOT GATE

Also known as Inverter gate.

Not gate has only ONE input and ONE output.

Table 2.3 shows the symbol, Boolean Expression and truth table for NOT gate.

NOT gate operation : When the input is LOW, the output is HIGH; when the input is HIGH,
the output is LOW.
Table 2.3 : NOT gate

LOGIC GATE

BOOLEAN
EXPRESSION

SYMBOL

NOT

Y = A

TRUTH TABLE

A
0
1

Y
1
0

NOT gate timing diagram/waveform :

(IV) NAND GATE

The name NAND is a combination of the two words NOT and AND.

It contains and AND gate followed by a NOT gate.

Figure 2.1 : NAND equivalent circuit

Table 2.4 shows the symbol, Boolean Expression and truth table for two inputs NAND gate.

NAND gate operation : The NAND gate produces a LOW output when all inputs are
HIGH; otherwise, the output is HIGH.
5

EE202-Boolean Operations
Table 2.4 : NAND gate
LOGIC GATE

SYMBOL

BOOLEAN
EXPRESSION

X=

A.B

NAND

TRUTH TABLE
A
0
0
1
1

B
0
1
0
1

X
1
1
1
0

NAND gate timing diagram/waveform :

EXERCISE

Let do an exercise!
Draw a symbol, write a boolean
expression and construct the truth
table for a three-input NAND
gate.

EE202-Boolean Operations

(V) NOR GATE

The name NOR is a combination of the two words NOT and OR.

It contains and OR gate followed by a NOT gate.

Figure 2.2 : NOR equivalent circuit

Table 2.5 shows the symbol, Boolean Expression and truth table for two inputs NOR gate.
NOR gate operation : The NOR gate produces a LOW output if any input is HIGH; if all
inputs are LOW, the output is HIGH.

Table 2.5 : NOR gate


LOGIC GATE

SYMBOL

NOR

BOOLEAN
EXPRESSION

X=

A+ B

TRUTH TABLE
A
0
0
1
1

B
0
1
0
1

X
1
0
0
0

NOR gate timing diagram/waveform :

EE202-Boolean Operations

EXERCISE

Let do an exercise!
Draw a symbol, write a boolean
expression and construct the truth
table for a three-input NOR gate.

(VII) XOR ( Exclusive-OR)

XOR gate operation : The XOR gate produces a HIGH output only when both inputs are at
opposite logic levels.

Table 2.6 shows the symbol, Boolean Expression and truth table for two inputs XOR gate.

Table 2.6 : XOR gate


LOGIC GATE

SYMBOL

XOR

BOOLEAN
EXPRESSION

X = A B
= AB + A B

TRUTH TABLE

A
0
0
1
1

B
0
1
0
1

X
0
1
1
0

XOR gate timing diagram/waveform :

EE202-Boolean Operations

(VIII) XNOR (Exclusive-NOR)

XNOR gate is simply an XOR gate followed by a NOT gate as shown below :

Figure 2.3 : XNOR equivalent circuit

XNOR gate operation : The XNOR gate produces a HIGH output only when both inputs
are at the same logic level.

Table 2.7 shows the symbol, Boolean expression and truth table for two inputs XNOR gate.
Table 2.7 : XNOR Gate

LOGIC GATE

SYMBOL

XNOR

BOOLEAN
EXPRESSION

X = A B
= A B + AB

TRUTH TABLE
A
0
0
1
1

B
0
1
0
1

X
1
0
0
1

XNOR gate timing diagram/waveform :

EE202-Boolean Operations

UNIVERSAL GATES

A universal gate is a gate which can implement any Boolean function without need to
use any other gate type.

NAND and NOR gates are universal gates.

Table 2.8 below shows the NAND gate equivalents of NOT, AND and OR gates.

Table 2.8 : NAND gate equivalent

EXERCISE

Draw the logic circuit below to their


equivalents using NAND gates only.

10

EE202-Boolean Operations

COMBINATIONAL LOGIC CIRCUITS

Combinational logic employs the use of two or more of the basic logic gates to form a more
useful,complex function.

Example 1: Write the boolean expression for the logic circuit below.

Solution : X = A ( B + C )

Example 2 : Draw the logic circuit for the following Boolean expression.

Y = AB + C (M + N )

Solution :

EXERCISE

Construct a combinational logic circuit for


the following boolean expression:
M = ( PQ + RS )T
Lets do it!

11

EE202-Boolean Operations

BOOLEAN ALGEBRA
INTRODUCTION

Boolean Algebra : The mathematics of logic circuits.

Boolean Addition :

In Boolean algebra, a variable is a symbol used to represent an action, a


condition, or data. A single variable can only have a value of 1 or 0.

The complement represents the inverse of a variable and is indicated with an


overbar. Thus, the complement of A is A.

Addition is equivalent to the OR operation. The sum term is 1 if one or more if the
literals are 1. The sum term is zero only if each literal is 0.

Example : Determine the values of A, B, and C that make the sum term of the
expression A + B + C = 0

Solution : Each literal must = 0; therefore A = 1, B = 0 and C = 1.

Boolean Multiplication :

In Boolean algebra, multiplication is equivalent to the AND operation.

The product term will be 1 only if all of the literals are 1.

Example : What are the value of A, B and C if the product term of

A B C =1.

Solution : Each literal must = 1; therefore A = 1, B = 0 and C = 0.

12

EE202-Boolean Operations

BOOLEAN ALGEBRA RULES

OR Gate Rules

(1)

(2)

(3)

(4)

AND Gate Rules

(5)

(6)

(7)

(8)

13

EE202-Boolean Operations

Involution Rule

Double Inversion Rule state that if a variable is inverted twice,then the variable will be
back to its original state.

To state this algebraic,we use the double bar as follows :

A =

(9)

Rule No.10
A + AB

= A(1 + B )
= A

Rule No.11
A + AB = ( A + AB ) + AB
= ( AA + AB ) + AB
= AA + AB + A A + AB
= ( A + A)( A + B )
= 1 ( A + B)
= ( A + B)

14

EE202-Boolean Operations

BOOLEAN ALGEBRA LAWS

Commutative Law : Combining elements in such a manner that the result is independent
of the order in which the elements are taken.

A+B = B+ A

..(12)

AB = B A

..(13)

Associative Law : Combining elements such that when the order of the elements is
preserved,the result is independent of the grouping.

A + (B + C) = ( A + B) + C

A (B C) = ( A B) C

.(14)

..(15)

Distributive Law : Production the same element when operating on a whole as when
operating on each part and collecting the results.

A ( B + C ) = AB + AC
(W + X)(Y + Z) =WY+WZ+ XY+ XZ

.(16)

..(17)

De Morgans Theorems
o De Morgans First Theorem : The complement of a product of variables is equal
to the sum of the complemented variables.

A B = A + B

..(18)

15

EE202-Boolean Operations
o De Morgans Second Theorem : The complement of a sum of variables is equal
to the product of the complemented variables.
..(19)

A+ B = AB
o Example : Apply DeMorgans theorem to remove the overbar covering both terms
from the expression X = C + D
o Solution :
o Break the overbar covering both terms and change the sign between the
terms.
o The result is X = C D
o Deleting the double bar gives X = C D

Sum-of-Products and Product-of-Sums Expression

Sum-of-Product (SOP)
o

The Sum of Product (SOP) form represents an expression as a minterms.

A minterm is the product of N distinct literals where each literal occurs exactly
once.

To derive the SOP form from a truth table, OR together all of the minterms which
give a value of 1.

Example of SOP expression :


(i) X = AB + AC + ABC
(ii) Y = BCD + ABDE + C D

16

EE202-Boolean Operations
o

Example : Examine this truth table and then write SOP expression describing the
output.

OUTPUT (Y)

Solution :
A

OUTPUT (Y)

SOP

ABC

ABC

A BC

ABC

Answer : Y= ABC + ABC + ABC + ABC

17

EE202-Boolean Operations

Product-of-Sum (POS)
o

The Product of Sum (POS) form represents an expression as a product of


maxterms.

A maxterm is the sum of N distinct literals where each literal occurs exactly once.

To derive the POS form from truth table, AND together all of the maxterms which
give a value of 0.

Example of POS expression :


(i) X = ( A + B )( B + C )
(ii) Y = ( A + C )( B + E )(C + B )

Example : Examine this truth table and then write POS expression describing the
output.

OUTPUT (Y)

Solution :
A

OUTPUT (Y)

POS

A+ B +C

A+ B +C

A+ B +C

A+ B +C

Answer : Y = ( A + B + C ) ( A + B + C ) ( A + B + C ) ( A + B + C )

18

EE202-Boolean Operations

EXERCISE

Let do an exercise!
Develope the Boolean Expression from a
truth table in both SOP and POS forms.

SIMPLIFICATION OF COMBINATIONAL LOGIC CIRCUITS

Why we want to simplify a logic circuit?


o

A simplified circuits performs the same function but its smaller,easier to


construct,consumes less power and less costs.

(i) BY USING BOOLEAN ALGEBRA

Example 1 : Simplify the Boolean expression below by using Boolean algebra.

(i) X = B ( A + C ) + C
(ii) P = ABC + ABC + ABC

19

EE202-Boolean Operations

Solution :
(i)

X = B( A + C ) + C
= AB + BC + C

..(16)

= AB + C ( B + 1)

(3)

= AB + C

(ii) P = ABC + ABC + ABC


(4)

= AB(C + C ) + ABC
= AB + ABC
= A( B + BC )

(16)

= A( B + C )

(11)

= AB + AC

(16)

EXERCISE

Show that ( X Y + Z )( X + Y ) Z = XZ + YZ .
Lets Try!

20

EE202-Boolean Operations

(ii)

BY USING KARNAUGH MAP (K-MAP)

Karnaugh map,named for its originator Maurice Karnaugh is another method of simplifying
logic circuits.

It is similar to a truth table in that it graphically shows the output level of a boolean
expression for each of the possible input variable combinations.

Each output level is palced in a separate cell of a k-map.

K-map can be used to simplify equations having two,three,four,five or six different input
variables.Solving five and six variables K-maps is extremely cumbersome;they can be
more practically solved using advanced computer techniques.

Determining the number of cells in a K-map is the same as finding the number of
combinations or entries in a truth table.

A two-variable map requires 22 =4 cells.A three-variable map requires 23=8 cells and a
four-variable map requires 24=16 cells.

The three different K-map pattern are shown in Figure below :

2-variables k-map

3-variables k-map

Example 1 : Simplify the following k-map.

Solution :
o

4-variables k-map

Encircle adjacent cells in groups of two.

Loop 1 : A B ; Loop 2 : AC
Answer : A B + AC
21

EE202-Boolean Operations

Example 2 : Simplify the following equation by using the k-map.

X = A( BC + BC ) + ABC

Solution :

Technique :
o

Transform the Boolean equation.to a SOP expression.

X = ABC + ABC + ABC


o

Fill in the appropriate cells of the k-map

Encircle adjacent cells in groups of two,four.(The more adjacent cells


encircled,the simpler the final equation is).

Find each term of the final SOP equation by determining which variables
remain constant within each circle.
LOOP 1 : A B
LOOP 2 : AC

Answer : A B + AC

22

EE202-Boolean Operations

EXERCISE
1. Complete the output level for each input combination shown on the truth table for a 3-input OR
gate.

A
L
H
L
L

INPUTS
B
L
L
H
L

OUTPUT
X

C
L
L
L
H

2. Determine the output, for a 4-input NAND gate with the input waveform shown in figure 2.

3. Simplify each of Boolean expression below by using Boolean Algebra :


(a) [ A B(C + BD ) + A B ]C
(b) BD + B( D + E ) + D( D + F )
(c) AB + AC + A BC
4. Draw the logic circuit represented by each solutions above (based on Q3)
5. Examine this truth table and then write both SOP and POS Boolean expressions describing the
Output:
A

OUTPUT

0
0
0
0
1
1
1
1

0
0
1
1
0
0
1
1

0
1
0
1
0
1
0
1

1
0
1
0
0
1
1
0

Which of those Boolean expressions is simpler for this particular truth table? Which will be
easier to reduce to simplest form (for the purpose of creating a gate circuit to implement it)?
6. Use a Karnaugh map to simplify the following standard SOP expression:
X Y Z + XY Z + X YZ + X Y Z + X Y Z + XYZ

23

You might also like