chap2
chap2
Combinational Logic
Logic 0 Logic 1
False True
Off On
Low High
No Yes
Open switch Closed switch
A B X
A 0 0 1
? X
B 0 1 0
1 0 1
1 1 0
ELEC 335, Digital Logic Design, UAE University
The Inverter
A X
The Inverter
Input Output
A X
LOW (0) HIGH (1)
HIGH (1) LOW(0)
Example waveforms:
A
X
A group of inverters can be used to form the 1’s complement
of a binary number: Binary number
1 0 0 0 1 1 0 1
0 1 1 1 0 0 1 0
1’s complement
And operation with AND gates
• The truth table and circuit symbol for a 2-input AND
logic circuit is show below:
A B X=A·B
0 0 0
X=A·B
0 1 0 A
B
1 0 0
1 1 1
X
The AND operation is used in computer programming as a
selective mask. If you want to retain certain bits of a binary
number but reset the other bits to 0, you could set a mask with
1’s in the position of the retained bits.
If the binary number 10100011 is ANDed with
the mask 00001111, what is the result? 00000011
ELEC 335, Digital Logic Design, UAE University
Or operation with OR gates
A B X=A+B
0 0 0 A X=A+B
0 1 1 B
1 0 1
1 1 1
A X A ≥1 X
B B
Example waveforms:
A
B
X
The OR operation can be used in computer programming to set certain
bits of a binary number to 1.
ASCII letters have a 1 in the bit 5 position for lower case letters
and a 0 in this position for capitals. (Bit positions are numbered
from right to left starting with 0.) What will be the result if you
OR an ASCII letter with the 8-bit mask 00100000?
The resulting letter will be lower case.
ELEC 335, Digital Logic Design, UAE University
The NAND Gate
A X A & X
B B
The NAND gate produces a LOW output when all inputs
are HIGH; otherwise, the output is HIGH. For a 2-input
gate, the truth table is Inputs Output
A B X
0 0 1
0 1 1
1 0 1
1 1 0
A X A & X
B B
Example waveforms:
A
B
X
The NAND gate is particularly useful because it is a
“universal” gate – all other basic gates can be constructed
from NAND gates.
How would you connect a 2-input NAND gate
to form a basic inverter?
A X A ≥1 X
B B
The NOR gate produces a LOW output if any input is
HIGH; if all inputs are HIGH, the output is LOW. For a
2-input gate, the truth table is
Inputs Output
A B X
0 0 1
0 1 0
1 0 0
1 1 0
The NOR operation is shown with a plus sign (+) between
the variables and an overbar covering them. Thus, the NOR
operation is written as X = A + B.
ELEC 335, Digital Logic Design, UAE University
The NOR Gate
A X A ≥1 X
B B
Example waveforms:
A
B
X
The NOR operation will produce a LOW if any input is HIGH.
+5.0 V
When is the LED is ON for the circuit shown? 330 Ω
A
The LED will be on when any of B X
C
the four inputs are HIGH. D
A X A =1 X
B B
The XOR gate produces a HIGH output only when both
inputs are at opposite logic levels. The truth table is
Inputs Output
A B X
0 0 0
0 1 1
1 0 1
1 1 0
A X A =1 X
B B
The XNOR gate produces a HIGH output only when both
inputs are at the same logic level. The truth table is
Inputs Output
A B X
0 0 1
0 1 0
1 0 0
1 1 1
The XNOR operation shown as X = AB + AB. Alternatively,
the XNOR operation can be shown with a circled dot
between the variables. Thus, it can be shown as X = A . B.
A X A =1 X
B B
Example waveforms:
A
B
X
Notice that the XNOR gate will produce a HIGH when both inputs are the
same. This makes it useful for comparison functions.
If the A waveform is inverted but B remains the same, how is
the output affected?
• Associative laws
x + (y + z) = (x + y) + z = x + y + z
x(yz) = (xy)z = xyz
ELEC 335, Digital Logic Design, UAE University
Laws of Boolean Algebra
• Distributive laws
x(y + z) = xy + xz
x + (yz) = (x + y)(x + z)
(w+x)(y+z) = wy +xy +wz + xz
• Identity laws
x
x⋅0=0 0 0
x
x⋅1=x 1 x
• Complement
x
x ⋅ x’ = 0 0
x
x + x’ = 1 1
(x’)’ = x x x
• x+ xy = x
• x + x’ y = x + y
• x+ x’ y’ = x + y’
• (x . y)’ = x’ + y’ DeMorgan’s theorem
• (x + y)’ = x’ . y’ DeMorgan’s theorem
ELEC 335, Digital Logic Design, UAE University
Summary of Rules of Boolean Algebra
1. A + 0 = A 7. A . A = A
2. A + 1 = 1 8. A . A = 0
=
3. A . 0 = 0 9. A = A
4. A . 1 = A 10. A + AB = A
5. A + A = A 11. A + AB = A + B
6. A + A = 1 12. (A + B)(A + C) = A + BC
x + xy = x
x + 1 = 1 x + xy = x(1 + y)
x + 1 = x + (x + x’) = x(1) = x
= x + x + x’
= x(1 + 1) + x’
= x + x’= 1
• Simplify x = (A + B) (A + B + D)D
= AAD + ABD + ADD + ABD + BBD + BDD
= ABD + ABD + BD
= BD(A + A + 1)
= BD
F = (a.b)+(b.c)
a
b
F
Example 1: F1 = x + y ' z
x F1
y
z
z F1
F3 = xy + x' z + yz
= xy + x' z + yz ( x + x' )
= xy + x' z + xyz + x' yz
= xy (1 + z ) + x' z (1 + y )
= xy + x' z
x
y
F3
x x
y x+y x ⋅ y = x+y
y
x x ⋅ y = x+y
y
x x
x⋅y y x + y = x⋅y
y
x
y x + y = x⋅y
A⋅B AND
A A
1 2 x = A ⋅B
B B
A A OR
x = A⋅B = A + B
A
B
B
B
OR
A+B A+B
A A
B B
A A AND
A
B
B
B
ELEC 335, Digital Logic Design, UAE University
Conversion to all NAND gates
• Ex: convert to all NAND
A A
B B
C C
D D
E E
A
B
C
D
E
ELEC 335, Digital Logic Design, UAE University
Conversion to all NOR gates
• Ex: convert to all NOR
A A
B B
C C
D D
A
B
C
D
A x NOT A 1 x
A A
x AND B & x
B
A x OR A
B B ≥1 x
A A
x NAND & x
B B
A A
x NOR ≥1 x
B B
ELEC 335, Digital Logic Design, UAE University
Selected Key Terms
a. 0 0 0 b. 0 0 1
0 1 1 0 1 0
1 0 1 1 0 0
1 1 0 1 1 0
a. 0 0 0 b. 0 0 1
0 1 1 0 1 0
1 0 1 1 0 0
1 1 0 1 1 0
a. OR gate
b. AND gate
c. NOR gate
d. XOR gate
X
© 2008 Pearson Education
9. A 2-input gate produces a HIGH output only when the
inputs agree. This type of gate is a(n)
a. OR gate
b. AND gate
c. NOR gate
d. XNOR gate