Chapter 2 - Combinational Logic Design
Chapter 2 - Combinational Logic Design
January 5, 2025
2.1
Introduction
Digital circuit
Let’s learn to design digital circuits 1
a 1
We’ll start with a simple form of circuit: b
0
Combinational
digital circuit
F
• Combinational circuit
A digital circuit whose outputs depend solely on 1
a ?
the present combination of the circuit inputs’ 0
Sequential
F
values b digital circuit
Note: Slides with animation are denoted with a small red "a" near the animated items
2
1
2025-01-05
2.2
Switches
Electronic switches are the basis
of binary digital circuits
• Electrical terminology
Voltage: Difference in electric 4.5 A
– +
9V
potential between two points 4.5 A
• Analogous to water pressure
2 ohms
Current: Flow of charged particles
• Analogous to water flow 0V 9V
Resistance: Tendency of wire to
resist current flow 4.5 A
• Analogous to water pipe diameter
V = I * R (Ohm’s Law)
Switches
A switch has three parts control
input
• Source input, and output
Current wants to flow from source “off”
input to output
• Control input source output
input a
Voltage that controls whether that control
current can flow input
“on”
The amazing shrinking switch
source output
• 1930s: Relays input
• 1940s: Vacuum tubes (b)
• 1950s: Discrete transistor
• 1960s: Integrated circuits (ICs)
Initially just a few transistors on IC
Then tens, hundreds, thousands...
discrete
transistor
IC
relay vacuum tube
quarter
(to see the relative size)
4
2
2025-01-05
Moore’s Law
IC capacity doubling about every 18 months for
several decades
• Known as “Moore’s Law” after Gordon Moore, co-
founder of Intel
Predicted in 1965 predicted that components per
IC would double roughly every year or so
• Book cover depicts related phenomena
For a particular number of transistors, the IC
shrinks by half every 18 months
• Notice how much shrinking occurs in just about 10
years
• Enables incredibly powerful computation in
incredibly tiny devices
• Today’s ICs hold billions of transistors
The first Pentium processor (early 1990s) needed
only 3 million
2.3
nMOS
A positive ...attracts electrons here, 1 0
voltage here... turning the channel gate
between source and drain
into a conductor.
pMOS
1 0
gate
(a) IC
6
3
2025-01-05
“Logic gates” are better digital circuit building blocks than switches (transistors)
• Why?...
8
4
2025-01-05
10
5
2025-01-05
11
12
6
2025-01-05
Showed application 1 0 0
x y
Digital design x
0
1 1
Implement Boolean operators using transistors
Note: These OR/AND
• Call those implementations logic gates. implementations are inefficient;
• Let’s us build circuits by doing math -- powerful we’ll show why, and show better
concept ones later.
13
1 1
1 x x
x 0 0
0 1 1
y y
1 0 0
F 1 1
0 F F
0 0
time
time time
14
7
2025-01-05
15
(a)
a
a
b F
c
(b)
16
8
2025-01-05
17
no yes
ok
not ok
18
9
2025-01-05
2.5
Boolean Algebra
By defining logic gates based on Boolean algebra, we can use algebraic methods
to manipulate circuits
• So let’s learn some Boolean algebraic methods
Start with notation: Writing a AND b, a OR b, and NOT(a) is cumbersome
• Use symbols: a * b, a + b, and a’ (in fact, a * b can be just ab).
Original: w = (p AND NOT(s) AND k) OR t
New: w = ps’k + t
• Spoken as “w equals p and s prime and k, or t”
• Or even just “w equals p s prime k, or t”
• s’ known as “complement of s”
While symbols come from regular algebra, don’t say “times” or “plus”
Boolean algebra precedence, highest precedence first.
Symbol Name Description
() Parentheses Evaluate expressions nested in parentheses first
’ NOT Evaluate from left to right
* AND Evaluate from left to right
+ OR Evaluate from left to right
19
20
10
2025-01-05
21
22
11
2025-01-05
23
24
12
2025-01-05
2.6
The function F
25
possible combination of 0 1 0 0 1 0 0 0 1
input values 1
1
0
1
0
0
1
1
0
1
0
0
0
0
1
1
0
1
• 2-input function: 4 rows (a) 1 0 0 0 1 0 0
1 0 1 0 1 0 1
• 3-input function: 8 rows 1 1 0 0 1 1 0
• 4-input function: 16 1 1 1 0
1
1
0
1
0
1
0
rows (b)
1 0 0 1
1 0 1 0
Q: Use truth table to a
0
b
0
c
0
F
0 1 0 1 1
define function F(a,b,c) 0 0 1 0 1
1
1
1
0
0
0
1
that is 1 when abc is 5 or a 0
0
1
1
0
1
0
0 1 1 1 0
greater in binary 1 0 0 0 1 1 1 1
1 0 1 1 (c)
1 1 0 1
1 1 1 1
26
13
2025-01-05
27
0 1 1 0 1 1
1 0 0 1 0 0
1 1 1 1 1 1
28
14
2025-01-05
29
Multiple-Output Circuits
Many circuits have more than one output
Can give each a separate circuit, or can share gates
Ex: F = ab a+ c’, G = ab + bc a
b
b
F
F
c
c
G
G
(b)
(a)
30
15
2025-01-05
Multiple-Output Example:
BCD to 7-Segment Converter
a
f
b
g
e
c
d
31
2.7
32
16
2025-01-05
33
based circuit a
b
c
b a
b
c
34
17
2025-01-05
2.8
More Gates 1 1
NAND NOR XOR XNOR NAND NOR
x x x
F F x y
y y
F y
x y F x y F x y F x y F x F
0 0 1 0 0 1 0 0 0 0 0 1
0 1 1 0 1 0 0 1 1 0 1 0 x y
y
1 0 1 1 0 0 1 0 1 1 0 0
1 1 0 1 1 0 1 1 0 1 1 1 0 0
NAND: Opposite of AND (“NOT AND”) • NAND same as AND with power &
NOR: Opposite of OR (“NOT OR”) ground switched
XOR: Exactly 1 input is 1, for 2-input XOR. • Why? nMOS conducts 0s well, but not
(For more inputs -- odd number of 1s) 1s (reasons beyond our scope) -- so
NAND more efficient
XNOR: Opposite of XOR (“NOT XOR”)
• Likewise, NOR same as OR with
power/ground switched
• AND in CMOS: NAND with NOT
• OR in CMOS: NOR with NOT
• So NAND/NOR more common
35
example a
b
c
S
• S = (abc)’
Detecting all 0s 00 1 a0
0
• Use NOR b0
Detecting equality a1
b1
A=B
• Use XNOR a2
Detecting odd # of 1s b2
• Use XOR
• Useful for generating
“parity” bit common for
detecting errors
36
18
2025-01-05
Completeness of NAND
Any Boolean function can be implemented using just NAND
gates. Why?
• Need AND, OR, and NOT
• NOT: 1-input NAND (or 2-input NAND with inputs tied together)
• AND: NAND followed by NOT
• OR: NAND preceded by NOTs
Likewise for NOR
37
24 = 16
possible functions
1
a NOR b
0
a AND b
a OR b
a XOR b
b’
a’
0 a b 'b 'a 1
OR
X b
a AND b a a ORa bNOR b
a XNOR b a NAND b
38
19
2025-01-05
2.9
39
Decoder Example
New Year’s Eve 210 21 0 0
Happy
New Year
0 1 0 0 0 1
Countdown Display 1 0 0
i0
i1
d0
d1 0 1 0 1
0 0 0 i2 d2 1 0 0
• Microprocessor
2
0 0 0 i3 d3 0 0 0 3
cessor
a
down to 0 in binary M e
d58
d59
0 0 0
0 0 0
on 6-bit output d60
d61 58
40
20
2025-01-05
Multiplexor (Mux)
Mux: Another popular combinational building block
• Routes one of its N data inputs to its one output, based
on binary value of select inputs
4 input mux needs 2 select inputs to indicate which input to
route through
8 input mux 3 select inputs
N inputs log2(N) selects
• Like a railyard switch
41
i0
4 1
i0 i1
i1 d
d
i2 i2
i3
s1 s0 i3
4x1 mux
s1 s0
42
21
2025-01-05
Mux Example
City mayor can set four switches up or down,
representing his/her vote on each of four proposals,
numbered 0, 1, 2, 3
City manager can display any such vote on large
green/red LED (light) by setting two switches to
represent binary 0, 1,switches
Mayor’s 2, or 3
Use 4x1 mux 1
4x1 on/off
i0
2 i1
d
i2
i3 Green/
rP 3 Red
s1 s0
LED
4
manager's
switches
43
44
22
2025-01-05
45
2.10
Additional Considerations
Schematic Capture and Simulation
Inputs Inputs
i0 i0
i1 i1
Simulate Simulate
Outputs Outputs
d3 d3
d2 d2
d1 d1
d0 d0
Schematic capture
• Computer tool for user to capture logic circuit graphically
Simulator
• Computer tool to show what circuit outputs would be for given inputs
Outputs commonly displayed as waveform
46
23
2025-01-05
Additional Considerations
Non-Ideal Gate Behavior -- Delay
47
Chapter Summary
Combinational circuits
• Circuit whose outputs are function of present inputs
No “state”
Switches: Basic component in digital circuits
Boolean logic gates: AND, OR, NOT -- Better building block than switches
• Enables use of Boolean algebra to design circuits
Boolean algebra: uses true/false variables/operators
Representations of Boolean functions: Can translate among
Combinational design process: Translate from equation (or table) to circuit through well-defined
steps
More gates: NAND, NOR, XOR, XNOR also useful
Muxes and decoders: Additional useful combinational building blocks
48
24
2025-01-05
Q&A
January 5, 2025
25