Skip to content
GATEiit

GATE EC · Digital Circuits

Logic gates and their static CMOS implementations

Basic and universal logic gates, the CMOS inverter (transfer curve, switching threshold, noise margins, power), building any static CMOS gate from dual pull-up and pull-down networks, transistor sizing, and reading a CMOS circuit.

Before you start

This topic comes before: Code converters, Decoders, Latches and flip-flops, Propagation delay, ROM, SRAM, DRAM

Concept notes

1. Logic gates and universal gates

Gate Output Output is 1 when
NOT Aˉ A=0
AND AB all inputs are 1
OR A+B any input is 1
NAND AB‾ any input is 0
NOR A+B‾ all inputs are 0
XOR A⊕B=ABˉ+AˉB an odd number of inputs are 1
XNOR A⊕B‾ an even number of inputs are 1

NAND and NOR are universal: any Boolean function can be built from NAND gates alone (or NOR gates alone).

Function 2-input NAND gates 2-input NOR gates
NOT 1 1
AND 2 3
OR 3 2
XOR 4 5
XNOR 5 4

Useful facts.

  • De Morgan: AB‾=Aˉ+Bˉ, so a NAND is an OR with inverted inputs ("bubble pushing").
  • A two-level AND-OR circuit becomes a NAND-NAND circuit by replacing every gate with NAND; OR-AND becomes NOR-NOR.
  • XOR is associative; A⊕A=0, A⊕1=Aˉ. A chain of XORs gives odd parity.
  • Tying the inputs of a NAND or NOR together gives an inverter.

2. The CMOS inverter

A CMOS inverter is a PMOS from VDD to the output and an NMOS from the output to ground, with gates tied together. For A=0 the PMOS is on and the NMOS off, so Y=VDD; for A=1 the reverse, so Y=0.

Key properties.

  • Rail-to-rail output: VOH=VDD, VOL=0.
  • No static current (ideally): in either steady state one transistor is off. Power is drawn mainly while switching.
  • Very high input resistance; one gate can drive many (large fan-out, limited by delay).

Switching threshold VM is where Vin=Vout; both transistors are saturated there. With square-law devices, k=μCoxW/L and r=kp/kn:

VM=VTn+r (VDD−∣VTp∣)1+r

For kn=kp and VTn=∣VTp∣, VM=VDD/2 (symmetric). Since μn≈2 to 3 μp, the PMOS is made 2 to 3 times wider for this. A stronger NMOS pulls VM down; a stronger PMOS pushes it up.

Noise margins use VIL and VIH, the input voltages where the transfer curve has slope −1:

NML=VIL−VOL,NMH=VOH−VIH

VDDAY = A′PMOS: pull-upon when A = 0NMOS: pull-downon when A = 1A = 0: Y = VDDA = 1: Y = 0
CMOS inverter: the PMOS pulls the output up to VDD when A = 0, the NMOS pulls it down to ground when A = 1.

3. Building static CMOS gates: PUN and PDN

A static CMOS gate has an NMOS pull-down network (PDN) between output and ground, and a PMOS pull-up network (PUN) between VDD and output. For every input combination exactly one of them conducts.

Design rules.

  1. Write the function as Y=F‾. The PDN realises F: AND → NMOS in series, OR → NMOS in parallel.
  2. The PUN is the dual: series ↔ parallel swapped, PMOS with the same inputs.
  3. Each input drives one NMOS and one PMOS, so an N-input gate needs 2N transistors.
Gate PDN PUN Transistors
Inverter 1 NMOS 1 PMOS 2
NAND2 2 NMOS in series 2 PMOS in parallel 4
NOR2 2 NMOS in parallel 2 PMOS in series 4
AND2, OR2 NAND2 or NOR2 + inverter 6
AB+C‾ (AOI21) (A series B)∥C (A∥B) series C 6
AB+CD‾ (AOI22) two series pairs in parallel two parallel pairs in series 8

Static CMOS is inherently inverting: one stage gives only negative (inverting) functions. A non-inverting function such as AND needs an extra inverter.

Reading a circuit. Find the PDN, write its conduction condition F (series = AND, parallel = OR), and the output is Y=F‾. Check that the PUN conducts on Fˉ.

VDDABY = (AB)′ABpull-up network:PMOS in parallelpull-down network:NMOS in series
Static CMOS NAND2: series NMOS pull-down and parallel PMOS pull-up (the dual network).

4. Transistor sizing: why NAND beats NOR

A conducting MOSFET acts roughly like a resistor R∝1μ (W/L). Transistors in series add their resistances; so to match a reference inverter, k devices in series must each be k times wider.

Take the reference inverter as NMOS width 1, PMOS width 2 (since μn≈2μp). For equal worst-case drive:

Gate Each NMOS Each PMOS Total width
NAND2 2 2 8
NOR2 1 4 10
NAND3 3 2 15
NOR3 1 6 21

NAND is preferred over NOR: its series devices are the fast NMOS, while NOR stacks the slow PMOS. NAND is smaller and has less input capacitance for the same speed.

Fan-in. A large fan-in means long series stacks; delay grows roughly as the square of the fan-in (both resistance and capacitance grow). Gates with more than about 4 inputs are usually split into a tree of smaller gates.

The worst-case pull-down of a NAND is through all the series NMOS; the worst-case pull-up is through one PMOS (only one input low).

5. Power and delay of CMOS gates

Dynamic (switching) power. Each 0→1 output transition draws energy CLVDD2 from the supply: half is stored on the load, half is lost in the PMOS; the stored half is lost in the NMOS on discharge. With activity factor α (fraction of clock cycles with a 0→1 output transition):

Pdyn=α CL VDD2 f

For a signal that switches every cycle (a clock), α=1.

Other components.

  • Short-circuit power: for a short time during an input transition both devices conduct. It grows with slow input edges.
  • Leakage (static) power: sub-threshold and junction leakage when transistors are nominally off; significant in deep sub-micron processes.

Lowering power: reduce VDD (quadratic saving), CL, f or α (clock gating).

Propagation delay. Treating the conducting path as a resistor R charging CL,

tp≈0.69 R CL,tp=tpHL+tpLH2

Delay falls with wider transistors (lower R) and higher VDD (more current), but rises with load capacitance and fan-out. The power-delay product P×tp is the energy per switching event, a common figure of merit.

Formulas to remember

Switching thresholdSquare-law model, both devices saturated
VM=VTn+r(VDD−∣VTp∣)1+r,r=kpkn
Noise margins
NML=VIL−VOL,NMH=VOH−VIH
Dynamic power
Pdyn=α CLVDD2f
Energy drawn per 0 to 1 transitionHalf stored on CL, half lost in the PMOS
E=CLVDD2
Propagation delay
tp≈0.69 ReqCL,tp=tpHL+tpLH2
Static CMOS transistor countFor an N-input single-stage gate
NT=2N

Common mistakes

  • Taking the pull-down network's function as the output; the output is its complement because the PDN pulls the output low.
  • Forgetting to swap series and parallel when forming the pull-up network.
  • Assuming a single static CMOS stage can give AND or OR; those need a NAND or NOR plus an inverter.
  • Sizing parallel transistors up; only series devices are widened, by the number of devices in the stack.
  • Using C V squared f without the activity factor, or counting one half of C V squared as the energy drawn per transition instead of all of it.

Worked examples

Try each step yourself, then reveal the working.

Example 1: Reading a CMOS circuit

conceptual

In a static CMOS gate the pull-down network has NMOS A and B in series, and this pair in parallel with NMOS C. Find the output function, describe the pull-up network and count the transistors.

  1. Step 1: Write the condition for the PDN to conduct.

    Try it on paper first.

Example 2: Switching threshold of an inverter

numerical

A CMOS inverter has VDD=3 V, VTn=∣VTp∣=0.5 V and kn=4kp. Find VM.

  1. Step 1: Find $r$.

    Try it on paper first.

Example 3: Dynamic power

numerical

A CMOS gate drives CL=50 fF at VDD=1 V, clock 1 GHz, activity factor 0.2. Find the dynamic power. What is it if VDD is cut to 0.8 V?

  1. Step 1: Apply $P = \alpha C_LV_{DD}^2f$.

    Try it on paper first.

Example 4: Sizing a NAND3

numerical

The reference inverter has NMOS width Wn=1 μm and PMOS width Wp=2 μm. Size a three-input NAND for the same worst-case drive, and compare its total width with a NOR3.

  1. Step 1: Size the series NMOS stack.

    Try it on paper first.

Previous year questions

1 official GATE EC question on this topic, newest first.

Topic test

9 questions: up to 1 official PYQs and original practice questions, with GATE marking (MCQ wrong answers lose marks). Score 60% or more to pass. A new set is drawn each time.

Mark as mastered

Loading your progress…

My revision notes

Notes written by the GATEiit team against the official GATE EC syllabus; being checked by a reviewer. Updated 2026-11-28. Spotted a mistake? Use Report an issue on any question, or contact us.