Combinational Logic - ece.utep.edu
Transcript of Combinational Logic - ece.utep.edu
![Page 1: Combinational Logic - ece.utep.edu](https://reader031.fdocuments.us/reader031/viewer/2022012301/61e1b94ba8663e23fa00404d/html5/thumbnails/1.jpg)
Combinational Logic
Prof. MacDonald
![Page 2: Combinational Logic - ece.utep.edu](https://reader031.fdocuments.us/reader031/viewer/2022012301/61e1b94ba8663e23fa00404d/html5/thumbnails/2.jpg)
2 Input NOR – depletion NFET load
l Pull Down Network can pull OUT down if either or both inputs are above Vih – consequently the NOR function.
l Depletion NFET could really be any load.
Vdd
A B
Out
![Page 3: Combinational Logic - ece.utep.edu](https://reader031.fdocuments.us/reader031/viewer/2022012301/61e1b94ba8663e23fa00404d/html5/thumbnails/3.jpg)
2 Input NOR – depletion NFET load
l If both A and B are low (<VIL) – load charges OUT high
Vdd
A B
Out
![Page 4: Combinational Logic - ece.utep.edu](https://reader031.fdocuments.us/reader031/viewer/2022012301/61e1b94ba8663e23fa00404d/html5/thumbnails/4.jpg)
Parallel Transistor Configurations
l Two same-type transistors in parallel have their transconductances added if on at same time.
l If both transistors are on simultaneously and the L values are the same for both, we can add the widths to get an effective single transistor equivalent.
l When both are on, (W/L)eq is sum of all ratios
8/1 8/1
16/1
![Page 5: Combinational Logic - ece.utep.edu](https://reader031.fdocuments.us/reader031/viewer/2022012301/61e1b94ba8663e23fa00404d/html5/thumbnails/5.jpg)
Series Transistor Configurations
(W/L)eq = (W/L)a + (W/L)b or if Ls equal, simply add Ws
W
L
W
L
W
L
![Page 6: Combinational Logic - ece.utep.edu](https://reader031.fdocuments.us/reader031/viewer/2022012301/61e1b94ba8663e23fa00404d/html5/thumbnails/6.jpg)
Series Transistor Configurations
l Two same-type transistors in series have their resistances added if on at same time.
l If both transistors are on simultaneously and the W values are the same for both, we can add the lengths to get an effective single transistor equivalent.
8/1
8/2 = 4/1
8/1
![Page 7: Combinational Logic - ece.utep.edu](https://reader031.fdocuments.us/reader031/viewer/2022012301/61e1b94ba8663e23fa00404d/html5/thumbnails/7.jpg)
Series Transistor Configurations
(W/L)eq = 1 / (sum of reciprocals) or if Ws are equal, simply add Ls
W
L W
L
![Page 8: Combinational Logic - ece.utep.edu](https://reader031.fdocuments.us/reader031/viewer/2022012301/61e1b94ba8663e23fa00404d/html5/thumbnails/8.jpg)
2 Input NOR – depletion NFET load
If both A and B is high– NFET heavy inverter
Vdd
A B
Out
![Page 9: Combinational Logic - ece.utep.edu](https://reader031.fdocuments.us/reader031/viewer/2022012301/61e1b94ba8663e23fa00404d/html5/thumbnails/9.jpg)
Noise Margins
Voh = Vdd Vol depends on which driver(s) is on – worst-case? Vih and Vil calculated as inverter
Vdd
A B
Out
![Page 10: Combinational Logic - ece.utep.edu](https://reader031.fdocuments.us/reader031/viewer/2022012301/61e1b94ba8663e23fa00404d/html5/thumbnails/10.jpg)
Power
Worst-case is A and B high. Idload = Ida + Idb for static power Dynamic power (charging/discharging cap) the same for all cases.
Vdd
A B
Out
![Page 11: Combinational Logic - ece.utep.edu](https://reader031.fdocuments.us/reader031/viewer/2022012301/61e1b94ba8663e23fa00404d/html5/thumbnails/11.jpg)
Generalized Depletion NOR
Can increase inputs to any value (theoretically). What is the limit?
Vdd
A B
Out
C
![Page 12: Combinational Logic - ece.utep.edu](https://reader031.fdocuments.us/reader031/viewer/2022012301/61e1b94ba8663e23fa00404d/html5/thumbnails/12.jpg)
2 Input Depletion NAND
Only when both transistors (A and B) are on will the output be driven low – out = !(A & B)
Vdd
B
A
![Page 13: Combinational Logic - ece.utep.edu](https://reader031.fdocuments.us/reader031/viewer/2022012301/61e1b94ba8663e23fa00404d/html5/thumbnails/13.jpg)
2 Input Depletion NAND
Since transistors are in series, the equivalent pull down transistor (assuming the two are the same) is (W/2L).
Vdd
B
A
![Page 14: Combinational Logic - ece.utep.edu](https://reader031.fdocuments.us/reader031/viewer/2022012301/61e1b94ba8663e23fa00404d/html5/thumbnails/14.jpg)
Depletion NANDs and body effect
Consider the case where B is held on, but the gate of A transitions from low to high. The intermediate node will be at a non-zero value at the beginning. Vbs != 0.
Vdd
B
A intermediate node
![Page 15: Combinational Logic - ece.utep.edu](https://reader031.fdocuments.us/reader031/viewer/2022012301/61e1b94ba8663e23fa00404d/html5/thumbnails/15.jpg)
Depletion NANDs and diffusion cap
Consider the case where B is held on, but the gate of A transitions from low to high. The intermediate node will be at a non-zero value at the beginning. Vbs != 0.
Vdd
B
A diffusion cap may or may not already be charged when output transitions from high to low. This varies delay.
![Page 16: Combinational Logic - ece.utep.edu](https://reader031.fdocuments.us/reader031/viewer/2022012301/61e1b94ba8663e23fa00404d/html5/thumbnails/16.jpg)
Generalized Depletion NANDs
Can have more than two inputs – but cap and body effect get worse. Vdd
C
B
A
![Page 17: Combinational Logic - ece.utep.edu](https://reader031.fdocuments.us/reader031/viewer/2022012301/61e1b94ba8663e23fa00404d/html5/thumbnails/17.jpg)
CMOS NANDS and NOR
Consider transistor sizings for balanced circuits…
out
A
A
B
B
out A
A
B
B
![Page 18: Combinational Logic - ece.utep.edu](https://reader031.fdocuments.us/reader031/viewer/2022012301/61e1b94ba8663e23fa00404d/html5/thumbnails/18.jpg)
NAND Layout
n-well
A
vdd
B
gnd
OUT
active area
metal 1
poly
Legend
![Page 19: Combinational Logic - ece.utep.edu](https://reader031.fdocuments.us/reader031/viewer/2022012301/61e1b94ba8663e23fa00404d/html5/thumbnails/19.jpg)
CMOS NOR Transistor sizing Consider transistor sizings for balanced circuits…
out
A
A
B
B out
W*4
W*4
W W W
W*2
![Page 20: Combinational Logic - ece.utep.edu](https://reader031.fdocuments.us/reader031/viewer/2022012301/61e1b94ba8663e23fa00404d/html5/thumbnails/20.jpg)
CMOS NAND Transistor Sizing
Consider transistor sizings for balanced circuits…
out
A
A
B
B
out W
2*W
2*W
2*W
2*W 2*W
![Page 21: Combinational Logic - ece.utep.edu](https://reader031.fdocuments.us/reader031/viewer/2022012301/61e1b94ba8663e23fa00404d/html5/thumbnails/21.jpg)
CMOS NAND Transistor Sizing
Consider transistor sizings for balanced circuits…
out
A
A
C
C
out W
2*W
3*W
3*W
3*W
B
B
![Page 22: Combinational Logic - ece.utep.edu](https://reader031.fdocuments.us/reader031/viewer/2022012301/61e1b94ba8663e23fa00404d/html5/thumbnails/22.jpg)
Fanin (number of inputs)
There is a limit to the number of inputs that can be used.
A
A
B
B
C D E
C
D
E
![Page 23: Combinational Logic - ece.utep.edu](https://reader031.fdocuments.us/reader031/viewer/2022012301/61e1b94ba8663e23fa00404d/html5/thumbnails/23.jpg)
Fanout (number and/or size of loads) There is a limit to the number of gates that can be driven.
![Page 24: Combinational Logic - ece.utep.edu](https://reader031.fdocuments.us/reader031/viewer/2022012301/61e1b94ba8663e23fa00404d/html5/thumbnails/24.jpg)
Fanout (number and/or size of loads) Small gates (widths) struggle to drive large gates due to
capacitance. Typically, synthesis limits the fanout to 20 or less.
![Page 25: Combinational Logic - ece.utep.edu](https://reader031.fdocuments.us/reader031/viewer/2022012301/61e1b94ba8663e23fa00404d/html5/thumbnails/25.jpg)
NAND VTC
Vout
Vin
out
A
A
B
B
One input only
Inverter
Both inputs
![Page 26: Combinational Logic - ece.utep.edu](https://reader031.fdocuments.us/reader031/viewer/2022012301/61e1b94ba8663e23fa00404d/html5/thumbnails/26.jpg)
Complex CMOS Logic
Can make single stage gates that implement: AND-OR-Inverter (AOI) OR-AND-Inverter (OAI)
Given a function F = ((A*B)+C)’ Invert the function to get N network
F’ = (A*B)+C Take dual of N network equation to get PFET network
F’d = (A’+B’)*C’ Remember that PFETs invert inputs naturally
![Page 27: Combinational Logic - ece.utep.edu](https://reader031.fdocuments.us/reader031/viewer/2022012301/61e1b94ba8663e23fa00404d/html5/thumbnails/27.jpg)
Conversion to NAND-NAND logic
f = abc’ + ab’c + acd AND – OR logic
(f’)’ = ((abc’ + ab’c + acd)’)’ Double inversion
f = ((abc’)’(ab’c)’(acd)’)’ NAND - NAND
![Page 28: Combinational Logic - ece.utep.edu](https://reader031.fdocuments.us/reader031/viewer/2022012301/61e1b94ba8663e23fa00404d/html5/thumbnails/28.jpg)
NAND-NAND Conversion
f = abc’ + ab’c + acd f = ((abc’)’(ab’c)’(acd)’)’
![Page 29: Combinational Logic - ece.utep.edu](https://reader031.fdocuments.us/reader031/viewer/2022012301/61e1b94ba8663e23fa00404d/html5/thumbnails/29.jpg)
Conversion to NOR-NOR logic
f = (a+b+c’)(a+b’+c)(a+c+d) OR-AND logic
(f’)’ = (((a+b+c’)(a+b’+c)(a+c+d))’)’ Double inversion
f = ((a+b+c’)’+(a+b’+c)’+(a+c+d)’)’ NOR-NOR
![Page 30: Combinational Logic - ece.utep.edu](https://reader031.fdocuments.us/reader031/viewer/2022012301/61e1b94ba8663e23fa00404d/html5/thumbnails/30.jpg)
NOR-NOR Conversion
(a+b+c’)(a+b’+c)(a+c+d) ((a+b+c’)’+(a+b’+c)’+(a+c+d)’)’
![Page 31: Combinational Logic - ece.utep.edu](https://reader031.fdocuments.us/reader031/viewer/2022012301/61e1b94ba8663e23fa00404d/html5/thumbnails/31.jpg)
Multi-level Conversion to NAND
1 2 3 4 5
a
a’
b
b
c
c’
d
d
e
e’
![Page 32: Combinational Logic - ece.utep.edu](https://reader031.fdocuments.us/reader031/viewer/2022012301/61e1b94ba8663e23fa00404d/html5/thumbnails/32.jpg)
Alternative Gate Symbols
( A * B) ’ A’ + B’
( A + B) ’ A’ * B’
![Page 33: Combinational Logic - ece.utep.edu](https://reader031.fdocuments.us/reader031/viewer/2022012301/61e1b94ba8663e23fa00404d/html5/thumbnails/33.jpg)
Alternative Gate Symbols
( A’ * B’) ’ A + B
( A’ + B’) ’ A * B
![Page 34: Combinational Logic - ece.utep.edu](https://reader031.fdocuments.us/reader031/viewer/2022012301/61e1b94ba8663e23fa00404d/html5/thumbnails/34.jpg)
Bubble conversion
g f
e d
c
b
a
![Page 35: Combinational Logic - ece.utep.edu](https://reader031.fdocuments.us/reader031/viewer/2022012301/61e1b94ba8663e23fa00404d/html5/thumbnails/35.jpg)
Bubble conversion - step one
g f
e d
c
b
a
Invert OR gate inputs (converting to NAND) Invert AND gate outputs (converting to NAND)
![Page 36: Combinational Logic - ece.utep.edu](https://reader031.fdocuments.us/reader031/viewer/2022012301/61e1b94ba8663e23fa00404d/html5/thumbnails/36.jpg)
Bubble conversion - step two
g’ f’
e d
c’
b
a’
Ensure all inversions come in pairs (canceling each other out) (i.e. invert input literals or add inverters)
![Page 37: Combinational Logic - ece.utep.edu](https://reader031.fdocuments.us/reader031/viewer/2022012301/61e1b94ba8663e23fa00404d/html5/thumbnails/37.jpg)
Bubble conversion - step three
g’ f’
e d
c’
b
a’
Replace all Inverted-input OR gates with NAND gates
![Page 38: Combinational Logic - ece.utep.edu](https://reader031.fdocuments.us/reader031/viewer/2022012301/61e1b94ba8663e23fa00404d/html5/thumbnails/38.jpg)
Complex CMOS Logic
out
A
A
B
B
C
C
out
PFET network
NFET network
A B C
A B C
![Page 39: Combinational Logic - ece.utep.edu](https://reader031.fdocuments.us/reader031/viewer/2022012301/61e1b94ba8663e23fa00404d/html5/thumbnails/39.jpg)
Complex CMOS - Equivalent Inverter
out
A
A
B
B
C
C
For pull down, the equivalent pull down strength (W/L ratio) has three cases: A and B on – W/Leq = 1 / (1/(W/La) + 1/(W/Lb) C only – W/Lc
or all three W/Leq = W/Lc + 1 / (1/(W/La) + 1/(W/Lb)
![Page 40: Combinational Logic - ece.utep.edu](https://reader031.fdocuments.us/reader031/viewer/2022012301/61e1b94ba8663e23fa00404d/html5/thumbnails/40.jpg)
Complex CMOS Logic - Euler
C
B
A
C
B A
NFET network PFET network
Find common Euler path which does not traverse any branch more than once.
out
A
A
B
B
C
C
![Page 41: Combinational Logic - ece.utep.edu](https://reader031.fdocuments.us/reader031/viewer/2022012301/61e1b94ba8663e23fa00404d/html5/thumbnails/41.jpg)
Complex CMOS Logic
Given a function F = ((A*B)+C)’ what is best layout to share diffusions when possible. One solution but not best Vdd
Gnd
out
A B C
nwell active area
active area in pwell
![Page 42: Combinational Logic - ece.utep.edu](https://reader031.fdocuments.us/reader031/viewer/2022012301/61e1b94ba8663e23fa00404d/html5/thumbnails/42.jpg)
Complex CMOS Logic
Given a function F = ((A*B)+C)’ what is best layout to share diffusions when possible. Switch S/D of C for better. Vdd
Gnd
out
A B C
![Page 43: Combinational Logic - ece.utep.edu](https://reader031.fdocuments.us/reader031/viewer/2022012301/61e1b94ba8663e23fa00404d/html5/thumbnails/43.jpg)
Pass Gates
In most static CMOS, a PFET network pulls high and a dual NFET network pulls low.
In a pass gate configuration, they tie inputs to outputs. Pass gates can either be “ON” and pass a value or be “OFF” and tri-state an output.
One NFET can do this, but passes high values poorly. One PFET can do this too, but passes low values poorly.
in out
enable
![Page 44: Combinational Logic - ece.utep.edu](https://reader031.fdocuments.us/reader031/viewer/2022012301/61e1b94ba8663e23fa00404d/html5/thumbnails/44.jpg)
Pass Gates
Couple of problems, not only will it not drive a full logic high, the effective R skyrockets to infinity as you approach Vdd-Vt. This means that it also slows down as well as and provides no drive strength when statically high, thus the
output is susceptible to coupling noise.
in out
enable
![Page 45: Combinational Logic - ece.utep.edu](https://reader031.fdocuments.us/reader031/viewer/2022012301/61e1b94ba8663e23fa00404d/html5/thumbnails/45.jpg)
Charge Sharing (and Pass Gates)
Common interview question… Basis for DRAM operation. At t=0, the gate is low, C1 (50 fF) is charged to 2 volts, C2 (25 fF) is charged to 3 volts. Later, the gate is turned on. What is voltage of C1 and C2? Simple Eng101, but most grads can’t do it.
C1 C2
gate
v1 v2
![Page 46: Combinational Logic - ece.utep.edu](https://reader031.fdocuments.us/reader031/viewer/2022012301/61e1b94ba8663e23fa00404d/html5/thumbnails/46.jpg)
Complementary Transmission Gates
Use a PFET and NFET in parallel, passes ones and zeros. Never used by logic designers, circuit designers hide them. TGs act as switches, either providing a resistive short or an open circuit. Does not provide drive, attenuating the signal. Susceptible to “above Vdd” or “below Gnd” noise at input.
![Page 47: Combinational Logic - ece.utep.edu](https://reader031.fdocuments.us/reader031/viewer/2022012301/61e1b94ba8663e23fa00404d/html5/thumbnails/47.jpg)
Noise problems with TGs
Consider the case where the TG is off, but the input is capacitively coupled down from 0 to – 2*Vt.
Then Vgs > Vt and the NFET will turn on momentarily. Consider the case where the TG is off, but the input is
capacitively coupled up from Vdd to Vdd + 2*Vt. Then Vgs > Vt and the PFET will turn on momentarily. Morale of the story, never let a global signal drive a source,
only the transistor gate.
![Page 48: Combinational Logic - ece.utep.edu](https://reader031.fdocuments.us/reader031/viewer/2022012301/61e1b94ba8663e23fa00404d/html5/thumbnails/48.jpg)
Effective Resistance of TGs
For passing low values, the NFET is fully on. For passing high values, the PFET is fully on. The effective resistance stays relatively constant regardless of the input voltage (as opposed to how pass gates respond).
Reff
Vin
Vt Vdd-Vt
Vdd
NFET R
PFET R
Combination
![Page 49: Combinational Logic - ece.utep.edu](https://reader031.fdocuments.us/reader031/viewer/2022012301/61e1b94ba8663e23fa00404d/html5/thumbnails/49.jpg)
Textbook Transmission Gate Mux
d1
d0
s
out
Referred to as “soft node” Usually limited to 5 or 6 TGs.
![Page 50: Combinational Logic - ece.utep.edu](https://reader031.fdocuments.us/reader031/viewer/2022012301/61e1b94ba8663e23fa00404d/html5/thumbnails/50.jpg)
Real Transmission Gate Mux
d1
d0
s
out
Need input inverters for noise and output inverter to cancel inversion and provide drive strength
![Page 51: Combinational Logic - ece.utep.edu](https://reader031.fdocuments.us/reader031/viewer/2022012301/61e1b94ba8663e23fa00404d/html5/thumbnails/51.jpg)
TG Logic
Implements F = A*B + C
c’
c
c
b
b’
b’
f a
![Page 52: Combinational Logic - ece.utep.edu](https://reader031.fdocuments.us/reader031/viewer/2022012301/61e1b94ba8663e23fa00404d/html5/thumbnails/52.jpg)
NFET Pass Gate Logic
Implements F = A^B b’ b
a
a’
f
Couple of major problems though: 1) really needs 4 transistors to get both complements, 2) if F is high, you’ll have a Vt drop (slow and consumes power) 3) inputs are unbuffered to source (noise).
![Page 53: Combinational Logic - ece.utep.edu](https://reader031.fdocuments.us/reader031/viewer/2022012301/61e1b94ba8663e23fa00404d/html5/thumbnails/53.jpg)
CPL Logic
Implements F = A^B
b’ b
b
b’
a
a’
a
a’
f’
f f’
f
![Page 54: Combinational Logic - ece.utep.edu](https://reader031.fdocuments.us/reader031/viewer/2022012301/61e1b94ba8663e23fa00404d/html5/thumbnails/54.jpg)
Full Adder Cell
l Very common circuit in processors l Slow and large (compared to NANDs) l Complete macro cell
– adds two 1 bit numbers – provides 1 bit sum and carry out
l Many can be connected together S = A^B^C Cout = AB + BC + AC
A B Cin S Cout 0 0 0 0 0 0 0 1 1 0 0 1 0 1 0 0 1 1 0 1 1 0 0 1 0 1 0 1 0 1 1 1 0 0 1 1 1 1 1 1
![Page 55: Combinational Logic - ece.utep.edu](https://reader031.fdocuments.us/reader031/viewer/2022012301/61e1b94ba8663e23fa00404d/html5/thumbnails/55.jpg)
Full Adder Cell
A B Cin S Cout 0 0 0 0 0 0 0 1 1 0 0 1 0 1 0 0 1 1 0 1 1 0 0 1 0 1 0 1 0 1 1 1 0 0 1 1 1 1 1 1
S A B Cin
Cout
![Page 56: Combinational Logic - ece.utep.edu](https://reader031.fdocuments.us/reader031/viewer/2022012301/61e1b94ba8663e23fa00404d/html5/thumbnails/56.jpg)
Ripple Carry Adder
full adder
a b
s
cin cout
full adder
a b
s
cin cout
full adder
a b
s
cin cout
full adder
a b
s
cin cout
A[3:0] B[3:0]
4
4
Sum[4:0]
0
5
![Page 57: Combinational Logic - ece.utep.edu](https://reader031.fdocuments.us/reader031/viewer/2022012301/61e1b94ba8663e23fa00404d/html5/thumbnails/57.jpg)
Adder/Subtracter
full adder
a b
s
cin cout
full adder
a b
s
cin cout
full adder
a b
s
cin cout
full adder
a b
s
cin cout
A[3:0] B[3:0]
4
4
Sum[4:0]
5
subtract
![Page 58: Combinational Logic - ece.utep.edu](https://reader031.fdocuments.us/reader031/viewer/2022012301/61e1b94ba8663e23fa00404d/html5/thumbnails/58.jpg)
Standard CMOS Full Adder
Full Standard CMOS Adder 40 transistors – 20 PFETs / 20 NFET Delay Robust (even at low Vdd), Good Noise Immunity
I3
I9 I10
I4
I7 I8
I6
I5
I1 I2
I12
I19 I20
I14
I17 I18
I16
I15
I11 I13
I25 I26
I29 I30
I28
I27
I23
I22
I24
I21 I33
I34
Cout
I31
I32 Sum
A
B
Cin
A
B
BN B
AN
A
Cin
B
BN
A
CinN
SumN CoutN
![Page 59: Combinational Logic - ece.utep.edu](https://reader031.fdocuments.us/reader031/viewer/2022012301/61e1b94ba8663e23fa00404d/html5/thumbnails/59.jpg)
Transmission Gate Adder
Standard Transmission Gate Adder 26 transistors - 13 PFET / 13 NFET
I17
I18
I15
I16
I13 I14
I11
I12
I9
I10 Sum
Cout
I3 I4
I1
I2
I7 I8
I5
I6
I21
I22
I19
I20
I25
I26
I23
I24
A
B
Cin
![Page 60: Combinational Logic - ece.utep.edu](https://reader031.fdocuments.us/reader031/viewer/2022012301/61e1b94ba8663e23fa00404d/html5/thumbnails/60.jpg)
Complementary Pass Gate Logic
Swing Restoring CPL Adder 32 transistors – 8 PFETs / 24 NFETs improved leakage over straight CPL
I13
I14 I32
I31
I1
I2
A
AN I3
I4
B BN
I5 I6
Cin
CinN I7
I8
I11
I12
SumN
I9
I10
Sum
I15
I16
B
BN I17
I18
AN CinN
I21 I22
A
AN I23
I24
I17
I18 B
BN I19 I20
I27
I28
Cout
I25
I26
CoutN
Cin A AN CinN Cin A
![Page 61: Combinational Logic - ece.utep.edu](https://reader031.fdocuments.us/reader031/viewer/2022012301/61e1b94ba8663e23fa00404d/html5/thumbnails/61.jpg)
LEAN Adder
Single Ended Pass Logic (LEAN) Adder 22 transistors - 5 PFETs / 17 NFETs highest density
I7
I4
B
I3 I11
Cin
I5
I6
I17
I19
I20
Sum
I8
I12
A
I1
I2 I9
I13
I18
I21
I22
Cout
I10
I14
I15 I16