Digital Integrated Circuits
– lecture 4 –
CMOS Logic Gates
Zoltan Hascsi
• Switching circuits
• CMOS logic gates
• Three-state logic gates
• Transmission gates
Zoltan Hascsi Digital Integrated Circuits lecture 4 2
Claude Shannon
• "A Symbolic Analysis of Relay and Switching Circuits"
– The essay, written in 1936, when he was aged only 20 years,
was to become his master's dissertation!
– Put the theoretical foundations of logic circuits design.
– Prooved the equivalence between switching circuits and Boolean
logic.
Zoltan Hascsi Digital Integrated Circuits lecture 4 3
Switching circuits
• basic element: switch
• 2 states:
– on, closed switch, conducts current
– off, open switch, no current flow
• A switching circuit has only switches and connections
between them. It has two terminals between which there
is a current flow or not, depending on the switches' state.
• If states of switches are variables, the circuit overall
on/off state is a logic function of those input variables.
• Replacing each switch with a relay, the input variables
will be the voltages that control the relays.
Zoltan Hascsi Digital Integrated Circuits lecture 4 4
Series connection
• It is equivalent to the AND logic function.
• The series circuit is on if and only if both switches are on
(the first switch is closed AND the second switch is
closed).
• Denoting the state of the first switch with a, and the state
of the second switch with b, the overall state of the
circuit, c, will be:
a b
Zoltan Hascsi Digital Integrated Circuits lecture 4 5
Series connection
• It is equivalent to the AND logic function.
• The series circuit is on if and only if both switches are on
(the first switch is closed AND the second switch is
closed).
• Denoting the state of the first switch with a, and the state
of the second switch with b, the overall state of the
circuit, c, will be:
a b a b c
off off off
Zoltan Hascsi Digital Integrated Circuits lecture 4 6
Series connection
• It is equivalent to the AND logic function.
• The series circuit is on if and only if both switches are on
(the first switch is closed AND the second switch is
closed).
• Denoting the state of the first switch with a, and the state
of the second switch with b, the overall state of the
circuit, c, will be:
a b a b c
off off off
off on off
Zoltan Hascsi Digital Integrated Circuits lecture 4 7
Series connection
• It is equivalent to the AND logic function.
• The series circuit is on if and only if both switches are on
(the first switch is closed AND the second switch is
closed).
• Denoting the state of the first switch with a, and the state
of the second switch with b, the overall state of the
circuit, c, will be:
a b a b c
off off off
off on off
on off off
Zoltan Hascsi Digital Integrated Circuits lecture 4 8
Series connection
• It is equivalent to the AND logic function.
• The series circuit is on if and only if both switches are on
(the first switch is closed AND the second switch is
closed).
• Denoting the state of the first switch with a, and the state
of the second switch with b, the overall state of the
circuit, c, will be:
a b a b c
off off off
off on off
on off off
on on on
Zoltan Hascsi Digital Integrated Circuits lecture 4 9
Series connection
• It is equivalent to the AND logic function.
• on and off are simply labels for the switch state.
• any other pair of labels will work, for example true or T
for the on state, and false or F for the off state.
• In formal logic we could write:
c is true Ù a is true AND b is true.
a b a b c
F F F
F T F
T F F
T T T
Zoltan Hascsi Digital Integrated Circuits lecture 4 10
Series connection
• It is equivalent to the AND logic function.
• In Boolean logic we often use 1 to label the on (true)
state, and 0 for the off (false) state.
• The overal state of the series circuit will be:
c=a·b
a b a b c
0 0 0
0 1 0
1 0 0
1 1 1
Zoltan Hascsi Digital Integrated Circuits lecture 4 11
Series connection
• It is equivalent to the AND logic function.
• If switches' states are the input variables a and b, the
series connection can be equated with a single switch
whose state is the logical AND function of the two input
variables.
a b a·b
Zoltan Hascsi Digital Integrated Circuits lecture 4 12
Parallel connection
• It is equivalent to the OR logic function.
• The parallel circuit is on if and only if al least one switch
is on (the first switch is closed OR the second switch is
closed).
• Denoting the state of the first switch with a, and the state
of the second switch with b, the overall state of the
circuit, c, will be:
a
Zoltan Hascsi Digital Integrated Circuits lecture 4 13
Parallel connection
• It is equivalent to the OR logic function.
• The parallel circuit is on if and only if al least one switch
is on (the first switch is closed OR the second switch is
closed).
• Denoting the state of the first switch with a, and the state
of the second switch with b, the overall state of the
circuit, c, will be.
a
a b c
off off off
Zoltan Hascsi Digital Integrated Circuits lecture 4 14
Parallel connection
• It is equivalent to the OR logic function.
• The parallel circuit is on if and only if al least one switch
is on (the first switch is closed OR the second switch is
closed).
• Denoting the state of the first switch with a, and the state
of the second switch with b, the overall state of the
circuit, c, will be.
a
a b c
off off off
off on on
Zoltan Hascsi Digital Integrated Circuits lecture 4 15
Parallel connection
• It is equivalent to the OR logic function.
• The parallel circuit is on if and only if al least one switch
is on (the first switch is closed OR the second switch is
closed).
• Denoting the state of the first switch with a, and the state
of the second switch with b, the overall state of the
circuit, c, will be.
a
a b c
off off off
off on on
on off on
b
Zoltan Hascsi Digital Integrated Circuits lecture 4 16
Parallel connection
• It is equivalent to the OR logic function.
• The parallel circuit is on if and only if al least one switch
is on (the first switch is closed OR the second switch is
closed).
• Denoting the state of the first switch with a, and the state
of the second switch with b, the overall state of the
circuit, c, will be.
a
a b c
off off off
off on on
on off on
b on on on
Zoltan Hascsi Digital Integrated Circuits lecture 4 17
Parallel connection
• It is equivalent to the OR logic function.
• on and off are simply labels for the switch state.
• any other pair of labels will work, for example true or T
for the on state, and false or F for the off state.
• In formal logic we could write:
c is true Ù a is true OR b is true.
a
a b c
F F F
F T T
T F T
b T T T
Zoltan Hascsi Digital Integrated Circuits lecture 4 18
Parallel connection
• It is equivalent to the OR logic function.
• In Boolean logic we often use 1 to label the on (true)
state, and 0 for the off (false) state.
• The overal state of the parallel circuit will be:
c=a+b
a
a b c
0 0 0
0 1 1
1 0 1
b 1 1 1
Zoltan Hascsi Digital Integrated Circuits lecture 4 19
Parallel connection
• It is equivalent to the OR logic function.
• If switches' states are the input variables a and b, the
parallel connection can be equated with a single switch
whose state is the logical OR function of the two input
variables.
a
a+b
Zoltan Hascsi Digital Integrated Circuits lecture 4 20
Logic circuits
b c
a
• Complex circuits with switches can be decomposed in
subcircuits conected in series or parallel, much like a
complex expression is decomposed into subexpressions
connected through AND or OR operators.
Zoltan Hascsi Digital Integrated Circuits lecture 4 21
Logic circuits
series
connection
b c b·c
a a
d d
Zoltan Hascsi Digital Integrated Circuits lecture 4 22
Logic circuits
b c b·c
a a
d d
Zoltan Hascsi Digital Integrated Circuits lecture 4 23
Logic circuits
b c b·c
a a
d d
parallel connection
a (b·c+d)
Zoltan Hascsi Digital Integrated Circuits lecture 4 24
Logic circuits
b c b·c
a a
d d
a (b·c+d)
Zoltan Hascsi Digital Integrated Circuits lecture 4 25
Logic circuits
b c b·c
a a
d d
a·(b·c+d) a (b·c+d)
series
connection
Zoltan Hascsi Digital Integrated Circuits lecture 4 26
Logic circuits
b c b·c
a a
d d
a·(b·c+d) a (b·c+d)
Zoltan Hascsi Digital Integrated Circuits lecture 4 27
Logic circuits
• By transitivity, the final circuit is equivalent to the initial
one:
b c b·c
a a
d d
a·(b·c+d) a (b·c+d)
Zoltan Hascsi Digital Integrated Circuits lecture 4 28
Logic circuits
• By transitivity, the final circuit is equivalent to the initial
one:
b c
a
a·(b·c+d)
Zoltan Hascsi Digital Integrated Circuits lecture 4 29
Logic complementation
• normally open switch:
x
– off (0) when x = 0;
– on (1) when x = 1;
• normally closed switch:
– off (0) when x = 1; x
– on (1) when x = 0;
Zoltan Hascsi Digital Integrated Circuits lecture 4 30
Logic complementation
• normally open switch:
x
– off (0) when x = 0;
– on (1) when x = 1;
• normally closed switch :
– off (0) when x = 1; x
– on (1) when x = 0;
it is equivalent to a normally
open switch controlled by the
complement of the variable.
x
Zoltan Hascsi Digital Integrated Circuits lecture 4 31
• Switching circuits
• CMOS logic gates
• Three-state logic gates
• Transmission gates
Zoltan Hascsi Digital Integrated Circuits lecture 4 32
MOS switches
• Between source and drain terminals the MOS transistor
behaves like a switch:
– is on: conducts (low output resistance) when the
channel between source and drain regions is
established;
– is off: does not conduct (practically infinit output
resistance) when it is blocked and there is no
channel;
Zoltan Hascsi Digital Integrated Circuits lecture 4 33
NMOS PMOS
• normally open switch • normally closed switch
• off when there is no gate • on when there is no gate
voltage and the source is voltage and the source is
connected to ground connected to power
(VGS = 0) supply
|VGS| = VDD
Zoltan Hascsi Digital Integrated Circuits lecture 4 34
The CMOS logic gate
• It is a static combinational circuit:
for any input logic value, the
VDD
output is either connected to
ground (GND), or to power
X1
supply (VDD), but never to both of PU
them at the same time. Xn
• PU (pull-up) – the circuit that Y
does the connection to power
X1
supply; PD
Xn
• PD (pull-down) – the circuit that
does the connection to ground;
• PU and PD are controlled by the
same inputs.
Zoltan Hascsi Digital Integrated Circuits lecture 4 35
The CMOS logic gate
• PU circuit has normally closed
switches (they are on when inputs
VDD
are low).
• When PU is on, the output Y is X1
connected to VDD and has value 1. PU
Xn
• PD circuit has normally open Y
switches (they are on when inputs X1
are high). PD
Xn
• When PD is on, the output Y is
connected to GND and has value
0.
Zoltan Hascsi Digital Integrated Circuits lecture 4 36
The CMOS inverter
• One single switch, normally
closed, in the PU circuit
VDD
X PU
• One single switch, normally Y
open, in the PD circuit
X PD
Zoltan Hascsi Digital Integrated Circuits lecture 4 37
The CMOS inverter
• One single switch, normally
closed, in the PU circuit:
VDD
the PMOS transistor, that
conducts (is on) when his input is
low, near or equal to GND, that X PU
is logic 0.
• One single switch, normally Y
open, in the PD circuit:
X PD
the NMOS transistor, that
conducts (is on) when its input is
high, near or equal to VDD, that is
logic 1.
Zoltan Hascsi Digital Integrated Circuits lecture 4 38
The CMOS inverter
• X=0
PU on (1) VDD
PD off (0)
Y=1
0 X PU on
Y 1
0 X PD off
Zoltan Hascsi Digital Integrated Circuits lecture 4 39
The CMOS inverter
• X=0
PU on (1) VDD
PD off (0)
Y=1
1 X PU off
• X=1 Y 0
PU off (0)
PD on (1) 1 X PD on
Y=0
Zoltan Hascsi Digital Integrated Circuits lecture 4 40
CMOS logic gate
• The PD network is equivalent to
a normally open switch, whose
VDD
state is a logic function of the
state of its switches (transistors).
X1
• When PD is on (logic 1) the PU off
Xn
output Y is connected to GND,
therefore is logic 0. Y 0
• The logic function of the output is X1
the complement of the logic PD on
Xn
function of the PD network!
Zoltan Hascsi Digital Integrated Circuits lecture 4 41
CMOS logic gate
• The PU network is equivalent to
a normally closed switch, whose
VDD
state is a logic function of the
state of its switches (transistors).
X1
• When PU is on (logic 1) the PU on
Xn
output Y is connected to VDD,
therefore is logic 1. Y 1
• The logic function of the output is X1
the logic function of the PU PD off
Xn
network.
Zoltan Hascsi Digital Integrated Circuits lecture 4 42
CMOS NAND gate
• Y=A·B
VDD
PU
PD
Zoltan Hascsi Digital Integrated Circuits lecture 4 43
CMOS NAND gate
• Y=A·B
• The PD network implements the VDD
complement of the function,
Y = A · B.
• For the NAND gate it will be a PU
series connection.
Y
Zoltan Hascsi Digital Integrated Circuits lecture 4 44
CMOS NAND gate
• Y=A·B
• The PU network implements the VDD
the function, but that cannot be
done using only series and
parallel connections, without PU
complementation.
Y
Zoltan Hascsi Digital Integrated Circuits lecture 4 45
CMOS NAND gate
• Y=A·B
• applying the de Morgan law: VDD
Y=A+B
• The PU network will be a parallel
connection. A B
Zoltan Hascsi Digital Integrated Circuits lecture 4 46
CMOS NAND gate
• Y=A·B
• The normally open switches VDD
controlled by the complemented
input variables are replaced with
normally closed switches, A B
directly controlled by the input
variables. Y
Zoltan Hascsi Digital Integrated Circuits lecture 4 47
CMOS NAND gate
• Y=A·B
• Replace the normally open VDD
swithces with NMOS transistors,
and the normally closed switches
with PMOS transistors.
Zoltan Hascsi Digital Integrated Circuits lecture 4 48
CMOS NOR gate
• Y=A+B
VDD
PU
PD
Zoltan Hascsi Digital Integrated Circuits lecture 4 49
CMOS NOR gate
• Y=A+B
• The PD network implements the VDD
complement of the function,
Y = A + B.
• For the NOR gate it will be a PU
parallel connection.
A B
Zoltan Hascsi Digital Integrated Circuits lecture 4 50
CMOS NOR gate
• Y=A+B
• applying the de Morgan law : VDD
Y=A·B
• The PU network will be a series A
connection.
A B
Zoltan Hascsi Digital Integrated Circuits lecture 4 51
CMOS NOR gate
• Y=A+B
• The normally open switches VDD
controlled by the complemented
input variables are replaced with
A
normally closed switches, directly
controlled by the input variables.
B
A B
Zoltan Hascsi Digital Integrated Circuits lecture 4 52
CMOS NOR gate
• Y=A+B
• Replace the normally open VDD
swithces with NMOS
transistors, and the normally
closed switches with PMOS
transistors.
A
Zoltan Hascsi Digital Integrated Circuits lecture 4 53
CMOS complex logic gates
• Y = A·(B + C) VDD
• CMOS logic gates may have up
to 4-8 inputs.
• To be implemented with a single PU
logic gate, a function must be 0
when all inputs are 1, and to be
1 when all inputs are 0: Y
x1 x2 xn y
0 0 .. 0 1 PD
.... .
.... .
1 1 .. 1 0
Zoltan Hascsi Digital Integrated Circuits lecture 4 54
CMOS complex logic gates
• Y = A·(B + C) VDD
• inverter-like behaviour:
PU
A B C Y
0 0 0 1
Y
0 0 1 1
OK
0 1 0 1
0 1 1 1
1 0 0 1 PD
1 0 1 0
1 1 0 0
1 1 1 0
Zoltan Hascsi Digital Integrated Circuits lecture 4 55
CMOS complex logic gates
• Y = A·(B + C) VDD
• The PD network implements the
complement of the function:
Y = A·(B + C) PU
B C
Zoltan Hascsi Digital Integrated Circuits lecture 4 56
CMOS complex logic gates
• Y = A·(B + C) VDD
• The PU network implements the
function Y, but transformed C
through the de Morgan law, to A
get the complemented
B
variables:
Y = A + (B · C) Y
B C
Zoltan Hascsi Digital Integrated Circuits lecture 4 57
CMOS complex logic gates
• Y = A·(B + C) VDD
Zoltan Hascsi Digital Integrated Circuits lecture 4 58
CMOS complex logic gates
parallel
• Y = A·(B + C) VDD
PD: A·(B + C)
PU: A+(B · C) C
• The PU expression is the q2 PU1
dual of the PD expression! B
• The PU network is the dual
Y
of the PD network:
The parallel PD1 network (B+C) A q1
corresponds to the series (dual)
series
PU1 network (B · C).
The series connection of q1 and PD1
PD1 has as a dual counterpart the
parallel connection of q2 and PU1.
Zoltan Hascsi Digital Integrated Circuits lecture 4 59
CMOS complex logic gates
• The PD network, employing only VDD
NMOS transistors, implements
the F function.
• The PU network, realised with X1
PU
PMOS transistors only, may be Xn
designed as the dual of the PD
network, or as the F
implementation of the F function
(algebraically transformed to get X1
all variables complemented). PD
Xn
Zoltan Hascsi Digital Integrated Circuits lecture 4 60
Non-inverting logic gates
• F = (F')'
• They are implemented as the complement of the desired
function, followed by an inverter.
• The AND and OR gates are bigger and slower than the
NAND and NOR gates!
Zoltan Hascsi Digital Integrated Circuits lecture 4 61
• Switching circuits
• CMOS logic gates
• Three-state logic gates
• Transmission gates
Zoltan Hascsi Digital Integrated Circuits lecture 4 62
Three-state logic gate
• The static logic gate has always its output
connected through a low impedance path
either to power supply, or to GND.
• The three-state logic gate has an additional e a b y
input: enable. If it is inactive, the output is 1 0 0 0
disconnected from the rest of the gate 1 0 1 0
1 1 0 0
circuit, presenting a very high output 1 1 1 1
impedance (hiZ, high impedance). 0 x x z
• z is not a logic value! The logic value of the
output node is determined by other logic
gates to which this node may be
connected.
Zoltan Hascsi Digital Integrated Circuits lecture 4 63
Three-state logic gate
• The q1 (normally closed) and q2 VDD
(normally open) switches are
either both open (Y = hiZ), or X1
both closed (Y = F(X)). PU
Xn
q1
Y
q2
X1
PD
Xn
Zoltan Hascsi Digital Integrated Circuits lecture 4 64
Three-state logic gate
• The q1 (normally closed) and q2 VDD
(normally open) switches are
either both open (Y = hiZ), or X1
both closed (Y = F(X)). PU
Xn
• They are controlled by a pair of
complementary signals. E q1
E q2
X1
PD
Xn
Zoltan Hascsi Digital Integrated Circuits lecture 4 65
Three-state logic gate
• The q1 (normally closed) and q2 VDD
(normally open) switches are
either both open (Y = hiZ), or X1
both closed (Y = F(X)). PU
Xn
• They are controlled by a pair of
complementary signals. q1
• The three-logic gate may have Y
an internal inverter that
E q2
generates the needed
complementary enable.
X1
PD
Xn
Zoltan Hascsi Digital Integrated Circuits lecture 4 66
Three-state CMOS inverter
• with separate complementary
enable inputs: VDD
X Y
E E
Zoltan Hascsi Digital Integrated Circuits lecture 4 67
Three-state CMOS inverter
VDD
• with a single enable input: Y
X Y
X
E
Zoltan Hascsi Digital Integrated Circuits lecture 4 68
Three-state CMOS NAND
VDD
B
Y
A
Zoltan Hascsi Digital Integrated Circuits lecture 4 69
Three-state CMOS NAND
VDD
B
Y
A
E Y
Zoltan Hascsi Digital Integrated Circuits lecture 4 70
• Switching circuits
• CMOS logic gates
• Three-state logic gates
• Transmission gates
Zoltan Hascsi Digital Integrated Circuits lecture 4 71
The pass transistor
• MOS transistor is a switch.
X Y
• NMOS:
E = 0 → Y = hiZ
E E=1→Y=X
X Y
• PMOS:
E=0→Y=X
E E = 1 → Y = hiZ
Zoltan Hascsi Digital Integrated Circuits lecture 4 72
Complementary transistors
• NMOS transistor is good to propagate zeros (low
voltage), but not good to propagate ones (high voltage).
• PMOS transistor is good to propagate ones (high
voltage), but not good to propagate zeros (low voltage).
X Y X Y
CL CL
VDD GND
Y Y
VDD-VT
VT
Zoltan Hascsi Digital Integrated Circuits lecture 4 73
Transmission gate
• Parallel connection of an NMOS and a PMOS
transistors, that are simultaneously active, or inactive.
• Both logic values (both high and low voltages) are
passed through without changing their level (rail-to-rail
swing). GND X
VDD
X Y
CL Y
VDD
VDD
Zoltan Hascsi Digital Integrated Circuits lecture 4 74
Transmission gate
• The transistors are controlled by a pair of
complementary signals, so that either both are open
(NMOS gate is 1 and PMOS gate is 0), or both are off
(NMOS gate is 0 and PMOS gate is 1):
C C
X Y X Y
C C
• bidirectional and symmetric
• output and input may be interchanged
Zoltan Hascsi Digital Integrated Circuits lecture 4 75