Professional Documents
Culture Documents
Digital Electronics Basics: Combinational Logic
Digital Electronics Basics: Combinational Logic
Combinational Logic
for
Basic Electronics
http://cktse.eie.polyu.edu.hk/eie209
by
Prof. Michael Tse
January 2005
Digital versus analog
So far, our discussion about electronics has been predominantly “analog”,
which is concerned with continuously changing signals—signals whose values
at different times are useful information.
A digital signal assumes just a few analog values. For example, binary signals
have two values, e.g., 0V and 5V. They transmit information in the form of a
sequence of 0V and 5V segments.
5V
0V
0 1 0 1 0 0 1 0 1 1 0
Noise Margins:
5V
VOH VIH
VOL
0V VIL
0 1 0 1 0 0 1 0 1 1 0
For example, we can design a digital electronic circuit to make an instant decision
based on some information. Here we emphasize “instant” in the decision making
process. That means, the process has no time delay.
X Y Z X Y Z X Z
0 0 0 0 0 0 0 1
0 1 0 0 1 1 1 0
1 0 0 1 0 1
1 1 1 1 1 1
Truth table of AND Truth table of OR Truth table of NOT
X X
Z Z X Z
Y Y
X Y Z X Y Z X Y Z
0 0 1 0 0 1 0 0 0
0 1 1 0 1 0 0 1 1
1 0 1 1 0 0 1 0 1
1 1 0 1 1 0 1 1 0
Truth table of NAND Truth table of NOR Truth table of XOR (Exclusive OR)
X X X
Z Z Z
Y Y Y
C.K. Tse: Digital Electronics: 5
Combinational Logic
Boolean algebra
Logic can also be expressed in algebraic form.
X Y Z
0 0 0 X
0 1 0 Z = X.Y Y
Z
1 0 0 AND gate
1 1 1
Truth table of AND
X Y Z X
0 0 1 Y Z
0 1 1
Z = X.Y
1 0 1 X
Z
Y
1 1 0
Truth table of NAND NAND gate
X Y Z
0 0 0 X
0 1 1 Z = X+Y Y
Z
1 0 1 OR gate
1 1 1
Truth table of OR
X Y Z X
0 0 1 Y Z
0 1 0
Z = X+Y
1 0 0 X
Z
Y
1 1 0
Truth table of NOR NOR gate
X Y Z
The expression for Z is
0 0 1
0 1 0
1 0 0
Z = X .Y
1 1 0
Truth table of NOR
Question: These are NAND and NOR gates! Can they be simplified or
converted back to the originally derived forms? How can we do it?
Z = X .Y + X .Y + X.Y
Y
Z
Note: This is same as a NAND gate (see the truth table), and hence should be the
same as
X
Z
Y
Basic Laws:
De Morgan’s: X+Y = X . Y
X.Y = X + Y
= X.Y X .X = 0
Z = X .Y + X.Y + X.Y
= (X + X).Y + X.Y
= Y + X.Y
= X .Y + 0 Y .Y = 0
= X .Y
= X +Y De Morgan’ law
X.Y
Y
Therefore Z = X + Y or Z = X.Y
C.K. Tse: Digital Electronics: 16
Combinational Logic
Karnaugh map (with 3 inputs)
Output x is
Procedure:
x = a.b.c + a.b .c + a .b.c + a.b.c 1. Circle clusters of “1”.
2. Determine the logic
b 110
b expressions for each cluster.
} 011
}
bc 3. Add them up.
a 00 01 11 10
111 a{ 0 0 0 1 1
ab
a{ 1
1 0 1 0
}
}
}
100
c c c Hence, we get
x = a.b.c + b.c + a .b
bc
abc
C.K. Tse: Digital Electronics: 17
Combinational Logic
Example: Gray code b b
}
}
bc
Binary Gray code a 00 01 11 10
a b c x y z
0 0 0 0 0 0 a{ 0 0 0 1 1
0 0 1 0 0 1 y
0
0
1
1
0
1
0 1 1
0 1 0
a{ 1
1 1 0 0
}
}
}
1 0 0 1 1 0
1 0 1 1 1 1 c c c
1
1
1
1
0
1
1 0 1
1 0 0
y = ab + a b
b b b
b
}
}
}
}
bc bc
a a 00 01 11 10
00 01 11 10
a{ 0 0 0 0 0 a{ 0 0 1 0 1
x z
a{ 1
1 1 1 1 a{ 1
0 1 0 1
}
}
}
}
}
c c c c c
c
x=a z = b c + bc
C.K. Tse: Digital Electronics: 18
Combinational Logic
Example: Gray code
a
Binary
b c
Gray code
x y z
x=a
0 0 0 0 0 0
0 0 1 0 0 1 y = ab + a b
0 1 0 0 1 1
0
1
1
0
1
0
0 1 0
1 1 0
z = b c + bc
1 0 1 1 1 1
1 1 0 1 0 1
1 1 1 1 0 0 a x
y
b
c c
{
{
cd
ab 00 01 11 10
00 }b
a { 01
11
} b
a { 10
{
} }b
{
d d d
{
{
cd
Procedure: ab 00 01 11 10
1. Circle clusters of “1”.
00 1 1 0 0 }b
2.
3.
Determine the logic
expressions for each cluster.
Add them up.
a { 01 1 1 1 1
ac 11 1 1 1 1
} b
a { 10 0 0 1 1 }b
}
{
{
d d d
b
ac
x = a c + b + ac
C.K. Tse: Digital Electronics: 21
Combinational Logic
Example
Derive the circuit for this combinational logic.
x = a c + b + ac
a
c
b x