Professional Documents
Culture Documents
Computer Architecture
Sarah Harris & David Harris
Chapter 2:
Combinational Logic
Design
Chapter 2 :: Topics
• Combinational Circuits
• Boolean Equations
• Boolean Algebra
• From Logic to Gates
• X’s and Z’s, Oh My
• Karnaugh Maps
• Combinational Building Blocks
• Timing
Combinational Circuits
Introduction
A logic circuit is composed of:
• Inputs
• Outputs
• Functional specification
• Timing specification
functional spec
inputs outputs
timing spec
– Internal: n1 B E3 Y
• Circuit elements C E2 Z
– E1, E2, E3
– Each a circuit
functional spec
inputs outputs
timing spec
Boolean Equations
Boolean Equations
• Functional specification of outputs in terms
of inputs
• Example: S = F(A, B, Cin)
Cout = F(A, B, Cin)
A
C S
B L
Cout
Cin
S = A B Cin
Cout = AB + ACin + BCin
POS – product-of-sums
C M E maxterm
0 0 0 C + M
0 1 0 C + M
1 0 1 C + M
1 1 0 C + M
POS – product-of-sums
C M E maxterm
0 0 0 C + M
0 1 0 C + M E = (C + M)(C + M)(C + M)
1 0 1 C + M = Π(0, 1, 3)
1 1 0 C + M
Boolean Equation:
P = RS
Boolean Equation:
E = M + CTX
Boolean Equation:
E = HS + H
Boolean Equation:
E = HS + HS
Boolean Algebra:
Axioms
Boolean Algebra
• Axioms and theorems to simplify Boolean
equations
• Like regular algebra, but simpler: variables
have only two values (1 or 0)
• Duality in axioms and theorems:
– ANDs and ORs, 0’s and 1’s interchanged
Boolean Algebra:
Theorems of
One Variable
Boolean Theorems of One Variable
B
1 = B
B
0 = B
B
0 = 0
B
1 = 1
B
B = B
B = B
B
B = 0
B
B = 1
Boolean Algebra:
Theorems of
Several Variables
Boolean Theorems of Several Vars
# Theorem Dual Name
T6 B•C = C•B B+C = C+B Commutativity
T7 (B•C) • D = B • (C•D) (B + C) + D = B + (C + D) Associativity
T8 B • (C + D) = (B•C) + (B•D) B + (C•D) = (B+C) (B+D) Distributivity
T9 B • (B+C) = B B + (B•C) = B Covering
T10 (B•C) + (B•C) = B (B+C) • (B+C) = B Combining
T11 (B•C) + (B•D) + (C•D) = (B+C) • (B+D) • (C+D) = Consensus
(B•C) + (B•D) (B+C) • (B+D)
B C (B+C) B(B+C)
0 0 0 0
0 1 1 0
1 0 1 1
1 1 1 1
Dual:
The complement of the sum is the
product of the complements.
Boolean Algebra:
Simplifying Equations
Simplifying an Equation
Simplifying may mean minimal sum of products form:
• SOP form that has the fewest number of implicants, where
each implicant has the fewest literals
– Implicant: product of literals
ABC, AC, BC
– Literal: variable or its complement
A, A, B, B, C, C
Simplifying could also mean fewest number of gates, lowest cost,
lowest power, etc. For example, Y = A xor B is likely simpler than
minimal Sum of Products Y = AB + AB. These depend on details of
the technology.
or
Y = B(A + A) T8: Distributivity
= B(1) T5’: Complements
=B T1: Identity
Extra Examples
Boolean Algebra:
Simplifying Equations
Simplification methods
• Distributivity (T8, T8’) B (C+D) = BC + BD
B + CD = (B+ C)(B+D)
• Covering (T9’) A + AP = A
• Combining (T10) PA + PA = P
• Expansion P = PA + PA
A = A + AP
• Idempotency (duplication) A = A + A
• “Simplification” theorem A + AP = A + P
A + AP = A + P
• Covering (T9’) A + AP = A
• Combining (T10) PA + PA = P
• Expansion P = PA + PA
A = A + AP
• Idempotency (duplication) A = A + A
• “Simplification” theorem A + AP = A + P
A + AP = A + P
• Covering (T9’) A + AP = A
• Combining (T10) PA + PA = P
• Expansion P = PA + PA
A = A + AP
• Idempotency (duplication) A = A + A
• “Simplification” theorem A + AP = A + P
A + AP = A + P
• Covering (T9’) A + AP = A
• Combining (T10) PA + PA = P
• Expansion P = PA + PA
A = A + AP
• Idempotency (duplication) A = A + A
• “Simplification” theorem A + AP = A + P
A + AP = A + P
Note:
• A‘ is shorthand for A.
• But use the tick symbol (‘) only when typing.
• It’s easy to lose ticks (‘) when writing by hand!
• It is strongly recommended that you simplify
equations by writing by hand.
Common Errors
Boolean Algebra:
Simplifying Equations
Common Errors
• Using ticks ‘ instead of bars over variables when writing
equations by hand – ticks are easy to lose
• Not keeping terms aligned from step to step
• Alignment helps you see what changed from step-to-step.
• It helps in both solving and double-checking the problem.
• Applying multiple theorems to the same term in one step
• Applying your own personal theorems – don’t do it ☺
• And, on a related note: almost applying the correct theorem
• Not looking for opportunities to use combining, covering,
and distributivity (especially the dual form).
A
B
Y
C
D
E
A B C
minterm: ABC
minterm: ABC
minterm: ABC
A
B
C Y
D
Two-Level
Logic Forms
Two-Level Logic Variations
• ANDs followed by ORs: SOP form
• ORs followed by ANDs: POS form
• Only NAND gates: SOP form
• Only NOR gates: POS form
A B C
(A+B)
(A+B+C)
A B C
minterm: ABC
minterm: ABC
minterm: ABC
Y
Both: SOP form
Put bubbles on internal nodes.
86 Digital Design & Computer Architecture Combinational Logic Design
Two-Level Logic Variation
• Two-level logic: ORs followed by ANDs → NORs
• Example: Y = (A+B)(A+B+C)
A B C
A B C
(A+B)
(A+B+C)
Y
Y Both: POS form
Put bubbles on internal nodes.
87 Digital Design & Computer Architecture Combinational Logic Design
Chapter 2: Combinational Logic
Bubble Pushing
De Morgan’s Theorem
• Y=A+B=A B A
Y
B NOR gate
A two forms
Y
B
• Forward:
– Body changes
– Adds bubble to output
A A
Y Y
B B
Y = AB + CD
A
B
C Y
D
C Y
D
bubble on
A input and output
B
C Y
D
no bubble on
input and output
A
B
C Y
D
Y = ABC + D
A=1
Y=X
B=0
to bus
sharedbus
from bus
Ethernet en3
to bus
from bus
memory en4
to bus
from bus
Karnaugh Maps
Karnaugh Maps (K-Maps)
• Boolean expressions can be minimized by
combining terms
• K-maps minimize equations graphically
– PA + PA = P
A B C Y Y Y
AB AB
0 0 0 1
00 01 11 10 C 00 01 11 10
0 0 1 1 C
0 1 0 0
0 1 1 0 0 1 0 0 0 0 ABC ABC ABC ABC
1 0 0 0
1 0 1 0
1 1 0 0 1 1 0 0 0 1 ABC ABC ABC ABC
1 1 1 0
Y = AB Y = ABC+ABC = AB
Y = AB + BC
105 Digital Design & Computer Architecture Combinational Logic Design
Some Definitions
• Complement: variable with a bar over it
A, B, C
• Literal: variable or its complement
A, A, B, B, C, C
• Implicant: product of literals
ABC, AC, BC
• Prime implicant: implicant corresponding to the
largest circle in a K-map
Combinational Building
Blocks: Multiplexers
Multiplexer (Mux)
• Selects between one of N inputs to connect
to output
• Select input is log2N bits – control input
• Example: 2:1 Mux
S
D0 0
Y
D1 1
S D1 D0 Y S Y
0 0 0 0 0 D0
0 0 1 1 1 D1
0 1 0 0
0 1 1 1
1 0 0 0
1 0 1 0
1 1 0 1
1 1 1 1
1 0 1 1 0
S
Y = D0S + D1S
D0
D0
S D1
D1
Hierarchical
Y = AB
Combinational Building
Blocks: Decoders
Decoders
• N inputs, 2N outputs
• One-hot outputs: only one output HIGH at
once 2:4
Decoder
11 Y3
A1 10 Y2
A0 01 Y1
00 Y0
A1 A0 Y3 Y2 Y1 Y0
0 0 0 0 0 1
0 1 0 0 1 0
1 0 0 1 0 0
1 1 1 0 0 0
Y3
Y2
Y1
Y0
Y = AB + AB
= A B Y
Timing
Timing
• Delay: time between input change and output
changing
• How to build fast circuits?
A Y
delay
Time
tpd
tcd
Time
125 Digital Design & Computer Architecture Combinational Logic Design
Propagation & Contamination Delay
• Delay is caused by
– Capacitance and resistance in a circuit
– Speed of light limitation
• Reasons why tpd and tcd may be different:
– Different rising and falling delays
– Multiple inputs and outputs, some of which are
faster than others
– Circuits slow down when hot and speed up when
cold
A n1
B
n2
C
D Y
Short Path
Y
AB
00 01 11 10
C
0 1 0 0 0
1 1 1 1 0
Y = AB + BC
Short Path
n2
n1
Y glitch
Time
1 1 1 1 0
AC Y = AB + BC + AC
A=0
B=1 0
Y=1
C=1