Logic Gates and Boolean Algebra
Logic Gates and Boolean Algebra
3-1
Boolean Constants – only 2 values
TRUE, FALSE
HI, LO
1, 0
3-2
Common Logic-level
voltage ranges
TTL CMOS (74AC)
5.0V 5.0V
Logic 1 Logic 1
3.5V
2.0V
Indeterminate
Indeterminate
Indeterminate
Indeterminate
1.5V
0.8V
Logic 0
Logic 0
0V 0V
3-3
A typical logic circuit
output:
X
Y Logic circuit F
Z
3-4
Truth table
Logic function can be fully described by a
Truth Table.
The Truth table
• shows how a logic circuit’s output
responds to various combinations of
logic inputs
• has 2N number of input combinations for
N inputs
• lists all possible input combinations in
the binary counting sequence
3-5
A typical N-input truth table
3-6
3 Basic Logic Operations
Logical addition - OR
Logical multiplication - AND
Logical complement or inversion - NOT
3-7
Logical OR Operation
A
X
B Logic
symbol
Logical OR operation
X = A + B Logic
X = A OR B
expression
3-8
Truth table for a 2-input OR gate
(X = A+B)
Inputs Output
A B X
0 0 0
0 1 1
1 0 1
1 1 1
3-9
A
B X
C
3-input OR gate:
X=A+B+C
3-10
Truth Table for a 3-input OR gate
(X = A+B+C)
Inputs Output
A B C X
0 0 0 0
0 0 1 1
0 1 0 1
0 1 1 1
1 0 0 1
1 0 1 1
1 1 0 1
1 1 1 1
3-11
Logical AND operation
Logical AND operation
• X=A•B
• X = A AND B A
X
• X = AB
B
2-input AND gate:
• X = AB A
B X
3-input AND gate: C
• X = ABC
Inputs Output
A B X
0 0 0
0 1 0
1 0 0
1 1 1
3-13
The Truth Table for a 3-input AND gate
(X = ABC)
Inputs Output
A B C X
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
3-14
Logical NOT operation
NOT gate only has 1 input and it is
commonly known as an inverter
X=A A X
3-15
Logical NOT operation
Its truth table is very simple
input output
A X = A’
0 1
1 0
3-16
Buffer
Its truth table is also very simple
No change in logic
input output
A X A X=A
0 0
1 1
3-17
Example: Sketch the logic waveform of X
A
B X=A’+B
3-18
Timing diagram with more realistic
appearance, showing propagation delays,
rise time and fall time
3-20
Order of Precedence in
Boolean Algebra:
AND Examples:
1. Y = A + B C’
OR 2. Y = (A + B) C’
3. Y = A + (B C)’
3-21
Describing logic circuits algebraically
AND, OR and NOT operations
• are basic building blocks of digital system
A
B X
C
3-22
Evaluating logic circuit outputs
From a Boolean expression, the logic level of
an output can be determined for any values of
the circuit inputs.
If inputs A,B,C,D = 0,1,1,0
X=?
Example
If inputs A,B,C,D = 1,1,1,1
X = A’(B+C)(A+D)’ X=?
3-23
Determining Instantaneous Output
Level from a Logic Circuit Diagram
A
B X
C
D
3-24
Implementing Circuits from Boolean
expressions
3-25
Boolean Theorems
3-26
Boolean Theorems
Axioms:
X = 0 if X ≠ 1
X = 1 if X ≠ 0
0·0=0 1+1=1
1·1=1 0+0=0
0·1=1·0=0 1+0=0+1=1
3-27
Single variable theorems:
X•0=0 X+1=1
X•1=X X+0=X
X•X=X X+X=X
X • X’ = 0 X + X’ = 1
(X’)’ = X
Distributive laws:
A(B + C) = AB + AC
(A + B)(C + D) = AC + BC + AD + BD
3-30
Absorption laws
A + AB = A A + A’B = A + B
proof: proof:
A + AB = A(1 + B) A + A’B = A + AB + A’B
=A•1=A = A + (A + A’)B
= A + (1) B
=A+B
A technique commonly
used in algebraic
simplification
3-31
Absorption laws (Venn diagrams)
A + AB = A A + A’B = A + B
A’B
B
A A
3-32
Consensus
AB + A’C + BC = AB + A’C
proof:
BC = ABC + A’BC
Thus AB + A’C + BC = AB + A’C + ABC + A’BC
= AB + ABC + A’C + A’BC
= AB (1+C) + A’C(1+B)
= AB + A’C
3-33
DeMorgan’s Theorems
(A + B)’ = A’ • B’
proof:
A B (A+B)’ A’ • B’
0 0 1 1
0 1 0 0
1 0 0 0
1 1 0 0
3-34
DeMorgan’s Theorems
(AB)’ = A’ + B’
proof:
A B (AB)’ A’ + B’
0 0 1 1
0 1 1 1
1 0 1 1
1 1 0 0
3-35
DeMorgan’s Theorems
generalise to many variables
(A+B+C+D+…)’ = A’ • B’ • C’ • D’ • …
(ABCD…)’ = A’+B’+C’+D’+ …
3-36
Example
Simplify [A (B + C’)’ D]’
3-37
NOR gate & NAND gate
Combines basic operations of OR & AND
with NOT
A
NOR: X = (A+B)’ X
B
A
NAND: X = (AB)’ X
B
3-38
Truth table for 2-input NOR gate
X = A NOR B
Inputs Output
A B X
0 0 1
0 1 0
1 0 0
1 1 0
3-39
Truth table for 2-input NAND gate
X = A NAND B
Inputs Output
A B X
0 0 1
0 1 1
1 0 1
1 1 0
3-40
Truth table for 3-input NOR gate
X = (A+B+C)’
Inputs Output
A B C X
0 0 0 1
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 0
3-41
Truth table for 3-input NAND gate
X = (ABC)’
Inputs Output
A B C X
0 0 0 1
0 0 1 1
0 1 0 1
0 1 1 1
1 0 0 1
1 0 1 1
1 1 0 1
1 1 1 0
3-42
Summary
OR: output is 1 when any of the inputs is 1
3-43
Universality of NAND gates and NOR gates
3-44
Fig. 3-29 Basic gates from NAND
(Tocci, 10th ed. Pg. 84)
3-45
Fig. 3-30 Basic gates from NOR
(Tocci, 10th ed. Pg. 84)
3-46
Alternate Logic gate representations
The alternate symbol is obtained from the standard
symbol by applying DeMorgan’s theorems
• adding bubbles to each input and output of
the standard symbol
• removing bubble from the output of the
standard symbol
• change the operation symbol from AND to OR
and vice versa
• NOT symbol shape is not changed
3-49
Fig. 3-46
3-50
Fig. 3-47
3-51
Fig. 3-48
3-52
Fig. 3-49
Exclusive-OR gate
Ex-OR (XOR)
A
X = AB’ + A’B X
X=A⊕B B
A
A B X X
=1
0 0 0 B
0 1 1 IEEE
1 0 1 symbol
Different
1 1 0
from OR
3-53
Exclusive-NOR gate
Ex-NOR (XNOR)
A
X
X = AB + A’B’
B
X = (A ⊕ B)’
A B X A
=1 X
0 0 1 B
0 1 0
IEEE
1 0 0 symbol
1 1 1
3-54
Application of XOR
Bit-wise comparator
output is 1 if the two multi-bit inputs are
different
3-55
XOR with multiple inputs
A ⊕ B ⊕ C = (A ⊕ B) ⊕ C
= A ⊕ (B ⊕ C)
3-56
Logic devices
Different ways to create a physically
functioning logic circuit
Examples: use standard logic integrated
circuits (ICs), application-specific ICs
(ASICs), programmable logic devices
Small-scale integrated logic devices: AND,
OR, NOT, NAND, NOR, XOR, XNOR
We will use some of these in lab
experiment 1
3-57
Pin numbers
Plastic or ceramic
protective casing
Top view
Metal
pins
3-58
Common IC packaging
7404 7408
Hex-NOT Quad-AND
3-60
Circuit connection diagram
3-61