LC251 Ch2 CombLog
LC251 Ch2 CombLog
Computer Architecture
Sarah Harris & David Harris
Chapter 2:
Combinational Logic
Design
Modified by Younghwan Yoo, 2023
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 itself 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
Number Theorem Name
T1 B•1=B Identity
T2 B•0=0 Null Element
T3 B•B=B Idempotency
T4 B=B Involution
T5 B•B=0 Complements
B
1 = B
B
0 = B
B
0 = 0
null
element
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.
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
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
∙ CD
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
X indicates that the circuit node
Y=X has an unknown or illegal value
B=0
node is floating A Y
busses to bus
from bus
to bus
and an Ethernet controller all communicate
sharedbus
from 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 that cannot be combined
with any other implicants in the equation to form a
new implicant with fewer literals
Combinational Building
Blocks: Multiplexers
Multiplexer (mux)
• Selects one of N inputs and connects it to
output
• Select input takes 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 output: 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
2:4
Decoder Minterm
11 AB
A 10 AB
B 01 AB
00 AB
Y = AB + AB
= A B Y
122 Digital Design & Computer Architecture Combinational Logic Design
Chapter 2: Combinational Logic
Timing
Timing
• Delay: time between input change and
subsequent output change
• 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 charging 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
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
.. covers the prime
implicant boundary
A=0
B=1 0
Y=1
C=1