ElecEng Handbook Electronic Engineer Reference
Home โ€บ Digital Logic

Digital Logic

Pull-up sizing, RC edge times, CMOS power and logic fanout calculators, plus logic-family, pull-up and gate-symbol reference tables with wiring diagrams.

Opens the browser print dialog โ€” choose "Save as PDF".
Logic thresholds, drive currents and edge rates are family-dependent โ€” confirm exact values in the datasheet of the part and of every device on the bus before sizing pull-ups or fanout.

Open-Drain Pull-Up

Rp,min = (VDD โˆ’ VOL)/IOL limits the sink current; Rp,max = tr / (CL ยท ln((VDDโˆ’VIH)/VDD)) keeps the rise fast enough. Choose R between the two.
V
V
A
s
F
Rp min (sink)
โ€”
Rp max (rise)
โ€”
VIH and bus capacitance together set the upper bound. Add a little margin and prefer a standard E24 value between the two limits.

RC Rise Time & Bandwidth

tr = 2.2 ยท R ยท C (10โ€“90 %); time constant ฯ„ = R ยท C; cutoff f = 1/(2ฯ€RC). A larger R or C slows the edge and lowers the corner.
ฮฉ
F
Rise time tr
โ€”
Time constant ฯ„
โ€”
Cutoff f3dB
โ€”
At the โˆ’3 dB cutoff the response is already โˆ’45ยฐ/dec down. For a clean digital edge keep f3dB well above the data rate.

CMOS Dynamic Power

P = C ยท Vยฒ ยท f. Switching a capacitance C at supply V and frequency f dissipates P; higher DVFS voltage dominates because it enters squared.
F
V
Hz
Dynamic power P
โ€”
Static/leakage and short-circuit power add on top. Per-gate power scales linearly with toggling activity, so gating clocks saves real power.

Logic Fanout

Fanout = min(IOH/IIH, IOL/IIL). How many inputs one output can drive, limited by the weaker of the source/sink capability versus each input's load.
A
A
A
A
Maximum fanout
โ€”
Edge rate is the real limit for high-speed CMOS; even if the DC fanout allows more loads, the added capacitance may slow the edges too much. Account for trace and input capacitance too.

๐Ÿ“Š Logic Diagrams

Open-drain bus pull-up, a CMOS inverter pair, a NAND gate with its truth table and a clocked D flip-flop.

OPEN-DRAIN BUS + PULL-UP bus Rp โ†’ VDD open-drain release โ†’ bus high open-drain

Open-drain bus โ€” Every node can only pull the shared line low; when all transistors are off the pull-up Rp restores it to VDD. This wired-AND bus works for I2C, 1-Wire and reset lines.

CMOS INVERTER VDD PMOS NMOS GND Vin Vout

CMOS inverter โ€” The PMOS pulls the output to VDD when Vin is low; the NMOS pulls it to GND when Vin is high. Only one transistor conducts at a time, so steady-state current is near zero.

NAND GATE · TRUTH TABLE A B Y A B | Y 0 0 | 1 0 1 | 1 1 0 | 1 1 1 | 0

NAND gate โ€” Output is low only when every input is high, and high otherwise. Universal in a sense: with a NAND you can build any other gate, which is why flash memories are made of them.

D FLIP-FLOP TIMING CLK D Q Q latched on โ†‘CLK edges: tsu/th before CLK

D flip-flop โ€” On every rising clock edge the output Q copies D and holds it until the next edge. Setup/hold times around the edge must be met: the input must be stable before tsu and held after th.

TRI-STATE BUS shared data line driver 1 0/1/High-Z driver 2 only one drives at a time

Tri-state bus โ€” Each driver can drive high, low or release (High-Z). Only one cell drives at a time; the others float so their outputs share a single wire without contention.

PUSH-PULL vs OPEN-DRAIN push-pull drives both rails Vout = rail-to-rail open-drain only pulls low

Push-pull vs open-drain โ€” A push-pull output actively drives both rails; an open-drain can only sink low and must be pulled up โ€” ideal for a shared bus or for level-shifting to a higher rail.

๐Ÿ“š Logic Reference Tables

Family electricals, pull-up/termination guidance and common gate functions. Values are typical at VDD = 5 V or 3.3 V โ€” confirm with each datasheet.

Logic Families (typical)

FamilyVCCVIHVILtpdIOCMOS out
74LS / TTL5 V2.0 V0.8 V≈10 ns±0.4 mAneeds pull-up
74HC2–6 V0.7·VCC0.3·VCC7–20 ns±4 mAfull rail CMOS
74HCT4.5–5.5 V2.0 V0.8 V8–20 ns±4 mATTL input, CMOS out
74LVC1.65–3.6 V0.6·VCC0.3·VCC2–4 ns±16–24 mAfast, 3.3 V
74AHC2–5.5 V0.65·VCC0.35·VCC3–8 ns±8 mAfast, drive
CD40xx3–15 V0.7·VDD0.3·VDD30–120 ns±1–6 mAslow, high swing

Pull-up & Termination

ItemCommon valueUse
I2C pull-up1–4.7 kΩbus capacitance trades with speed
SPI / GPIO pull-up10 kΩidle state, default weak
Reset pull-up10 kΩkeep MCU out of reset
LED resistor330–1 kΩlimit diode current
Series termination22–50 Ωmatch Z0, damp ringing

Common Gate Functions

SymbolOutput ruleTypical use
ANDY = AยทBgating / enable, all-high conditions
ORY = A+Bany-one triggers, combiner
NANDY = AยทBuniversal gate, memory cells
NORY = A+Buniversal gate, active-low logic
XORY = A⊕Bparity, comparator, adder