You are on page 1of 37

D ig ita l L o g ic a n d D e s ig n

II. F U N D A M E N T A L L O G IC C IR C U IT S

A . IN T R O D U C T IO N

In c h a p t e r 1 y o u le a r n e d t h a t t h e t w o d ig it s o f t h e b in a r y n u m b e r s y s t e m ca n
b e rep resen ted b y t h e s t a t e o r c o n d it io n o f e le c t r ic a l o r e le c t r o n ic d e v ic e s . A b in a r y
1 ca n be rep resen ted by a s w it c h t h a t is c lo s e d , a la m p t h a t is lit , o r a t r a n s is t o r
t h a t is c o n d u c t in g . C o n v e r s e ly , a b in a r y 0 w o u ld b e r e p r e s e n t e d b y t h e s a m e d e v ic e s
in t h e o p p o s it e s t a t e : t h e s w it c h o p e n , t h e la m p o ff, o r t h e t r a n s is t o r in c u t - o ff.

In t h is ch a p ter you w ill s t u d y th e fo u r b a s ic lo g ic g a tes th a t m a k e u p th e


fo u n d a t io n fo r d ig it a l e q u ip m e n t . Y o u w ill s e e th e ty p es o f lo g ic th a t a re u sed in

e q u ip m e n t t o a c c o m p lis h t h e d e s ir e d r e s u lt s . T h is c h a p t e r in c lu d e s a n in t r o d u c t io n
to B o o le a n a lg e b r a , th e lo g ic m a t h e m a t ic s sy stem u sed w it h d ig it a l e q u ip m e n t .
C e r t a in B o o le a n e x p r e s s io n s a re u sed in e x p la n a t io n o f t h e b a s ic lo g ic g a t e s , a n d
t h e ir e x p r e s s io n s w ill b e u s e d a s e a c h lo g ic g a t e is in t r o d u c e d .

B . C O M P U T E R L O G IC

L o g ic is d e fin e d a s th e s c ie n c e of r e a s o n in g . In oth er w ords, it is th e


d e v e lo p m e n t o f a r e a s o n a b le o r lo g ic a l c o n c lu s io n ba sed on kn ow n in fo r m a t io n .

1 . G E N E R A L L O G IC

C o n s id e r t h e fo llo w in g e x a m p le : I f it is t r u e t h a t a ll N a v y s h ip s a r e g r a y
a n d th e U S S L in c o ln is a N a vy s h ip , th en you w o u ld rea ch th e lo g ic a l

c o n c lu s io n t h a t t h e U S S L in c o ln is g r a y .

To rea ch a lo g ic a l c o n c lu s io n , you m u st a ssu m e th e q u a lify in g


sta tem en t is a c o n d it io n of tru th . F or ea ch sta tem en t th ere is a ls o a
c o r r e s p o n d in g fa ls e c o n d it io n . T h e s t a t e m e n t " U S S L in c o ln is a N a v y s h ip " is
t r u e ; t h e r e fo r e , t h e s t a t e m e n t " U S S L in c o ln is n o t a N a v y s h ip " is fa ls e . T h e r e
a r e n o in -b e t w e e n c o n d it io n s .

C om p u ters op era te on th e p r in c ip le of lo g ic a n d u se th e T R U E a n d
F A L S E lo g ic c o n d it io n s o f a lo g ic a l s t a t e m e n t t o m a k e a p r o g r a m m e d d e c is io n .

Th e c o n d it io n s of a sta tem en t ca n be rep resen ted by s y m b o ls


(v a r ia b le s ); fo r in s t a n c e , th e sta tem en t "T od a y is pa yda y" m ig h t be
rep resen ted by th e sy m b o l P . If to d a y a c t u a lly is p a y d a y , t h e n P is T R U E . If

t o d a y is n ot p a y d a y , th en P is F A L S E . A s y o u ca n se e, a sta tem en t h a s tw o
c o n d it io n s . In c o m p u t e r s , t h e s e t w o c o n d it io n s a re rep resen ted by e le c t r o n ic
c ir c u it s o p e r a t in g in tw o L O G IC S T A T E S . Th ese lo g ic s t a t e s a r e 0 (z e r o ) a n d
1 (o n e ). R e s p e c t iv e ly , 0 a n d 1 r e p r e s e n t t h e F A L S E a n d TR U E c o n d it io n s o f a
sta tem en t.

F lo r e n c e M . B a n a s ih a n Page 1
D C E E , C E IT
D ig ita l L o g ic a n d D e s ig n

W h en th e TR U E a n d F A LS E c o n d it io n s a re con verted to e le c t r ic a l
s ig n a ls , t h e y a r e r e fe r r e d to a s L O G IC L E V E L S c a lle d H IG H a n d L O W . Th e 1
sta te m ig h t be rep resen ted by th e presen ce of a n e le c t r ic a l s ig n a l (H IG H ),
w h ile t h e 0 s t a t e m ig h t b e r e p r e s e n t e d by th e a b sen ce of a n e le c t r ic a l s ig n a l
(L O W ).

If t h e s t a t e m e n t " T o d a y is p a y d a y " is F A L S E , t h e n t h e s t a t e m e n t " T o d a y

is N O T pa yda y" m u st be TR U E . T h is is c a lle d th e C O M PLE M E N T of th e


o r ig in a l s t a t e m e n t . In t h e c a s e o f c o m p u t e r m a t h , c o m p le m e n t is d e fin e d a s
th e o p p o s it e or n e g a t iv e fo r m of t h e o r ig in a l s t a t e m e n t o r v a r ia b le . If to d a y
w ere p a y d a y , th en t h e s t a t e m e n t " T o d a y is n o t p a y d a y " w o u ld b e F A L S E . T h e
c o m p le m e n t is sh ow n by p la c in g a ba r, or V IN C U L U M , o ver th e sta tem en t
s y m b o l (in t h is c a s e , P ). T h is v a r ia b le is s p o k e n a s N O T P . T a b le 2 -1 sh ow s
t h is c o n c e p t a n d t h e r e la t io n s h ip w it h lo g ic s t a t e s a n d lo g ic le v e ls .

T a b le 2 -1 . - R e la t io n s h ip o f D ig it a l L o g ic C o n c e p t s a n d T e rm s

E x a m p le 1 : A s s u m e t o d a y is p a y d a y

S T A T E M E N T S Y M B O L C O N D IT IO N L O G IC L O G IC
S T A T E L E V E L

O r ig in a l:
T O D A Y IS P TR U E 1 H IG H
PA Y D A Y

C o m p le m e n t :
-
T O D A Y IS F A LS E 0 LO W
P
N O T PA Y D A Y

In som e ca ses, m ore th a n on e v a r ia b le is u s e d in a s in g le e x p r e s s io n .


F o r e x a m p le , t h e e x p r e s s io n A B C D is s p o k e n "A A N D B A N D N O T C A N D D ."

2 . P O S IT IV E A N D N E G A T IV E L O G IC

T o t h is p o in t , w e h a v e b e e n d e a lin g w it h o n e t y p e o f L O G I C P O L A R IT Y ,
p o s i t i v e . L e t 's f u r t h e r d e f i n e lo g ic p o la r it y a n d e x p a n d t o c o v e r in m o r e d e t a il

t h e d iffe r e n c e s b etw een p o s it iv e a n d n e g a t iv e lo g ic .

L o g ic p o la r it y is t h e t y p e o f v o lt a g e u s e d t o r e p r e s e n t t h e lo g ic 1 s t a t e o f
a s t a t e m e n t . W e h a v e d e t e r m in e d t h a t t h e t w o lo g ic s t a t e s c a n b e r e p r e s e n t e d
by e le c t r ic a l s ig n a ls . A n y t w o d is t in c t v o lt a g e s m a y b e u s e d . F o r in s t a n c e , a
p o s it iv e v o lt a g e c a n r e p r e s e n t t h e 1 s t a t e , a n d a n e g a t iv e v o lt a g e c a n r e p r e s e n t
t h e 0 s t a t e . T h e o p p o s it e is a ls o t r u e .

L o g ic c ir c u it s a r e g e n e r a lly d iv id e d in t o t w o b r o a d c la s s e s a c c o r d in g t o
t h e ir p o la r it y - p o s it iv e lo g ic a n d n e g a t iv e lo g ic . T h e v o lt a g e le v e ls u s e d a n d a
sta tem en t in d ic a t in g th e u se of p o s it iv e or n e g a t iv e lo g ic w ill u s u a lly be
s p e c ifie d on lo g ic d ia g r a m s s u p p lie d b y m a n u fa c t u r e r s .

F lo r e n c e M . B a n a s ih a n Page 2
D C E E , C E IT
D ig ita l L o g ic a n d D e s ig n

I n p r a c t ic e , m a n y v a r ia t io n s o f lo g ic p o la r it y a r e u s e d ; fo r e x a m p le , fr o m
a h ig h - p o s it iv e t o a lo w - p o s it iv e v o lt a g e , o r fr o m p o s it iv e t o g r o u n d ; o r fr o m a
h ig h - n e g a t iv e to a lo w - n e g a t iv e v o lt a g e , o r fr o m n e g a t iv e to grou n d. A b r ie f
d is c u s s io n of th e tw o gen era l c la s s e s of lo g ic p o la r it y is p resen ted in th e
fo llo w in g p a r a g r a p h s .

a . P o s it iv e L o g ic

P o s it iv e lo g ic is d e fin e d a s fo llo w s : I f t h e s ig n a l t h a t a c t iv a t e s t h e c ir c u it
(t h e 1 s t a t e ) h a s a v o lt a g e le v e l t h a t is m o r e P O S IT IV E th a n th e 0 sta te, th en
t h e lo g ic p o la r it y is c o n s id e r e d t o b e P O S IT IV E . T a b le 2 - 2 s h o w s t h e m a n n e r
in w h ic h p o s it iv e lo g ic m a y b e u s e d .

T a b le 2 -2 . - E x a m p le s o f P o s it iv e L o g ic

A s y o u c a n s e e , in p o s it iv e lo g ic t h e 1 s t a t e is a t a m o r e p o s it iv e v o lt a g e
le v e l t h a n t h e 0 s t a t e .

b . N e g a t iv e L o g ic

A s y o u m ig h t s u s p e c t , n e g a t iv e lo g ic is t h e o p p o s it e o f p o s it iv e lo g ic a n d
is d e fin e d a s fo llo w s : I f t h e s ig n a l t h a t a c t iv a t e s t h e c ir c u it (t h e 1 s t a t e ) h a s a
v o lt a g e le v e l t h a t is m o r e N E G A T IV E th a n th e 0 sta te, th en t h e lo g ic p o la r ity

is c o n s id e r e d t o b e N E G A T IV E . T a b le 2 - 3 s h o w s t h e m a n n e r in w h ic h n e g a t iv e
lo g ic m a y b e u s e d .

T a b le 2 -3 . - E x a m p le s o f N e g a t iv e L o g ic

N O T E : T h e lo g ic le v e l L O W n ow r e p r e s e n t s t h e 1 s t a t e . T h is is b e c a u s e t h e 1

s t a t e v o lt a g e is m o r e n e g a t iv e t h a n t h e 0 s t a t e .

F lo r e n c e M . B a n a s ih a n Page 3
D C E E , C E IT
D ig ita l L o g ic a n d D e s ig n

I n t h e e x a m p le s s h o w n fo r n e g a t iv e lo g ic , y o u n o t ic e t h a t t h e v o lt a g e fo r
t h e lo g ic 1 s t a t e is m o r e n e g a t iv e w it h r e s p e c t t o t h e lo g ic 0 s t a t e v o lt a g e . T h is
h o ld s t r u e in e x a m p le 1 w h e r e b o t h v o lt a g e s a r e p o s it iv e . In t h is c a s e , it m a y
be e a s ie r fo r y o u t o t h in k of th e T R U E c o n d it io n a s b e in g le s s p o s it iv e th a n
t h e F A L S E c o n d it io n . E it h e r w a y , t h e e n d r e s u lt is n e g a t iv e lo g ic .

T h e u s e o f p o s it iv e o r n e g a t iv e lo g ic fo r d ig it a l e q u ip m e n t is a c h o ic e t o

be m a de by d e s ig n e n g in e e r s . T h e d iffic u lt y fo r t h e t e c h n ic ia n in t h is a r e a is
lim it e d t o u n d e r s t a n d in g t h e t y p e o f lo g ic b e in g u sed a n d k e e p in g it in m in d
w h en t r o u b le s h o o t in g .

N O T E : U N LE S S O T H E R W IS E N O TE D , TH E R E M A IN D E R O F T H IS B O O K
W IL L D E A L O N L Y W IT H P O S IT IV E L O G IC .

3 . L O G IC IN P U T S A N D O U T P U T S

A s y o u s t u d y lo g ic c ir c u it s , y o u w ill s e e a v a r ie t y o f s y m b o ls (v a r ia b le s )
u s e d t o r e p r e s e n t t h e in p u t s a n d o u t p u t s . T h e p u r p o s e o f t h e s e s y m b o ls is t o
le t y o u k n o w w h a t in p u t s a r e r e q u ir e d fo r t h e d e s ir e d ou tp u t.

If th e sym bol A is s h o w n a s a n in p u t t o a lo g ic d e v ic e , th en th e lo g ic
le v e l t h a t r e p r e s e n t s A m u st be H IG H t o a c t iv a t e t h e lo g ic d e v ic e . T h a t is , it

m u s t s a t is fy t h e in p u t r e q u ir e m e n t s o f t h e lo g ic d e v ic e b e fo r e t h e lo g ic d e v ic e
w ill is s u e t h e T R U E ou tp u t.

L o o k a t v ie w A o f fig u r e 2 - 1 . T h e s y m b o l X r e p r e s e n t s t h e in p u t . A s lo n g
a s t h e s w it c h is o p e n , t h e la m p is n o t lit . T h e o p e n s w it c h r e p r e s e n t s t h e lo g ic
0 s t a t e o f v a r ia b le X .

F ig u r e 2 -1 . - L o g ic s w it c h : A . L o g ic 0 s t a t e ; B . L o g ic 1 s t a t e .

C lo s in g t h e s w it c h (v ie w B ), r e p r e s e n t s th e lo g ic 1 sta te of X . C lo s in g
t h e s w it c h c o m p le t e s th e c ir c u it c a u s in g th e la m p to lig h t . T h e 1 sta te of X

F lo r e n c e M . B a n a s ih a n Page 4
D C E E , C E IT
D ig ita l L o g ic a n d D e s ig n

s a t is fie d t h e in p u t r e q u ir e m e n t a n d t h e c ir c u it t h e r e fo r e p r o d u c e d t h e d e s ir e d
o u t p u t (lo g ic H IG H ); c u r r e n t w a s a p p lie d t o t h e la m p c a u s in g it t o lig h t .

If y o u c o n s id e r t h e la m p a s t h e o u t p u t o f a lo g ic d e v ic e , t h e n th e sa m e
c o n d it io n s e x is t . T h e TR U E (1 s t a t e ) o u t p u t o f t h e lo g ic d e v ic e is t o h a v e t h e
la m p lit . If t h e la m p is n o t lit , t h e n t h e o u t p u t o f t h e lo g ic d e v ic e is F A L S E (0
s t a t e ).

A s y o u s t u d y lo g ic c ir c u it s , it is im p o r t a n t t h a t y o u r e m e m b e r t h e s t a t e
(1 o r 0 ) o f t h e in p u t s a n d o u t p u t s .

S o fa r in t h is c h a p t e r , w e h a v e d is c u s s e d t h e t w o c o n d it io n s o f lo g ic a l
s t a t e m e n t s , t h e lo g ic s t a t e s r e p r e s e n t in g t h e s e t w o c o n d it io n s , lo g ic le v e ls a n d
a s s o c ia t e d e le c t r ic a l s ig n a ls a n d p o s it iv e a n d n e g a t iv e lo g ic . W e a r e n o w r e a d y
t o p r o c e e d w it h in d iv id u a l lo g ic d e v ic e o p e r a t io n s . T h e s e m a k e u p t h e m a jo r ity
o f c o m p u t e r c ir c u it r y .

A s ea ch of th e lo g ic d e v ic e s a re p resen ted , a ch a rt c a lle d a TR U TH


TA B LE w ill b e u s e d t o illu s t r a t e a ll p o s s ib le in p u t a n d c o r r e s p o n d in g ou tp u t
c o m b in a t io n s . T r u t h T a b le s a r e p a r t ic u la r ly h e lp fu l in u n d e r s t a n d in g a lo g ic
d e v ic e a n d fo r s h o w in g t h e d iffe r e n c e s b etw een d e v ic e s .

Th e lo g ic o p e r a t io n s you w ill s t u d y in t h is ch a p ter a re th e A N D , O R ,

N O T, N A N D , a n d N O R . Th e d e v ic e s th a t a c c o m p lis h th ese o p e r a t io n s a re
c a lle d lo g ic g a te s , or m ore in fo r m a lly , < e m p h a s is t y p e = " i.G I F " > g a t e s . T h e s e
g a tes a re th e fo u n d a t io n fo r a ll d ig it a l e q u ip m e n t . Th ey a re th e " d e c is io n -
m a k in g " c ir c u it s of com p u ters a n d oth er ty p es of d ig it a l e q u ip m e n t . B y
m a k in g d e c is io n s , w e m e a n t h a t c e r t a in c o n d it io n s m u s t e x is t t o p r o d u c e t h e
d e s ir e d ou tp u t.

In s t u d y in g ea ch g a te, w e w ill in t r o d u c e v a r io u s m a t h e m a t ic a l
S Y M B O LS kn ow n a s B O O L E A N A L G E B R A e x p r e s s io n s . Th ese e x p r e s s io n s
a r e n o t h in g m ore th a n d e s c r ip t io n s o f t h e in p u t r e q u ir e m e n t s n e c e s s a r y to
a c t iv a t e t h e c ir c u it a n d t h e r e s u lt a n t c ir c u it o u t p u t .

C . L O G IC G A T E S

1 . T H E A N D G A T E

Th e A N D g a t e is a lo g ic c ir c u it t h a t r e q u ir e s a ll in p u t s t o be TR U E at
t h e s a m e t im e in o r d e r fo r t h e o u t p u t t o b e T R U E .

a . L O G IC S Y M B O L

T h e s t a n d a r d s y m b o l fo r t h e A N D g a t e is s h o w n in fig u r e 2 - 2 . V a r ia t io n s
of t h is sta n d a rd sym bol m a y be en cou n tered . Th ese v a r ia t io n s becom e
n ecessa ry t o illu s t r a t e t h a t a n A N D g a t e m a y h a v e m o r e t h a n o n e in p u t .

F lo r e n c e M . B a n a s ih a n Page 5
D C E E , C E IT
D ig ita l L o g ic a n d D e s ig n

F ig u r e 2 -2 . - A N D g a te .

If w e a p p ly t w o v a r ia b le s , A a n d B , t o t h e in p u t s o f t h e A N D g a te, th en
b oth A a n d B w o u ld h a v e t o b e T R U E a t t h e s a m e t im e t o p r o d u c e t h e d e s ir e d
TR U E ou tp u t. . Th e sym bol f d e s ig n a t e s th e o u t p u t fu n c t io n . Th e B o o le a n
e x p r e s s io n fo r t h is o p e r a t io n is f = A · B o r f = A B . T h e e x p r e s s io n is s p o k e n ,
"f = A A N D B ." T h e d o t , o r la c k o f, in d ic a t e s t h e A N D fu n c t io n .

b . A N D G A T E O P E R A T IO N

W e c a n d e m o n s t r a t e t h e o p e r a t io n o f t h e A N D g a t e w it h a s im p le c ir c u it
t h a t h a s t w o s w it c h e s in s e r ie s a s s h o w n in fig u r e 2 - 3 . Y o u c a n see th a t b oth
s w it c h e s w o u ld h a v e t o b e c lo s e d a t t h e s a m e t im e t o lig h t t h e la m p (v ie w A ).
A n y o t h e r c o m b in a t io n o f s w it c h p o s it io n s (v ie w B ) w o u ld r e s u lt in a n open
c ir c u it a n d t h e la m p w o u ld n o t lig h t (lo g ic 0 ).

F ig u r e 2 -3 . - A N D g a te e q u iv a le n t c ir c u it: A . L o g ic 1 s ta te ;

B . L o g ic 0 s ta te .

N ow lo o k a t fig u r e 2 - 4 . S ig n a l A is a p p lie d t o o n e in p u t o f t h e A N D g a te
a n d s ig n a l B t o t h e o t h e r . A t t im e T 0 , b oth in p u t s a r e L O W (lo g ic 0 ) a n d f is
LO W . A t T 1, A g o e s H IG H (lo g ic 1 ); B r e m a in s L O W ; a n d a s a r e s u lt , f r e m a in s
LO W . A t T 2 , A goes LO W a n d B g o e s H I G H ; f, h o w e v e r , is s t ill L O W , b e c a u s e
th e p rop er in p u t c o n d it io n s h a ve n ot been s a t is fie d (A a n d B b oth H IG H at
th e s a m e t im e ). A t T 4 , b oth A a n d B a re H IG H . A s a r e s u lt , f is H IG H . T h e
in p u t r e q u ir e m e n t s h a v e b e e n s a t is fie d , s o t h e o u t p u t is H I G H (lo g ic 1 ).

F lo r e n c e M . B a n a s ih a n Page 6
D C E E , C E IT
D ig ita l L o g ic a n d D e s ig n

F ig u r e 2 -4 . - A N D g a te in p u t a n d o u tp u t s ig n a ls .

c . L O G IC E Q U A T IO N

A .B = F o r s im p ly A B = f

d . T R U T H T A B L E

N ow l e t 's r e f e r t o f i g u r e 2 - 5 . A s y o u c a n see, a T r u t h T a b le a n d a T a b le
o f C o m b in a t io n s a re sh ow n . Th e la t t e r is a d e v ia t io n of th e T ru th T a b le . It
u ses th e H IG H a n d LO W l o g i c l e v e l s t o d e p i c t t h e g a t e 's i n p u t s a n d r e s u l t a n t
o u t p u t c o m b in a t io n s r a t h e r t h a n th e 1 a n d 0 lo g ic s t a t e s . B y c o m p a r in g th e
in p u t s a n d o u t p u t s o f t h e t w o t a b le s , y o u s e e h o w o n e c a n e a s ily b e c o n v e r t e d

t o t h e o t h e r (r e m e m b e r , 1 = H IG H a n d 0 = L O W ). T h e T a b le o f C o m b in a t io n s
is sh ow n h ere o n ly to fa m ilia r iz e y o u w it h it s e x is t e n c e , it w ill n o t be seen
a g a in in t h is b o o k . A s w e m e n t io n e d e a r lie r , t h e T r u t h T a b le is a ch a rt th at
s h o w s a ll p o s s ib le c o m b in a t io n s o f in p u t s a n d t h e r e s u lt in g o u t p u t s . C o m p a r e
th e A N D g a t e T r u t h T a b le (fig u r e 2 - 5 ) w it h t h e in p u t s ig n a ls s h o w n in fig u r e
2 -4 .

F ig u r e 2 -5 . - A N D g a te lo g ic s y m b o l, T ru th T a b le , a n d T a b le o f C o m b in a tio n s .

T h e fir s t c o m b in a t io n (A = 0 , B = 0) correspon ds to T 0 in fig u r e 2 - 4 ; t h e


secon d to T 1 ; t h e t h ir d to T 2 ; a n d t h e la s t t o T 4 . W h en c o n s t r u c t in g a T ru th
T a b le , y o u m u s t in c lu d e a ll p o s s ib le c o m b in a t io n s o f t h e in p u t s , in c lu d in g t h e
a ll 0 s c o m b in a t io n .

F lo r e n c e M . B a n a s ih a n Page 7
D C E E , C E IT
D ig ita l L o g ic a n d D e s ig n

A T r u t h T a b le r e p r e s e n t in g a n A N D g a t e w it h t h r e e in p u t s (X , Y , a n d Z )
is sh ow n b e lo w . R em em ber th a t th e t w o - in p u t A N D g a te h a s fo u r p o s s ib l e
c o m b in a t io n s , w it h o n ly o n e o f t h o s e c o m b in a t io n s p r o v id in g a H IG H o u t p u t.
A n A N D g a t e w it h t h r e e in p u t s h a s e ig h t p o s s ib le c o m b in a t io n s , a g a in w ith
o n ly on e c o m b in a t io n p r o v id in g a H IG H ou tp u t. M a k e su re you in c lu d e a ll
p o s s ib le c o m b in a t io n s . T o ch eck if y o u h a v e a ll c o m b in a t io n s , r a is e 2 to th e

pow er eq u a l to th e n u m ber of in p u t v a r ia b le s . T h is w ill g iv e you th e total


n u m b e r o f p o s s ib le c o m b in a t io n s . F o r e x a m p le :

2
E X A M PLE 1 -A B = 2 = 4 c o m b in a t io n s

3
E X A M PLE 2 -X Y Z = 2 = 8 c o m b in a t io n s

X Y Z f

0 0 0 0

0 0 1 0

0 1 0 0

0 1 1 0

1 0 0 0

1 0 1 0

1 1 0 0

1 1 1 1

f = X Y Z

A s w it h a ll A N D g a t e s , a ll t h e in p u t s m u s t b e H IG H a t t h e s a m e t im e t o
p ro d u ce a H IG H o u t p u t . D o n 't b e c o n f u s e d if t h e c o m p le m e n t o f a v a r ia b le is
u sed a s a n in p u t . W h e n a c o m p le m e n t is in d ic a t e d a s a n in p u t t o a n A N D
g a t e , it m u s t a ls o b e H IG H t o s a t is fy t h e in p u t r e q u ir e m e n t s o f t h e g a t e . T h e
B o o le a n e x p r e s s io n fo r t h e o u t p u t is fo r m u la t e d ba sed on th e TR U E in p u t s
th a t g iv e a TR U E ou tp u t. H ere is a n a da ge th a t m ig h t h e lp you b etter
u n d ersta n d th e A N D g a te:

In o rd er to p ro d u ce a 1 o u t p u t , a ll t h e in p u t s m u s t b e 1 . If a n y o r a ll o f
t h e in p u t s is / a r e 0 , t h e n t h e o u t p u t w ill b e 0 .

R e fe r r in g to th e fo llo w in g e x a m p le s s h o u ld h e lp you cem en t t h is

c o n c e p t in y o u r m in d . R e m e m b e r , t h e in p u t s , w h e t h e r t h e o r ig in a l v a r ia b le o r
t h e c o m p le m e n t m u st be h ig h in order fo r th e ou tp u t to be h ig h . T h e th ree
e x a m p le s g iv e n a r e a ll A N D g a t e s w it h t w o in p u t s . K e e p in m in d t h e B o o le a n
e x p r e s s io n fo r t h e o u t p u t is t h e r e s u lt o f a ll t h e in p u t s b e in g H I G H .

F lo r e n c e M . B a n a s ih a n Page 8
D C E E , C E IT
D ig ita l L o g ic a n d D e s ig n

Y o u w ill s o o n b e a b le t o r e c o g n iz e t h e T r u t h T a b le fo r t h e o t h e r t y p e s o f
lo g ic g a t e s w it h o u t h a v in g t o lo o k a t t h e lo g ic s y m b o l.

P R O B L E M S E T 1 5 (Q 1 - 8 )

1. W h a t is d e fin e d a s " t h e s c ie n c e o f r e a s o n in g ? "


2. W it h r e g a r d t o c o m p u t e r lo g ic c ir c u it s , w h a t is m e a n t b y
" c o m p le m e n t ? "
3. W h a t a r e t h e c o m p le m e n t s o f t h e fo llo w in g t e r m s ?

 Q

 V
 Z

4. If lo g ic 1 = - 5 v d c a n d lo g ic 0 = - 1 0 v d c , w h a t lo g ic p o la r it y is
b e in g u s e d ?
5. If lo g ic 1 = + 2 v d c a n d lo g ic 0 = - 2 v d c , w h a t lo g ic p o la r it y is
b e in g u s e d ?
6. If lo g ic 1 = - 5 v d c a n d lo g ic 0 = 0 v d c , w h a t lo g ic p o la r it y is b e in g
u sed?
7. W h a t is t h e B o o le a n e x p r e s s io n fo r t h e o u t p u t o f a n
A N D g a t e t h a t h a s R a n d S a s in p u t s ?
8. W h a t m u s t b e t h e lo g ic s t a t e o f R a n d S to p rod u ce
th e T R U E ou tp u t?

9. H ow m a n y in p u t c o m b in a t io n s e x is t fo r a fo u r - in p u t
A N D g a te?

F lo r e n c e M . B a n a s ih a n Page 9
D C E E , C E IT
D ig ita l L o g ic a n d D e s ig n

2 . T H E O R G A T E

Th e O R g a t e d iffe r s fr o m th e A N D g a t e in t h a t o n ly O N E in p u t h a s t o
b e H IG H to p ro d u ce a H IG H ou tp u t. A n ea sy w a y to rem em b er th e O R g a te
is t h a t a n y H IG H in p u t w ill y ie ld a H IG H ou tp u t.

a . L O G IC S Y M B O L

F ig u r e 2 - 6 s h o w s t h e s t a n d a r d s y m b o l fo r t h e O R g a te. T h e n u m b er of

in p u t s w ill v a r y a c c o r d in g t o t h e n e e d s o f t h e d e s ig n e r .

F ig u r e 2 -6 . - O R g a t e .

Th e O R g a t e m a y a ls o b e rep resen ted by a s im p le c ir c u it a s s h o w n in


fig u r e 2 - 7 . I n t h e O R g a t e , t w o s w it c h e s a r e p la c e d in p a r a lle l. I f e it h e r o r b o t h
o f t h e s w it c h e s a r e c lo s e d (v ie w A ), t h e la m p w ill lig h t . T h e o n ly t im e t h e la m p
w ill n o t b e lit is w h e n b oth s w it c h e s a r e o p e n (v ie w B ).

F ig u r e 2 -7 . - O R g a t e e q u iv a le n t c ir c u it : A . L o g ic 1 s t a t e ; B . L o g ic 0 s t a t e .

L e t 's a s s u m e w e a r e a p p ly in g t w o v a r ia b le s , X a n d Y , t o t h e in p u t s o f

a n O R g a te. F or th e c ir c u it to produ ce a H IG H o u t p u t , e it h e r v a r ia b le X ,
v a r ia b le Y , o r b o t h m u s t b e H IG H . T h e B o o le a n e x p r e s s io n fo r t h is o p e r a t io n
is f = X +Y a n d is spoken " f e q u a ls X O R Y ." T h e p lu s s ig n in d ic a t e s th e O R
fu n c t io n a n d s h o u ld n o t b e c o n fu s e d w it h a d d it io n .

b . O R G A T E O P E R A T IO N

Look a t fig u r e 2 - 8 . A t t im e T 0 , b oth X a n d Y a re LO W a n d f is L O W . A t


T 1 , X g o e s H IG H p r o d u c in g a H IG H ou tp u t. A t T 2 w h en b o t h in p u t s g o L O W , f
goes LO W . W h en Y g o es H IG H a t T 3 , f a ls o g o e s H IG H a n d r e m a in s H IG H u n t il
b o t h in p u t s a r e a g a in L O W . A t T 5 , b o t h X a n d Y g o H IG H c a u s in g f t o g o H IG H .

F lo r e n c e M . B a n a s ih a n Page 10
D C E E , C E IT
D ig ita l L o g ic a n d D e s ig n

F ig u r e 2 -8 . - O R g a t e in p u t a n d o u tp u t s ig n a ls .

c . L O G IC E Q U A T IO N

X + Y = f

d . T R U T H T A B L E

U s in g t h e in p u t s X a n d Y , l e t 's c o n s t r u c t a T r u t h T a b l e f o r t h e O R g a t e .
Y o u c a n s e e fr o m t h e d is c u s s io n o f fig u r e 2 - 8 t h a t t h e r e a r e fo u r c o m b in a t io n s
o f in p u t s . L is t e a c h o f t h e s e c o m b in a t io n s o f in p u t s a n d t h e r e s p e c t iv e o u t p u ts
a n d y o u h a v e t h e T r u t h T a b le fo r t h e O R g a t e .

X Y f

0 0 0

0 1 1

1 0 1

1 1 1

f = X + Y

W h en w r it in g or s t a t in g th e B o o le a n e x p r e s s io n fo r a n O R g a te w ith

m ore th a n t w o in p u t s , s im p ly p la c e t h e O R s ig n (+ ) b e t w e e n ea ch in p u t a n d
r e a d o r s t a t e t h e s ig n a s O R . F o r e x a m p le , t h e B o o le a n e x p r e s s io n fo r a n O R
g a t e w it h t h e in p u t s o f A , B , C , a n d D w o u ld b e :

f = A +B +C +D

T h is e x p r e s s io n is s p o k e n " f e q u a ls A O R B O R C O R D ."

Y ou ca n s u b s t it u t e t h e c o m p le m e n t s fo r t h e o r ig in a l s t a t e m e n t s a s w e
d id w it h th e A N D g a te or u s e n e g a t iv e lo g ic ; b u t fo r a n o u t p u t fr o m a n O R
g a t e , a t le a s t o n e o f t h e in p u t s m u s t b e T R U E .

F lo r e n c e M . B a n a s ih a n Page 11
D C E E , C E IT
D ig ita l L o g ic a n d D e s ig n

P R O B L E M S E T 1 6 (Q 1 0 - 1 2 )

1. W r it e t h e B o o le a n e x p r e s s io n fo r a n O R g a t e h a v in g G , K , a n d L

a s in p u t s .

2. H ow m a n y in p u t c o m b in a t io n s a r e p o s s ib le u s in g G , K , a n d L ?

3. H ow m a n y o f t h o s e c o m b in a t io n s w ill p r o d u c e a H IG H ou tp u t?

3 . T H E IN V E R T E R ( N O T G A T E )

T h e I N V E R T E R , o ft e n r e fe r r e d t o a s a N O T g a t e , is a lo g ic d e v ic e th a t h a s
a n o u t p u t o p p o s it e o f t h e in p u t . It is s o m e t im e s c a lle d a N E G A T O R . It m a y b e
u sed a lo n e or in c o m b in a t io n w it h oth er lo g ic d e v ic e s to fu lfill e q u ip m e n t
r e q u ir e m e n t s .

W h en a n in v e r t e r is u s e d a lo n e , it is r e p r e s e n t e d b y th e sy m b ol sh ow n in
fig u r e 2 - 9 (v ie w A ). I t w ill m o r e o ft e n be seen in c o n ju n c t io n w it h t h e s y m b o l fo r
a n a m p lifie r (v ie w B ). S y m b o ls fo r in v e r t e r s u sed in c o m b in a t io n w it h oth er
d e v ic e s w ill b e s h o w n la t e r in t h e c h a p t e r .

F ig u r e 2 -9 . - In v e r t e r : A . S y m b o l f o r in v e r t e r u s e d a lo n e ; B .

S y m b o l fo r a n a m p lifie r/ in v e rte r.

L e t 's go ba ck to th e sta tem en t "T od a y is p a y d a y ." W e sta ted th a t P


rep resen ts th e T R U E s t a t e . If w e a p p ly P t o t h e in p u t o f t h e in v e r t e r a s s h o w n
in fig u r e 2 - 1 0 , t h e n t h e o u t p u t w ill b e t h e o p p o s it e o f t h e in p u t . T h e o u t p u t,
in t h is c a s e , is P . A t t im e s T 0 th rou g h T 2 , P is L O W . C o n s e q u e n t ly , t h e o u t p u t
(P ) is H IG H . A t T 2 , P g o es H IG H a n d a s a r e s u lt P g o e s L O W . P r e m a in s L O W
a s lo n g a s P is H IG H a n d v ic e v e r s a . T h e B o o le a n e x p r e s s io n fo r t h e o u t p u t o f

t h is g a t e is
_
f = P.

F lo r e n c e M . B a n a s ih a n Page 12
D C E E , C E IT
D ig ita l L o g ic a n d D e s ig n

F ig u r e 2 -1 0 . - In v e r t e r in p u t a n d re s u lta n t o u tp u t.

T h e L o g ic E q u a t io n fo r t h e I n v e r t e r is :
_
f = P

T h e T r u t h T a b le fo r a n in

v e r t e r is s h o w n b e lo w .

P F

0 1

1 0

Th e ou tp u t of a n in v e r t e r w ill b e th e c o m p le m e n t of th e in p u t . Th e
fo llo w in g e x a m p le s sh ow v a r io u s in p u t s to in v e r t e r s a n d th e r e s u lt in g
ou tp u ts:

F lo r e n c e M . B a n a s ih a n Page 13
D C E E , C E IT
D ig ita l L o g ic a n d D e s ig n

P R O B L E M S E T 1 7 (Q 1 3 - 1 5 )

1. W h a t is t h e c o m p le m e n t o f X Y Z ?

2.

3. In a

p r o p e r ly fu n c t io n in g c ir c u it , c a n b o t h t h e in p u t a n d o u t p u t o f

a n in v e r t e r b e H IG H a t t h e s a m e t im e ?

4 . T H E N A N D G A T E

Th e N A N D g a te is a n oth er lo g ic d e v ic e c o m m o n ly fo u n d in d ig it a l
e q u ip m e n t . T h is g a t e is s im p ly a n A N D g a t e w it h a n in v e r t e r (N O T g a te) a t th e
ou tp u t.

a . L O G IC S Y M B O L

T h e lo g ic s y m b o l fo r t h e N A N D g a t e is s h o w n in fig u r e 2 - 1 1 .

F ig u r e 2 -1 1 . - N A N D g a te .

Th e N A N D g a te ca n h a v e t w o o r m o r e in p u t s . T h e o u t p u t w ill b e L O W
o n ly w h e n a ll t h e in p u t s a r e H IG H . C o n v e r s e ly , t h e o u t p u t w ill b e H IG H w h en
a n y o r a ll o f t h e in p u t s a r e L O W .

Th e N A N D g a t e p e r fo r m s t w o fu n c t io n s , A N D a n d N O T . S e p a r a t in g t h e
N A N D sym bol to sh ow t h e s e t w o fu n c t io n s w o u ld r e v e a l t h e e q u iv a le n t c ir c u it s
d e p ic t e d in fig u r e 2 -1 2 . T h is s h o u ld h e lp you b etter u n d ersta n d h ow th e
N A N D g a t e fu n c t io n s .

F ig u r e 2 -1 2 . - N A N D g a te e q u iv a le n t c irc u it: A . E ith e r X o r Y o r b o th a re L O W ; B . B o th X


and Y a r e H IG H .

In p u ts X a n d Y a r e a p p lie d to th e A N D g a t e . If e it h e r X o r Y o r b o t h a re
LO W (v ie w A ), t h e n t h e o u t p u t o f t h e A N D g a t e is L O W . A L O W (lo g ic 0 ) o n th e

F lo r e n c e M . B a n a s ih a n Page 14
D C E E , C E IT
D ig ita l L o g ic a n d D e s ig n

in p u t o f t h e in v e r t e r r e s u lt s in a H IG H (lo g ic 1 ) o u t p u t . W h e n b oth X a n d Y
a r e H IG H (v ie w B ), t h e o u t p u t o f t h e A N D g a t e is H IG H ; t h u s t h e o u t p u t o f t h e
in v e r t e r is L O W . T h e B o o le a n e x p r e s s io n fo r t h e o u t p u t o f a N A N D g a t e w ith
t h e s e in p u t s is f = X Y . T h e e x p r e s s io n is s p o k e n "X A N D Y q u a n t it y N O T ." T h e
ou tp u t of a n y N A N D g a t e is th e n e g a t io n of th e in p u t . F or e x a m p le , if o u r
in p u t s a r e X a n d Y , t h e o u t p u t w ill b e

b . N A N D G A T E O P E R A T IO N

N o w , l e t 's observe t h e lo g ic le v e l in p u t s a n d c o r r e s p o n d in g ou tp u ts a s

sh ow n in fig u r e 2 - 1 3 . A t t im e T 0 , X a n d Y a r e b o t h L O W . T h e o u t p u t is H IG H ;
t h e o p p o s it e o f a n A N D g a t e w it h t h e s a m e in p u t s . A t T 1 , X g o es H IG H a n d Y
r e m a in s L O W . A s a r e s u lt , t h e o u t p u t r e m a in s H IG H . A t T 2 , X goes LO W a n d
Y g o e s H IG H . A g a in , t h e o u t p u t r e m a in s H IG H . W h e n b oth X a n d Y a re H IG H
a t T 4 , t h e o u t p u t g o e s L O W . T h e o u t p u t w ill r e m a in L O W o n ly a s lo n g a s b o th
X a n d Y a re H IG H .

F ig u r e 2 -1 3 . - N A N D g a te in p u t a n d o u tp u t s ig n a ls .

c . L O G IC E Q U A T IO N
___
X Y = f

d . T R U T H T A B L E

T h e T r u t h T a b le fo r a N A N D g a t e w it h X a n d Y a s in p u t s is s h o w n
b e lo w .

X Y f

0 0 1

0 1 1

1 0 1

1 1 0

F lo r e n c e M . B a n a s ih a n Page 15
D C E E , C E IT
D ig ita l L o g ic a n d D e s ig n

P R O B L E M S E T 1 8 (Q 1 6 - 1 9 )

1. A N A N D g a t e h a s Z a n d X a s in p u t s . W h a t w ill b e t h e o u t p u t

lo g ic le v e l if Z is H IG H a n d X is L O W ?

2 . W h a t m u s t b e t h e s t a t e o f t h e in p u t s t o a N A N D g a t e in order to

produ ce a LO W ou tp u t?

3 . W h a t is t h e o u t p u t B o o le a n e x p r e s s io n fo r a N A N D g a t e w it h

in p u t s A , B , a n d C ?

4. A N A N D g a t e h a s in p u t s la b e le d a s A , B , a n d C . If A a n d B a re

H IG H , C m u s t b e a t w h a t lo g ic le v e l t o p r o d u c e a H IG H ou tp u t?

5 .T H E N O R G A T E

A s you m ig h t e x p e c t , th e N O R g a t e is a n O R g a t e w it h a n in v e r t e r on
th e ou tp u t.

a . L O G IC S Y M B O L

Th e sta n d a rd lo g ic s y m b o l fo r t h is g a t e is s h o w n in fig u r e 2 - 1 4 . M o r e
t h a n ju s t t h e t w o in p u t s m a y b e s h o w n .

F ig u r e 2 -1 4 . - N O R g a te .

Th e N O R g a t e w ill h a v e a H IG H o u t p u t o n ly w h en a ll t h e in p u t s a re
LO W .

W h en broken d o w n , t h e t w o fu n c t io n s p e r fo r m e d b y th e N O R g a te ca n
be rep resen ted by t h e e q u iv a le n t c ir c u it d e p ic t e d in fig u r e 2 - 1 5 . W h en b oth
in p u t s to th e O R g a te a re LO W , th e o u t p u t is LO W . A LO W a p p lie d to a n

in v e r t e r g iv e s a H IG H o u t p u t . If e it h e r o r b o t h o f t h e in p u t s t o t h e O R g a t e a r e
H IG H , th e o u t p u t w ill b e H IG H . W h en t h is H IG H ou tp u t is a p p lie d to th e
in v e r t e r , t h e r e s u lt in g o u t p u t is L O W . T h e B o o le a n e x p r e s s io n fo r t h e o u t p u t
o f t h is N O R g a t e is f = K + L . T h e e x p r e s s io n is s p o k e n , " K O R L q u a n t i t y N O T ."

F lo r e n c e M . B a n a s ih a n Page 16
D C E E , C E IT
D ig ita l L o g ic a n d D e s ig n

F ig u r e 2 -1 5 . - N O R g a te e q u iv a le n t c irc u it.

b . N O R G A T E O P E R A T IO N

Th e lo g ic le v e l in p u t s a n d c o r r e s p o n d in g o u t p u t s fo r a N O R g a te a re
s h o w n in fig u r e 2 - 1 6 . A t t im e T 0 , b o t h K a n d L a r e L O W ; a s a r e s u lt , f is H IG H .
A t T 1 , K g o e s H IG H , L r e m a in s L O W , a n d f goes LO W . A t T 2 , K goes LO W , L
g o e s H IG H , a n d t h e o u t p u t r e m a in s L O W . T h e o u t p u t g o e s H IG H a g a in a t T 3

w h e n b o t h in p u t s a r e L O W . A t T 4 w h e n b o t h in p u t s a r e H IG H , t h e o u t p u t g o e s
LO W a n d r e m a in s L O W u n t il T 5 w h en b oth in p u t s go LO W . R em em ber th e
o u t p u t is ju s t o p p o s it e o f w h a t it w o u ld b e fo r a n O R g a te.

F ig u r e 2 -1 6 . - N O R g a te in p u t a n d o u tp u t s ig n a ls .

c . L O G IC E Q U A T IO N

_____
K + L = f

d . T R U T H T A B L E

T h e T r u t h T a b le fo r a N O R g a t e w it h K a n d L a s in p u t s is s h o w n
b e lo w .

K L f

0 0 1

0 1 0

1 0 0

1 1 0

F lo r e n c e M . B a n a s ih a n Page 17
D C E E , C E IT
D ig ita l L o g ic a n d D e s ig n

P R O B L E M S E T 1 9 (Q 2 0 - 2 3 )

1. H ow does a N O R g a t e d iffe r fr o m a n O R g a te?

2. W h a t w ill b e t h e o u t p u t o f a N O R g a te w h en b oth in p u t s a r e

H IG H ?

3. W h a t is t h e o u t p u t B o o le a n e x p r e s s io n fo r a N O R g a t e w it h R

a n d T a s in p u t s ?

4. In w h a t s t a t e m u s t t h e in p u t s t o a N O R g a t e b e in ord er to

p r o d u c e a lo g ic 1 o u t p u t ?

5 .T H E X O R G A T E

A n X O R g a te (a ls o k n o w n a s a n E O R , o r E X O R g a te ) – p ro n o u n ced a s

E x c lu s iv e O R g a t e – is a d ig it a l lo g ic g a te t h a t g iv e s a t r u e ( i.e . a H I G H o r 1 )

o u t p u t w h e n t h e n u m b e r o f t r u e in p u ts is o d d . A n X O R g a te im p le m e n ts a n

e x c lu s iv e o r , i.e . a t r u e o u t p u t r e s u lt o c c u r s if o n e – a n d o n ly o n e – o f th e

in p u t s t o t h e g a t e is t r u e . I f b o t h in p u t s a r e f a ls e ( i.e . L O W o r 0 ) o r b o t h a re

tru e , a fa ls e o u tp u t re s u lts.

X O R r e p r e s e n t s t h e i n e q u a l it y f u n c t i o n , i .e ., t h e o u t p u t i s t r u e i f th e

in p u ts a re n o t a lik e o t h e r w is e t h e o u tp u t is fa ls e . A co m m on w ay to

re m e m b er th e X O R is “ m u s t h a v e o n e o r th e o th e r, b u t n o t b o th ” .

A n o t h e r w a y t o l o o k a t a n X O R g a t e : a m o d u l o s u m o f t w o v a r i a b le s

i n a b i n a r y s y s te m l o o k s l i k e t h is :

T h e l o g i c g a t e p e r f o r m s t h i s m o d u lo s u m o p e r a t io n w i t h o u t i n c lu d in g

c a r r y i s k n o w n a s X O R g a t e . A n X O R g a te i s n o r m a ll y t w o i n p u t s l o g ic g a te

w h e r e , o u t p u t is o n ly lo g ic a l 1 w h e n o n ly o n e in p u t is lo g ic a l 1 . W h e n b o th

in p u ts a re e q u a l, th a t is e ith e r b o th a re 1 o r b o th a re 0 , th e o u tp u t w ill b e

lo g ica l 0 .

F lo r e n c e M . B a n a s ih a n Page 18
D C E E , C E IT
D ig ita l L o g ic a n d D e s ig n

T h i s i s t h e r e a s o n a n X O R g a t e a l s o c a l l e d a n t i - c o i n c id e n c e g a t e o r

i n e q u a li ty d e t e c to r . T h i s g a t e i s c a l l e d a s X O R o r e x c l u s i v e O R g a t e b e c a u s e ,

i t s o u t p u t i s o n l y 1 w h e n o n e o f i t s i n p u t i s e x c l u s i v e ly 1 .

a . L O G IC S Y M B O L

A n X O R g a t e i s l o g i c a ll y r e p r e s e n t e d a s ,

b . X O R G A T E O P E R A T IO N

In firs t ca s e co n s id e r, A = 0 a n d B = 0 .

In s e co n d ca s e co n s id er, A = 0 a n d B = 1 .

I n t h ir d c a s e c o n s id e r, A = 1 a n d B = 0 .

F lo r e n c e M . B a n a s ih a n Page 19
D C E E , C E IT
D ig ita l L o g ic a n d D e s ig n

I n f o u r t h c a s e c o n s id e r , A = 1 a n d B = 1 .

S o i t i s p r o v e d t h a t, t h e B o o le a n e x p r e s s io n f o r A ⊕ B is A B ̅ + Ā B , a s

t h i s B o o l e a n e x p r e s s i o n s a t i s f ie d a l l o u tp u t s t a te s r e s p e c t t o i n p u ts

co n d itio n s, o f a n X O R g a te .

c . L O G IC E Q U A T IO N

T h e a b o v e e x p re s s io n , A ⊕ B c a n b e s im p lifie d a s ,

f =

d . T R U T H T A B L E

T h e tru th ta b le o f a n X O R g a te is g iv e n b e lo w :

T h e b i n a r y o p e r a t i o n o f t h e a b o v e t r u t h t a b l e i s k n o w n a s e x c l u s iv e

O R o p e r a t i o n a n d i t i s r e p r e s e n t e d a s , A ⊕ B . T h e s y m b o l o f e x c l u s iv e O R

o p e r a t io n is r e p r e s e n te d b y a p lu s r in g s u r r o u n d e d b y a c ir c le ⊕ .

P R O B L E M S E T 2 0

1. F rom w h a t o t h e r lo g ic g a t e s c a n X O R b e con stru cted ?

2. H ow m a n y m in im u m n u m b e r o f g a t e is n e e d e d to op era te X O R ?

3. In w h a t c o n d it io n o f in p u t s d o e s X O R a c t iv a t e s ?

F lo r e n c e M . B a n a s ih a n Page 20
D C E E , C E IT
D ig ita l L o g ic a n d D e s ig n

5 .T H E X N O R G A T E

T h e X N O R g a t e ( a ls o k n o w n a s a X O R N ’T , E N O R , E X N O R o r N X O R )

– a n d p r o n o u n c e d a s E x c l u s iv e N O R – i s a d i g i t a l l o g ic g a t e w h o s e f u n c tio n

is th e lo g ica l co m p le m e n t o f th e e x clu s iv e O R ( X O R ) g a t e . L o g i c a l ly , a n

X N O R g a te is a N O T g a te fo llo w e d b y a X O R g a te .

A s w e k n o w t h a t X O R o p e r a tio n o f i n p u ts A a n d B i s A ⊕ B , t h e r e fo re

X N O R o p e r a t io n t h o s e i n p u ts w i l l b e ( A ⊕ B ) ̅. T h a t m e a n s , o u t p u t o f X O R

g a t e i s i n v e r t e d i n X N O R g a t e . I n X O R o p e r a t io n , t h e o u t p u t i s o n l y 1 w h e n

o n ly o n e in p u t is 1 .

T h e o u t p u t i s l o g ic a l 0 w h e n b o t h i n p u ts a r e s a m e t h a t m e a n s t h e y a re

e ith e r 1 o r 0 . B u t in th e ca s e o f X N O R g a te , th e o u tp u t is 0 w h e n o n ly o n e

in p u t is 0 a n d t h e o u t p u t is 1 w h e n b o t h in p u ts a r e s a m e t h a t is e it h e r b o th

o f th em a re 0 o r 1 .

a . L O G IC S Y M B O L

T h e e x p r e s s io n o f X N O R o p e r a tio n c a n b e r e a liz e d b y u s in g t w o N O T

g a tes, tw o A N D g a tes an d on e O R g a te as fo llo w s,

T h e sy m b o l o f X N O R g a te.

F lo r e n c e M . B a n a s ih a n Page 21
D C E E , C E IT
D ig ita l L o g ic a n d D e s ig n

b . X N O R G A T E O P E R A T IO N

N o w a n a l y z i n g t h e t i m in g d i a g r a m a b o v e :

H e n ce , it is p ro v e d th a t A ⊙ B = A B + Ā B ̅.

c . L O G IC E Q U A T IO N

Th e lo g ica l X N O R o p e ra tio n is rep resen ted b y ⊙ . T h a t is a dot

s u r r o u n d e d b y c i r c l e . T h e e x p r e s s i o n o f X N O R o p e r a t i o n b e t w e e n v a r ia b le

A a n d B is r e p r e s e n te d a s A ⊙ B . T h a t is

f = A ⊙ B or f = A B + Ā B ̅

F lo r e n c e M . B a n a s ih a n Page 22
D C E E , C E IT
D ig ita l L o g ic a n d D e s ig n

d . T R U T H T A B L E

Th e t r u t h t a b le o f t h e X N O R g a t e i s s h o w n b e l o w :

P R O B L E M S E T 2 1

1. F rom w h a t o t h e r lo g ic g a t e s c a n X N O R b e con stru cted ?

2. H ow does X N O R d iffe r fr o m X O R in t e r m s o f o p e r a t io n ?

3. C a n a n X N O R b e c o n s t r u c t e d u s in g X O R ? S h o w t h e lo g ic d ia g r a m

D . V A R IA T IO N S O F F U N D A M E N T A L G A T E S

N ow th a t y ou a re fa m ilia r w it h fu n d a m e n t a l lo g ic g a tes, l e t 's lo o k a t som e


v a r ia t io n s o f t h e s e g a t e s t h a t y o u m a y e n c o u n t e r .

U p to n ow you h a ve seen in v e r t e r s u s e d a lo n e o r o n th e ou tp u t of A N D a n d
O R g a t e s . In v e r t e r s m a y a ls o b e u s e d o n o n e o r m o r e o f t h e in p u t s t o t h e lo g ic g a t e s .
T a k e a lo o k a t t h e e x a m p le s a s d is c u s s e d in t h e fo llo w in g p a r a g r a p h s .

E . A N D /N A N D G A T E V A R IA T IO N S

If w e p la c e a n in v e r t e r o n o n e in p u t o f a t w o - in p u t A N D g a t e , t h e o u t p u t w ill
b e q u it e d iffe r e n t fr o m th a t of th e sta n d a rd A N D g a te.

In fig u r e 2 - 1 7 , w e h a v e p la c e d a n in v e r t e r o n th e A in p u t . W h e n A is H IG H ,
t h e in v e r t e r m a k e s it a LO W g o in g in t o t h e A N D g a te. In o r d e r fo r t h e o u t p u t t o b e
H IG H , A w o u ld h a v e t o b e L O W w h ile B is H IG H , a s s h o w n in t h e T r u t h T a b le . If t h e

in v e r t e r w e r e o n t h e B in p u t , t h e o u t p u t e x p r e s s io n w o u ld t h e n b e f = A B .

F lo r e n c e M . B a n a s ih a n Page 23
D C E E , C E IT
D ig ita l L o g ic a n d D e s ig n

F ig u r e 2 -1 7 . - A N D g a te w ith o n e in v e rte d in p u t.

N o w l e t 's c o m p a r e a N A N D g a t e t o a n A N D g a t e w i t h a n i n v e r t e r o n e a c h i n p u t .
F ig u r e 2 - 1 8 s h o w s t h e s e g a t e s a n d t h e a s s o c ia t e d T r u t h T a b le s . W it h t h e N A N D g a te
(v ie w A ), t h e o u t p u t is H IG H w h en e it h e r o r b o t h in p u t s is / a r e L O W . T h e A N D g a te
w it h in v e r t e r s on ea ch in p u t (v ie w B ), produ ces a H IG H ou tp u t o n ly w h en b oth
in p u t s a re LO W . T h is c o m p a r is o n a ls o p o in t s ou t th e d iffe r e n c e s b etw een th e
e x p r e s s io n s f = A B (A A N D B q u a n t it y N O T ) a n d f = A B (N O T A A N D N O T B ).

N o w , lo o k o v e r t h e T r u t h T a b le s fo r fig u r e s 2 - 1 7 , 2 - 1 8 , a n d 2 - 1 9 ; lo o k a t h ow
t h e o u t p u t s v a r y w it h in v e r t e r s in d iffe r e n t p o s it io n s .

F ig u r e 2 -1 8 . - C o m p a r is o n o f N A N D g a te a n d A N D g a te w ith in v e rte d in p u ts : A . N A N D g a te ;
B . A N D g a te w ith in v e rte rs o n e a c h in p u t.

F lo r e n c e M . B a n a s ih a n Page 24
D C E E , C E IT
D ig ita l L o g ic a n d D e s ig n

F ig u r e 2 -1 9 . - N A N D g a te w ith o n e in v e rte d in p u t.

F . O R /N O R G A T E V A R IA T IO N S

Th e ou tp u ts of O R a n d N O R g a tes m a y a ls o be ch a n ged w it h th e u se of
in v e r t e r s .

A n O R g a t e w it h o n e in p u t in v e r t e d is s h o w n in fig u r e 2 - 2 0 . T h e o u t p u t o f t h is
O R g a t e r e q u ir e s t h a t A b e L O W , B b e H IG H , o r b o t h o f t h e s e c o n d i t io n s e x is t in g a t
t h e s a m e t im e in o r d e r t o h a v e a H IG H o u t p u t . S in c e t h e A in p u t is in v e r t e d , it m u st

be LO W if B is L O W in o rd er to p ro d u ce a H IG H o u t p u t . T h e r e fo r e t h e o u t p u t is f =
A +B .

F ig u r e 2 -2 0 . - O R g a te w ith o n e in v e rte d in p u t.

F ig u r e 2 - 2 1 com pa res a N O R g a t e (v ie w A ), t o a n O R g a t e w it h in v e r t e r s on
b oth in p u t s (v ie w B ), a n d sh ow s th e r e s p e c t iv e T ru th T a b le s . Th e N O R g a t e w ill
p ro d u ce a H IG H o u t p u t o n ly w h e n b o t h in p u t s a r e L O W . T h e O R g a t e w it h in v e r t e d

in p u t s produ ces a H IG H o u t p u t w it h a ll in p u t c o m b in a t io n s E X C E PT w h en b oth


in p u t s a r e H I G H . T h is fig u r e a ls o illu s t r a t e s t h e d iffe r e n c e s b e t w e e n t h e e x p r e s s io n s
f = A + B (A O R B q u a n t it y N O T ) a n d f = A + B (N O T A O R N O T B ).

F lo r e n c e M . B a n a s ih a n Page 25
D C E E , C E IT
D ig ita l L o g ic a n d D e s ig n

F ig u r e 2 -2 1 . - C o m p a r is o n o f N O R g a t e a n d O R g a te w ith in v e rte d in p u ts : A . N O R g a te ; B .
O R g a te w ith in v e rte rs o n b o th in p u ts .

A s w it h th e N A N D g a te, on e or m o r e in p u t s to N O R g a tes m a y b e in v e r t e d .
F ig u r e 2 - 2 2 s h o w s t h e r e s u lt o f in v e r t in g a N O R g a t e in p u t . In t h is c a s e , b e c a u s e o f
t h e in v e r s io n of th e B in p u t a n d t h e in v e r s io n o f t h e o u t p u t , t h e o n ly t im e t h is g a te
w ill p r o d u c e a H IG H o u t p u t is w h e n A is L O W a n d B is H IG H . T h e o u t p u t B o o le a n

e x p r e s s io n fo r t h is g a t e is

F ig u r e 2 -2 2 . - N O R g a te w ith o n e in v e rte d in p u t.

T a b le 2 -4 illu s t r a t e s A N D , N O R , N A N D , a n d O R g a te c o m b in a t io n s th at
p r o d u c e t h e s a m e o u t p u t . Y o u c a n s e e b y t h e t a b le t h a t t h e r e is m o r e t h a n o n e w a y
t o a c h ie v e a d e s ir e d o u t p u t . A lt h o u g h t h e g a t e s h a v e o n ly t w o in p u t s , t h e t a b le c a n
b e exten d ed t o m o r e t h a n t w o in p u t s .

F lo r e n c e M . B a n a s ih a n Page 26
D C E E , C E IT
D ig ita l L o g ic a n d D e s ig n

T a b le 2 -4 . - E q u iv a le n t A N D and N O R , N A N D and O R G a te s

P R O B L E M S E T 2 2 (Q 2 4 - 2 6 )

4. W h a t is t h e o u t p u t B o o le a n e x p r e s s io n fo r a n A N D g a t e w it h A a n d B
a s in p u t s w h e n th e B in p u t is in v e r t e d ?
5. W h a t is t h e e q u iv a le n t lo g ic g a te of a t w o - in p u t N A N D g a t e w it h b oth

in p u t s in v e r t e d ?
6. W h a t is t h e o u t p u t B o o le a n e x p r e s s io n fo r t h e fo llo w in g g a t e s ?

F lo r e n c e M . B a n a s ih a n Page 27
D C E E , C E IT
D ig ita l L o g ic a n d D e s ig n

G . L O G IC G A T E S IN C O M B IN A T IO N

W h en you lo o k a t lo g ic c ir c u it d ia g r a m s fo r d ig it a l e q u ip m e n t , you a re n ot
g o in g t o s e e ju s t a s in g le g a t e , b u t m a n y c o m b in a t io n s o f g a t e s . A t fir s t it m a y s e e m
c o n fu s in g a n d c o m p le x . If y o u in t e r p r e t o n e g a t e a t a t im e , y o u ca n w ork you r w ay
th ro u g h a n y n etw o rk . In t h is s e c t io n , w e w ill a n a ly z e s e v e r a l c o m b in a t io n s o f g a t e s
a n d t h e n p r o v id e y o u w it h s o m e p r a c t ic e p r o b le m s .

F ig u r e 2 - 2 3 (v ie w A ) s h o w s a s im p le c o m b in a t io n of A N D g a tes. T h e o u t p u ts
of g a tes 1 a n d 2 a r e t h e in p u t s t o g a t e 3 . Y o u a lr e a d y k n o w th a t b oth in p u t s t o a n
A N D g a te m u st b e H IG H a t t h e s a m e t im e in o r d e r t o p r o d u c e a H IG H ou tp u t.

F ig u r e 2 -2 3 . - L o g ic g a t e c o m b in a t io n s : A . S im p le c o m b in a t io n o f A N D g a te s ; B . S im p le
c o m b in a tio n o f A N D g a te s a n d O R g a te .

T h e o u t p u t B o o le a n e x p r e s s io n of g a te 1 is R S , a n d t h e o u t p u t e x p r e s s io n of
g a t e 2 is T V . T h e s e t w o o u t p u t e x p r e s s io n s b e c o m e t h e in p u t s t o g a t e 3 . R e m e m b e r ,
th e ou tp u t B o o le a n e x p r e s s io n is th e r e s u lt of th e in p u t s , in t h is ca se (R S )(T V );
spoken " q u a n t it y R A N D S A N D q u a n t it y T A N D V ."

In v ie w B w e h a ve ch a n ged g a te 3 to a n O R g a te. T h e ou tp u ts of g a tes 1 a n d


2 r e m a in t h e s a m e b u t t h e o u t p u t o f g a t e 3 c h a n g e s a s y o u w o u ld e x p e c t . T h e o u t p u t
o f g a t e 3 is n o w (R S )+ (T V ); s p o k e n " q u a n t it y R A N D S O R q u a n t it y T A N D V ."

In fig u r e 2 - 2 4 (v ie w A ), t h e o u t p u t s o f t w o O R g a t e s a r e b e in g a p p lie d a s th e
in p u t t o t h ir d O R g a te. T h e o u t p u t fo r g a t e 1 is R + S , a n d t h e o u t p u t fo r g a t e 2 is
T + V . W it h t h e s e in p u t s , t h e o u t p u t e x p r e s s io n o f g a t e 3 is (R + S )+ (T + V ).

F lo r e n c e M . B a n a s ih a n Page 28
D C E E , C E IT
D ig ita l L o g ic a n d D e s ig n

F ig u r e 2 -2 4 . - L o g ic g a t e c o m b in a t io n s : A . S im p le c o m b in a t io n o f O R g a t e s ; B . S im p le
c o m b in a tio n o f O R g a te s a n d A N D g a te ; C . O u tp u t e x p re s s io n w ith o u t th e p a re n th e s e s .

In v ie w B , g a te 3 h a s been ch a n ged to a n A N D g a te. T h e ou tp u ts of g a tes 1


a n d 2 d o n o t c h a n g e , b u t t h e o u t p u t e x p r e s s io n o f g a t e 3 d o e s . In t h is c a s e , t h e g a te
3 o u t p u t e x p r e s s io n is (R + S )(T + V ). T h is e x p r e s s io n is s p o k e n , " q u a n t it y R O R S A N D
q u a n t it y T O R V ." Th e p a ren th eses a re u sed to sep a ra te th e in p u t term s a n d to
in d ic a t e th e A N D fu n c t io n . W it h o u t t h e p a r e n t h e s e s t h e o u t p u t e x p r e s s io n w o u ld
r e a d R + S T + V , w h ic h is r e p r e s e n t a t iv e o f t h e c ir c u it in v ie w C . A s you ca n s e e , t h is
is n o t t h e s a m e c ir c u it a s t h e o n e d e p ic t e d in v ie w B . It is v e r y im p o r t a n t t h a t t h e
B o o le a n e x p r e s s io n s b e w r it t e n a n d s p o k e n c o r r e c t ly .

Th e T ru th T a b le fo r th e o u t p u t e x p r e s s io n of g a te 3 (v ie w B ) w ill h e lp you
b etter u n d ersta n d th e ou tp u t. W h en s t u d y in g t h is T r u t h T a b le , n o t ic e t h a t t h e o n ly

t im e f is H IG H (lo g ic 1 ) is w h e n e it h e r o r b o t h R a n d S A N D e it h e r o r b o t h T a n d V
a re H IG H (lo g ic 1 ).

R S T V f

0 0 0 0 0

0 0 0 1 0

0 0 1 0 0

0 0 1 1 0

0 1 0 0 0

F lo r e n c e M . B a n a s ih a n Page 29
D C E E , C E IT
D ig ita l L o g ic a n d D e s ig n

0 1 0 1 1

0 1 1 0 1

0 1 1 1 1

1 0 0 0 0

1 0 0 1 1

1 0 1 0 1

1 0 1 1 1

1 1 0 0 0

1 1 0 1 1

1 1 1 0 1

1 1 1 1 1

f = (R + S ) (T + V )

N ow l e t 's d e t e r m in e th e o u t p u t e x p r e s s io n fo r th e N O R g a t e in fig u r e 2 - 2 5 .
F ir s t w r it e t h e o u t p u t s o f g a t e s 1 , 2 , a n d 3 :

F ig u r e 2 -2 5 . - L o g ic g a t e c o m b in a t io n s .

S in c e a ll t h r e e o u t p u t s a r e a p p lie d to g a te 4 , p roceed a s you w o u ld fo r a n y


N O R g a te. W e sep a ra te ea ch in p u t t o g a te 4 w it h a n O R s ig n (+ ) a n d th en p la c e a
v in c u lu m o v e r t h e e n t ir e e x p r e s s io n . T h e o u t p u t e x p r e s s io n o f g a t e 4 is :

F lo r e n c e M . B a n a s ih a n Page 30
D C E E , C E IT
D ig ita l L o g ic a n d D e s ig n

T h e T r u t h T a b le s h o w n b e lo w is o n ly fo r g a t e 4 .

W h en you a r e t r y in g t o d e t e r m in e t h e o u t p u t s o f lo g ic g a t e s in c o m b in a t io n ,
ta k e th em o n e g a t e a t a t im e !

P R O B L E M S E T 2 3 (Q 2 7 - 3 2 )

N ow w rite th e o u tp u t e x p re s s io n s fo r th e fo llo w in g lo g ic g a te c o m b in a tio n s :

1.

2.

3.

F lo r e n c e M . B a n a s ih a n Page 31
D C E E , C E IT
D ig ita l L o g ic a n d D e s ig n

4.

5.

6.

H . L o g ic C ir c u it , L o g ic E q u a t io n a n d T ru th T a b le M a n ip u la t io n

T h e r e a r e t h r e e c o m m o n w a y s in w h ic h t o r e p r e s e n t lo g ic .

1. T r u t h T a b le s

2. L o g ic C ir c u it D ia g r a m

3. B o o le a n E x p r e s s io n

1 . T ru th T a b le s

A t r u t h t a b le is a c h a r t o f 1 s a n d 0 s a r r a n g e d t o in d ic a t e t h e r e s u lt s (o r

o u t p u t s ) o f a ll p o s s ib le in p u t s . T h e lis t o f a ll p o s s ib le in p u t s a r e a r r a n g e d in

F lo r e n c e M . B a n a s ih a n Page 32
D C E E , C E IT
D ig ita l L o g ic a n d D e s ig n

c o lu m n s on t h e le ft a n d t h e r e s u lt in g o u t p u t s a r e lis t e d in c o lu m n s on th e

r ig h t . Th ere a re 2 to th e p ow er n p o s s ib le s t a t e s (o r c o m b in a t io n o f in p u t s ).

F or e x a m p le , w it h th ree in p u t s th ere a re 2^3=8 p o s s ib le c o m b in a t io n of

in p u t s .

2 . L o g ic D ia g r a m

A lo g ic d ia g r a m u ses th e p ic t o r ia l d e s c r ip t io n of lo g ic g a tes in

c o m b in a t io n t o r e p r e s e n t a lo g ic e x p r e s s io n . A n e x a m p le b e lo w s h o w s a lo g ic

d ia g r a m w it h t h r e e in p u t s (A , B , a n d C ) a n d o n e o u t p u t (Y ). T h e in t e r p r e t a t io n

o f t h is w ill b e c o m e c le a r in t h e fo llo w in g s e c t io n s .

3 . L o g ic E q u a t io n

L o g ic e q u a t io n is u s e d t o w r it e a lo g ic e x p r e s s io n in e q u a t io n fo r m .

T h e r e a r e a fe w s y m b o l s t h a t y o u ’l l r e c o g n i z e b u t n e e d t o r e d e fin e .

F lo r e n c e M . B a n a s ih a n Page 33
D C E E , C E IT
D ig ita l L o g ic a n d D e s ig n

N o t e : S o m e t im e s w h e n t h e “ ! (e x c la m a t io n p o in t ) ” o r “ ‘ (s in g le q u o t e )

“ a r e u s e d t o r e p r e s e n t t h e N O T it is u s e d b e fo r e t h e le t t e r a n d s o m e t im e s it

is u s e d a ft e r t h e le t t e r . C a r e s h o u ld b e u s e d s o t h a t y o u u n d e r s t a n d w h ic h

m e t h o d is b e in g u s e d !

B e lo w is a n e x a m p le lo g ic e q u a t io n . I n fa c t , it r e p r e s e n t s t h e s a m e

lo g ic a s t h e e x a m p le lo g ic c ir c u it d ia g r a m a bove. T h is c o n c e p t w ill a ls o

b e c o m e c le a r e r w h e n w e c o v e r c o n v e r t in g fr o m a n d to th e lo g ic e q u a t io n

b e lo w .

4 . C o n v e r t in g fr o m a L o g ic C ir c u it D ia g r a m to a T ru th T a b le

T h is c o n v e r s io n is a c c o m p lis h e d b y s e le c t in g e a c h s t a t e (o r c o m b in a t io n

o f in p u t s ) o n e a t a t im e , r e p la c in g t h e in p u t s w it h t h e ir r e s p e c t iv e v a lu e s a n d

fig u r in g t h e v a lu e o f e a c h p o in t t h r o u g h t h e c ir c u it u n t il t h e o u t p u t is r e a c h e d .

T h e fin a l o u t p u t v a lu e fo r e a c h s t a t e is t h e n lis t e d in th e tru th ta b le n ext to

t h e v a lu e o f e a c h in p u t . B e lo w is a lo g ic c ir c u it d ia g r a m w it h t h e in p u t v a lu e s .

B e lo w a r e t h e r e s u lt s o f t h e c o n v e r s io n in t r u t h t a b le fo r m .

5 . C o n v e r t in g L o g ic C ir c u it D ia g r a m s t o B o o le a n E x p r e s s io n s

F lo r e n c e M . B a n a s ih a n Page 34
D C E E , C E IT
D ig ita l L o g ic a n d D e s ig n

To c o n v e r t fr o m a lo g ic c ir c u it d ia g r a m to a lo g ic e q u a t io n w e s t a r t b y

lis t in g ou r in p u t s a t th e correct p la c e a n d process th e in p u t s th rou g h th e

g a tes, on e g a te a t a t im e , w r it in g th e r e s u lt a t ea ch g a t e ’s ou tp u t. Th e

fo llo w in g is t h e r e s u lt in g lo g ic e q u a t io n o f e a c h of th e g a tes.

A n d h e r e is a n e x a m p le o f t h e p r o c e s s b e in g c a r r ie d o u t . T h e fa c t t h a t

t h e r e s u lt s im p lifie s t o t h e X O R is m e r e ly c o in c id e n t a l.

E x a m p le :

C o n v e r t t h e g iv e n t h e L o g ic E q u a t io n in t o a T r u t h T a b le

F lo r e n c e M . B a n a s ih a n Page 35
D C E E , C E IT
D ig ita l L o g ic a n d D e s ig n

N o w a ft e r d r a w in g t h e c ir c u it a s s h o w n a b o v e a n d a p p ly in g t h e r e q u ir e d
o p e r a t io n s in ea ch g a t e , t h e T r u t h T a b le c a n b e d r a w n a s :

P R O B L E M S E T 2 4

1. D r a w t h e T r u t h T a b le o f t h e g iv e n L o g ic C ir c u it

F lo r e n c e M . B a n a s ih a n Page 36
D C E E , C E IT
D ig ita l L o g ic a n d D e s ig n

2. H ow m a n y in p u t c o m b in a t io n s a r e n e e d e d in a t r u t h t a b le g iv e n a
lo g ic c ir c u it c o n s is t in g o f fo u r (4 ) in p u t v a r ia b le s ?

F lo r e n c e M . B a n a s ih a n Page 37
D C E E , C E IT

You might also like