Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Two-level logic
Implementations of two-level logic NAND/NOR Factored forms And-or-invert gates Gate delays Hazards
Product-of-sums
OR gates to form sum terms (maxterms) AND gates to form product
In other words
OR is the same as NAND with complemented inputs AND is the same as NOR with complemented inputs NAND is the same as OR with complemented inputs NOR is the same as AND with complemented inputs
OR OR
AND
AND
NAND
NAND
NOR
NOR
A B C D
NOR
NOR
NOR Z
NOR
\C \D
NOR
Step 1
conserve "bubbles"
Step 2
CS 150 - Fall 2000 - Combinational Implementation - 10
conserve "bubbles"
C
D
={
= =
}'
Multi-level Logic
x=ADF + AEF + BDF + BEF + CDF + CEF + G
Reduced sum-of-products form already simplified 6 x 3-input AND gates + 1 x 7-input OR gate (may not exist!) 25 wires (19 literals plus 6 internal wires)
x = (A + B + C) (D + E) F + G
Factored form not written as two-level S-o-P 1 x 3-input OR gate, 2 x 2-input OR gates, 1 x 3-input AND gate 10 wires (7 literals plus 3 internal wires)
A B C D E F G
CS 150 - Fall 2000 - Combinational Implementation - 12
B C D
\X
AND-OR-Invert Gates
AOI function: three stages of logicAND, OR, Invert
Multiple gates "packaged" as a single circuit block
logical concept A B C D AND OR Invert A B C D NAND NAND Invert possible implementation
&
+
&
&
+
&
0
B 1
1
0
A
1 0
&
A1 B1 & &
+ NOR Z
conservation of bubbles
A2 B2
& &
A3 B3
& &
Disadvantages
More difficult to design Tools for optimization are not as good as for two-level Analysis is more complex
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
D remains high for three gate delays after A changes from low to high
Oscillatory Behavior
Another pulse shaping circuit
+ A open switch close switch initially undefined open switch C B
resistor
Hazards/Glitches
Hazards/glitches: unwanted switching at the outputs
Occur when different paths through circuit have different propagation delays
As in pulse shaping circuits we just analyzed
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)
Types of Hazards
Static 1-hazard
Input change causes output to go from 1 to 0 to 1
1 1
Static 0-hazard
INput change causes output to go from 0 to 1 to 0
Dynamic hazards
Input change causes a double change from 0 to 1 to 0 to 1 OR from 1 to 0 to 1 to 0
1
CS 150 - Fall 2000 - Combinational Implementation - 25
Static Hazards
Due to a literal and its complement momentarily taking on the same value
Thru different paths with different delays and reconverging
May cause an output that should have stayed at the same value to momentarily take on A the wrong value Example: multiplexer
A S
B F S S' B S' static-0 hazard static-1 hazard
CS 150 - Fall 2000 - Combinational Implementation - 26
F hazard
Dynamic Hazards
Due to the same versions of a literal taking on opposite values
Thru different paths with different delays and reconverging
May cause an output that was to change value to change 3 times instead of once Example:
A 3 B 1 C F A C B1
B2
B3 F dynamic hazards hazard
Making Connections
Direct point-to-point connections between gates
Wires we've seen so far
multiplexer
demultiplexer
control
control
multiplexer
demultiplexer
CS 150 - Fall 2000 - Combinational Implementation - 28
4x4 switch
B
CS 150 - Fall 2000 - Combinational Implementation - 29
MUX
A Sum
Ss
DEMUX S0 S1
Multiplexers/Selectors
Multiplexers/Selectors: general concept
2n data inputs, n control inputs (called "selects"), 1 output Used to connect 2n points to a single point Control signal pattern forms binary index of input connected to output
Z = A' I0 + A I1 A 0 1 Z I0 I1 I1 0 0 0 0 1 1 1 1 I0 0 0 1 1 0 0 1 1 A 0 1 0 1 0 1 0 1 Z 0 0 1 0 0 1 1 1
functional form
logical form two alternative forms for a 2:1 Mux truth table
CS 150 - Fall 2000 - Combinational Implementation - 31
Multiplexers/Selectors (cont'd)
2:1 mux: 4:1 mux: Z = A' I0 + A I1 Z = A' B' I0 + A' B I1 + A B' I2 + A B I3
8:1 mux:
In general, Z = k=0
(mkIk)
I0 I1
2:1 mux
A
I0 I1 I2 I3
4:1 mux A B
I0 I1 I2 I3 I4 I5 I6 I7
8:1 mux
A B C
4:1 mux
Cascading Multiplexers
Large multiplexers implemented by cascading smaller ones
I0 I1 I2 I3 I4 I5 I6 I7 4:1 mux 8:1 mux alternative implementation Z I0 I1 2:1 mux 2:1 mux 2:1 mux 2:1 mux C A B 8:1 mux
2:1 mux
4:1 mux
I2 I3
A I4 I5 I6 I7
B C
4:1 mux
control signals B and C simultaneously choose one of I0, I1, I2, I3 and one of I4, I5, I6, I7
control signal A chooses which of the upper or lower mux's output to gate to Z
Example:
F(A,B,C) = m0 + m2 + m6 + m7 = A'B'C' + A'BC' + ABC' + ABC = A'B'(C') + A'B(C') + AB'(0) + AB(1)
1 0 1 0 0 0 1 1 0 1 2 3 4 8:1 MUX 5 6 7 S2 S1 S0 A B
Example:
F(A,B,C) = m0 + m2 + m6 + m7 = A'B'C' + A'BC' + ABC' + ABC = A'B'(C') + A'B(C') + AB'(0) + AB(1)
1 0 1 0 0 0 1 1 0 1 2 3 4 8:1 MUX 5 6 7 S2 S1 S0 A B A 0 0 0 0 1 1 1 1 B 0 0 1 1 0 0 1 1 C 0 1 0 1 0 1 0 1 F 1 0 1 0 0 0 1 1 C' C' 0 1 C' C' 0 1 0 1 4:1 MUX 2 3 S1 S0 A B
.
.
.
.
.
.
.
.
0
1
0
0 0
0
1 In
1
0 In'
1
1 1
1 D 0 1 D D D D
0 1 2 3 4 8:1 MUX 5 6 7 S2 S1 S0 A B
Demultiplexers/Decoders
Decoders/demultiplexers: general concept
Single data input, n control inputs, 2n outputs Control inputs (called selects (S)) represent binary index of output to which the input is connected Data input usually called enable (G)
1:2 Decoder: O0 = G S O1 = G S 2:4 Decoder: O0 = G S1 O1 = G S1 O2 = G S1 O3 = G S1 S0 S0 S0 S0 3:8 Decoder: = G S2 S1 S0 = G S2 S1 S0 = G S2 S1 S0 = G S2 S1 S0 = G S2 S1 S0 = G S2 S1 S0 = G S2 S1 S0 = G S2 S1 S0
O0 O1 O2 O3 O4 O5 O6 O7
active-high enable G S
O0 O1 O0 O1 O2 O3
active-low enable \G S
O0 O1
2:4 Decoders
G active-high enable
\G
active-low enable
O0 O1 O2 O3
S1 S0
S1 S0
demultiplexer generates appropriate minterm based on control signals (it "decodes" control signals)
Enable
4:16 DEC
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
A'B'C'D' A'B'C'D A'B'CD' A'B'CD A'BC'D' A'BC'D A'BCD' A'BCD AB'C'D' AB'C'D AB'CD' AB'CD ABC'D' ABC'D ABCD' ABCD
F1
F2
F3
A B C D
CS 150 - Fall 2000 - Combinational Implementation - 41
Cascading Decoders
5:32 decoder
1x2:4 decoder 4x3:8 decoders
0 2:4 DEC 1 2 S1 S0 3 A B
0 1 2 3:8 DEC3 4 5 6 7 S2 S1 S0
A'B'C'D'E'
0 1 2 3:8 DEC 3 4 5 6 7 S2 S1 S0
A'BC'DE'
0 1 2 3:8 DEC3 4 5 6 7 S2 S1 S0 C D E
ABCDE
0 1 2 3:8 DEC 3 4 5 6 7 S2 S1 S0 C D E
AB'C'D'E'
AB'CDE
AND array
product terms
OR array
outputs
CS 150 - Fall 2000 - Combinational Implementation - 43
Enabling Concept
Shared product terms among outputs
example:
F0 F1 F2 F3
= = = =
B' C' + AB + AB + A
input side: 1 = uncomplemented in term 0 = complemented in term = does not participate
personality matrix
product term AB B'C AC' B'C' A inputs A B 1 1 0 1 0 1 outputs F0 F1 0 1 0 0 0 1 1 0 1 0
C 1 0 0
F2 1 0 0 1 0
F3 0 1 0 0 1
Before Programming
All possible connections available before "programming"
In reality, all AND and OR gates are NANDs
After Programming
Unwanted connections are "blown"
Fuse (normally connected, break unwanted ones) aAnti-fuse (normally disconnected, make wanted connections)
A
AB B'C
AC'
B'C' A
F0
F1
F2
F3
AB+A'B' CD'+C'D
CS 150 - Fall 2000 - Combinational Implementation - 47
F1 F2 F3 F4 F5 F6
1
B
0
B
K-map for W
A 0 0 C 1 1 1 1 1 1 B X X X X 0 0 X X D
K-map for X
A 0 1 C 0 1 0 0 1 0 B X X X X 1 0 X X D
minimized functions:
W=A+BD+BC X = B C' Y=B+C Z = A'B'C'D + B C D + A D' + B' C D'
K-map for Y
K-map for Z
not a particularly good candidate for PAL/PLA implementation since no terms are shared among outputs
BCD'
W X Y Z
however, much more compact and regular implementation when compared with discrete AND and OR gates
0
B C 0 0 A'B'C'D BCD AD' B'CD'
W X
Y Z
Y
CS 150 - Fall 2000 - Combinational Implementation - 53
A B
C D A'B'C'D' A'BC'D
1
0 C 0 0
0
1 0 0 B
0
0 1 0
0
0 0 1 D
0 1 C 1 1
1 0 1 1 B
1 1 0 1
1 1 1 0 D
K-map for EQ
A 0 1 C 1 1 0 0 1 0 0 0 0 0 1 D
K-map for NE
A 0 0 C 0 0 1 0 1 1 1 1
A'B'D
D
0
0 B
0
1
0
0
1
B
K-map for LT
K-map for GT
CS 150 - Fall 2000 - Combinational Implementation - 54
EQ NE LT GT
Read-only Memories
Two dimensional array of 1s and 0s
Entry (row) is called a "word" Width of row = word-size Index is called an "address" Address is input Selected word is output
1 1 1 1
word lines (only one is active decoder is just right for this)
decoder
j 0
internal organization 0 n-1 Address bit lines (normally pulled to 1 through resistor selectively connected to 0 by word line controlled switches)
truth table
ROM Structure
Similar to a PLA structure but with a fully decoded AND array
Completely flexible OR array (unlike PAL)
n address lines inputs
decoder
2n word lines
Design time is short (no need to minimize output functions) Most input combinations are needed (e.g., code converters) Little sharing of product terms among output functions Size doubles for each additional input Can't exploit don't cares Design tools are available for multi-output minimization There are relatively few unique minterm combinations Many minterms are shared among the output functions Constrained fan-ins on OR plane
CS 150 - Fall 2000 - Combinational Implementation - 58
ROM problems
PAL problems
Intermediate cost Can implement functions limited by number of terms High speed (only one programmable plane that is much smaller than ROM's decoder) Most expensive (most complex in design, need more sophisticated tools) Can implement any function up to a product term limit Slow (two programmable planes)
CS 150 - Fall 2000 - Combinational Implementation - 59
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
Gate delays and timing waveforms Hazards/glitches (what they are and why they happen)