Combinational Logic Implementation: Two-Level Logic Multi-Level Logic Time Behavior Regular Logic
Combinational Logic Implementation: Two-Level Logic Multi-Level Logic Time Behavior Regular Logic
Combinational Logic Implementation: Two-Level Logic Multi-Level Logic Time Behavior Regular Logic
Two-level logic
Implementations of two-level logic
NAND/NOR
Multi-level logic
Factored forms
And-or-invert gates
Time behavior
Gate delays
Hazards
Regular logic
Multiplexers
Decoders
PAL/PLAs
ROMs
CS 150 - Fall 2000 - Combinational Implementation - 1
Implementations of Two-level Logic
Sum-of-products
AND gates to form product terms
(minterms)
OR gate to form sum
Product-of-sums
OR gates to form sum terms
(maxterms)
AND gates to form product
OR OR AND AND
A A
NAND
B B
Z NAND Z
C C
NAND
D D
B
Z
C
D
\A
A NOR NOR
\B
B
Z NOR Z
C
\C
D NOR NOR
\D
Step 1 Step 2
conserve conserve
"bubbles" "bubbles"
CS 150 - Fall 2000 - Combinational Implementation - 10
Conversion Between Forms (contd)
D \C
NOR
\D
C
D
introduction and F
B
conservation of
A
bubbles
B
\C
C
redrawn in terms D
F
of conventional \B
NAND gates A
B
\C
introduction and D
F
conservation of B
bubbles A
B
\C
\C
\D
redrawn in terms F
B
of conventional
\A
NOR gates
\B
C
CS 150 - Fall 2000 - Combinational Implementation - 14
Conversion Between Forms
Example
A A
(a) (b)
B F B F
C X C X
D D
original circuit add double bubbles at inputs
A
A X
(c) B F
C (d)
\X B F
\D C \X
\D
distribute bubbles
insert inverters to fix mismatches
some mismatches
A A
B B
Z Z
C C
D D
& &
2x2 AOI gate + 3x2 AOI gate +
symbol symbol
& &
A
A'
&
0 1 B' + F
A
B 1 0 &
B
Example:
A
F = B C' + A C' + A B
0 1 1 1
F' = A' B' + A' C + B' C
C 0 0 1 0
Implemented by 2-input 3-stack AOI gate
B
F = (A + B) (A + C') (B + C')
F' = (B' + C) (A' + C) (A' + B')
Implemented by 2-input 3-stack OAI gate
Example: 4-bit equality function
Z = (A0B0+A0'B0')(A1B1+A1'B1')(A2B2+A2'B2')(A3B3+A3'B3')
A1 &
B1 conservation of bubbles
+
&
NOR Z
A2 &
B2 if all inputs are low
+
& then Ai = Bi, i=0,...,3
output Z is high
A3 &
B3 +
&
Advantages
Circuits may be smaller
Gates have smaller fan-in
Circuits may be faster
Disadvantages
More difficult to design
Tools for optimization are not as good as for two-level
Analysis is more complex
Waveforms
Visualization of values carried on signal wires over time
Useful in explaining sequences of events (changes in value)
Simulation tools are used to create these waveforms
Input to the simulator includes gates and their connections
Input stimulus, that is, input signal waveforms
Some terms
Gate delaytime for change at input to cause change at output
Min delaytypical/nominal delaymax delay
Careful designers design for the worst case
Rise timetime for output to transition from low to high voltage
Fall timetime for output to transition from high to low voltage
Pulse widthtime an output stays high or low between changes
CS 150 - Fall 2000 - Combinational Implementation - 21
Momentary Changes in Outputs
A' A = 0
delays matter
in function
resistor
A B
open C
switch D
close switch
initially
open switch
undefined
Usual solutions
1) Wait until signals are stable (by using a clock): preferable
(easiest to design when there is a clock synchronous design)
2) Design hazard-free circuits: sometimes necessary (clock not
used asynchronous design)
Static 1-hazard
1 1
Input change causes output to go from 1 to 0 to 1 0
Static 0-hazard 1
INput change causes output to go from 0 to 1 to 0 0 0
Dynamic hazards 1 1
Input change causes a double change 0 0
from 0 to 1 to 0 to 1 OR from 1 to 0 to 1 to 0
1 1
0 0
CS 150 - Fall 2000 - Combinational Implementation - 25
Static Hazards
S'
B
F
S' hazard
static-0 hazard static-1 hazard
CS 150 - Fall 2000 - Combinational Implementation - 26
Dynamic Hazards
hazard
dynamic hazards
CS 150 - Fall 2000 - Combinational Implementation - 27
Making Connections
A Y
B Z
A Y
B Z
A B
Sum
S0 S1
A A B A B C
CS 150 - Fall 2000 - Combinational Implementation - 32
Gate Level Implementation of Muxes
2:1 mux
4:1 mux
8:1
I0
I1 4:1 mux alternative
I2 mux implementation
I3 2:1
Z I0 2:1 8:1
mux I1
I4 mux mux
I5 4:1
I6 mux I2 2:1
I7 I3 mux
4:1
Z
I4 mux
B C A 2:1
I5 mux
control signals B and C simultaneously choose
one of I0, I1, I2, I3 and one of I4, I5, I6, I7 I6 2:1
I7 mux
control signal A chooses which of the
upper or lower mux's output to gate to Z
C A B
CS 150 - Fall 2000 - Combinational Implementation - 34
Multiplexers as General-purpose Logic
A B C
CS 150 - Fall 2000 - Combinational Implementation - 35
Multiplexers as General-purpose Logic
(contd)
Generalization
I0 I1 . . . In-1 In F
. . . . 0 0 0 1 1 four possible
n-1 mux control configurations
variables . . . . 1 0 1 0 1
of truth table rows
single mux data can be expressed
variable as a function of In
0 In In' 1
1:2 Decoders
active-high active-low
enable enable
G O0 \G O0
S S
O1 O1
2:4 Decoders
G \G
O0 O0
active-high active-low
enable O1 enable O1
O2 O2
O3 O3
S1 S0 S1 S0
CS 150 - Fall 2000 - Combinational Implementation - 39
Demultiplexers as General-purpose Logic
0 A'B'C'
1 A'B'C
2 A'BC' demultiplexer generates appropriate
3 A'BC minterm based on control signals
1 3:8 DEC 4 (it "decodes" control signals)
AB'C'
5 AB'C
6 ABC'
7 ABC
S2 S1 S0
A B C
A B C D
CS 150 - Fall 2000 - Combinational Implementation - 41
Cascading Decoders
5:32 decoder
0 A'B'C'D'E' 0
1x2:4 decoder 1 1
2 2 A'BC'DE'
4x3:8 decoders 3:8 DEC3 3:8 DEC 3
4 4
5 5
6 6
7 7
S2 S1 S0 S2 S1 S0
0
F 2:4 DEC 1
2
S1 S0 3
0 0 AB'C'D'E'
A B 1 1
2 2
3:8 DEC3 3:8 DEC 3
4 4
5 5
6 6
7 ABCDE 7 AB'CDE
S2 S1 S0 S2 S1 S0
C D E C D E
OR
AND
product array
array
terms
outputs
input side:
personality matrix
1 = uncomplemented in term
0 = complemented in term
product inputs outputs = does not participate
term A B C F0 F1 F2 F3
AB 1 1 0 1 1 0 output side:
B'C 0 1 0 0 0 1 1 = term connected to output
AC' 1 0 0 1 0 0 0 = no connection to output
B'C' 0 0 1 0 1 0
reuse of terms
A 1 1 0 0 1
AB
B'C
AC'
B'C'
F0 F1 F2 F3
CS 150 - Fall 2000 - Combinational Implementation - 46
Alternate Representation for High Fan-in
Structures
AB
A'B'
CD'
C'D
AB+A'B'
CD'+C'D
CS 150 - Fall 2000 - Combinational Implementation - 47
Programmable Logic Array Example
0 1 0 1 1 1 1 0 0 1 X X 0 0 X X
0 1 1 0 1 0 1 0 B B
0 1 1 1 1 0 1 1
1 0 0 0 1 0 0 1 K-map for W K-map for X
1 0 0 1 1 0 0 0
1 0 1 A A
1 1 0 1 X 0 0 0 X 1
minimized functions: 0 1 X 0 1 0 X 0
D D
C 1 1 X X C 0 1 X X
W=A+BD+BC
1 1 X X 1 0 X X
X = B C'
Y=B+C B B
Z = A'B'C'D + B C D + A D' + B' C D'
K-map for Y K-map for Z
CS 150 - Fall 2000 - Combinational Implementation - 50
PALs and PLAs: Design Example (contd)
BC
BC' not a particularly good
B candidate for PAL/PLA
implementation since no terms
C are shared among outputs
A'B'C'D
BCD
Code converter: A
programmed PAL BD
BC
0
BC'
0
0
4 product terms
per each OR gate 0
B
C
0
0
A'B'C'D
BCD
AD'
B'CD'
W X Y Z
CS 150 - Fall 2000 - Combinational Implementation - 52
PALs and PLAs: Design Example (contd)
A
A B
C
B W D
D B
B C
C D Z
A
B \D
X \B
C C
\D
Y
B
A B C D
Magnitude comparator
A A A'B'C'D'
1 0 0 0 0 1 1 1 A'BC'D
0 1 0 0 1 0 1 1 ABCD
D D
C 0 0 1 0 C 1 1 0 1 AB'CD'
0 0 0 1 1 1 1 0
AC'
B B
A'C
K-map for EQ K-map for NE
B'D
BD'
A A
0 0 0 0 0 1 1 1 A'B'D
1 0 0 0 0 0 1 1 B'CD
D D
C 1 1 0 1 C 0 0 0 0 ABC
1 1 0 0 0 0 1 0 BC'D'
B B
0
internal organization
0 n-1
Address
bit lines (normally pulled to 1 through
resistor selectively connected to 0
by word line controlled switches)
A B C F0 F1 F2 F3
0 0 0 0 0 1 0 ROM
0 0 1 1 1 1 0 8 words x 4 bits/word
0 1 0 0 1 0 0
0 1 1 0 0 0 1
1 0 0 1 0 1 1
1 0 1 1 0 0 0
1 1 0 0 0 0 1 A B C F0F1F2F3
1 1 1 0 1 0 0 address outputs
truth table block diagram
CS 150 - Fall 2000 - Combinational Implementation - 56
ROM Structure
memory
decoder 2n word
array
lines
(2n words
by m bits)
outputs
m data lines
CS 150 - Fall 2000 - Combinational Implementation - 57
ROM vs. PLA
Multi-level Logic
Conversion to NAND-NAND and NOR-NOR networks
Transition from simple gates to more complex gate building
blocks
Reduced gate count, fan-ins, potentially faster
More levels, harder to design
Time Response in Combinational Networks
Gate delays and timing waveforms
Hazards/glitches (what they are and why they happen)
Regular Logic
Multiplexers/decoders
ROMs
PLAs/PALs
Advantages/disadvantages of each
CS 150 - Fall 2000 - Combinational Implementation - 61