You are on page 1of 23

Applications Of Boolean

Algebra and
Logic Gates

Review of Boolean algebra


In Boolean logic, variables can only be 1
or 0.

Review of Boolean algebra


Not_ is a horizontal bar above the number

0_ = 1
1=0

Or is a plus

0+0 = 0
0+1 = 1
1+0 = 1
1+1 = 1

And is multiplication

0*0 = 0
0*1 = 0
1*0 = 0
1*1 = 1

Review of Boolean algebra


We can define a Boolean function:

F(x,y) = (x+y).(x.y)

And then write a truth table for it:


x

x+y

x.y

F(x,y)

Basic logic gates


Not
And
Or
Nand
Nor
Xor
5

XOR Gate
Truth Table for XOR gate

The XOR function is


only true if just one
(and only one) of the
input values is true,
and false otherwise.
XOR
stands
for
eXclusive OR.

Question : 1.Write the SOP expression from the above truth table for XOR gate.
2.Draw the logic gate diagram using basic logic gates.

XNOR Gate
The output values of
XNOR are simply the
inverse
of
the
corresponding output
values of XOR

Truth Table for XNOR gate

Question : 1.Write the SOP expression from the above truth table for XNOR gate.
2.Draw the logic gate diagram using basic logic gates.

Find the output of the following circuit

x+y
(x+y)y
y
__

Answer: (x+y)y

Or (x+y).y'

Find the output of the following circuit

x
xy

xy

y
___
__

Answer: xy

Or (x.y ) x+y

Draw the circuits for the following


Boolean algebraic expressions
__
a) x+y
x

x+y

10

Draw the circuits for the following


Boolean algebraic expressions
_______
b) (x+y)x
x+y

x+y

(x+y)x

11

How to add binary numbers


Consider adding two 1-bit binary numbers x and y

0+0 = 0
0+1 = 1
1+0 = 1
1+1 = 10

x
0
0
1
1

y
0
1
0
1

Carry Sum
0
0
0
1
0
1
1
0

Carry is x AND y
Sum is x XOR y
The circuit to compute this is called a half-adder

12

The half-adder
Sum = x XOR y
Carry = x AND y

13

Using half adders


We can then use a half-adder to compute
the sum of two Boolean numbers
1
1
+1
?

1
1
0

0
1
1

0
0
0

14

How to fix this


We need to create an adder that can take a
carry bit as an additional input x y cin sum cout

Inputs: x, y, carry in
Outputs: sum, carry out

This is called a full adder

Will add x and y with a half-adder


Will add the sum of that to the
carry in

1 1 1
1 1 0
1 0 1
1 0 0
0 1 1
0 1 0
0 0 1
0 0 0

1
0

1
1

0
1

1
0

0
1

1
0

1
0

0
0
15

How to obtain the expressions


From the TT , the boolean expression for
Cout can be obtained as
Cout = xyc + xyc + xyc+ xyc
After simplification, we get,
Cout = x.y (c+c) + (x.y + xy).c
= x.y + (x y).c

How to obtain the expressions


It can also be seen that the sum bit is 1
when only one input is 1 or all three inputs
have value 1.
Therefore,
S = x.y.c + x.y.c + x.y.c + x.y.c
=(x.y + x.y).c + (x.y + x.y).c
Now,
x.y + xy = x y

How to obtain the expressions


And,
(x.y+xy) = (x.y) .(x.y) by DeMorgans law
=(x+y).(x+y)
=x.x + x.y + x.y + y.y
=x.y + x.y
=x.y + x.y
by commutative law
Therefore, (x y) = x.y +x.y
So, S = (x y).c + (x y).c = x y c

Full Adder
x

xy

y
(x y).c
c

Cout

x.y

S =x y c
Cout = x.y + (x y).c

19

3 inputs, 2 outputs.
Logic Equations
Cout = xyc + xyc + xyc+ xyc
= c .(x y) + x.y
or
Cout = xy + yc + xc
S = xyc + xyc +xyc+xyc
or
S =xyc

X
Cout
Y

FULL
ADDER

20

How Cout = xy + yc + xc
Cout = xyc +xyc + xyc + xyc
=(xyc + xyc) + xyc + xyc + xyc .x+x =x
=xyc + xy(c+c) + xyc + xyc
=(xyc + xyc) + xy + xyc + xyc
=xy + xyc +xyc + xyc +xyc
=xy + xc(y+y) + yc(x+x)
=xy + xc + yc
Therefore,
Cout=xy+yc+xc
S=xyc

The Full Adder


c
xysum
xy
AND

AND

AND

yc

xc

OR

carry

Application of Adders
Adders are important in computers and
also in other types of digital systems in
which numerical data are processed.
Adder circuits are essential inside
microprocessors as part of the ALU, or
arithmetic logic unit, where the
processing and manipulation of binary
numbers takes place.
23

You might also like