Logic gates & IC families

Digital logic & computing · tree view

Gates are saturated-transistor switches whose behaviour is fully described by a truth table; the TTL and CMOS IC families implement the same Boolean functions with different transistors, voltage levels, noise margins, power draw and fan-out.

Prerequisites

ttl-7400 symbol
ttl-7400
cmos-4000 symbol
cmos-4000
gate-silhouettes.svg
gate-silhouettes.svg
ttl-cmos-levels.svg
ttl-cmos-levels.svg
demorgan-equivalents.svg
demorgan-equivalents.svg

One common way to express the particular function of a gate circuit is called a truth table. Truth tables show all combinations of input conditions in terms of logic level states (either "high" or "low," "1" or "0," for each input terminal of the gate), along with the corresponding output logic level, either "high" or "low."

— kuphaldt-linac DIGI, Vol. IV (Digital), ch. 3 — Digital signals and gates source

For a two input gate, there are four possibilities (00, 01, 10, and 11), and thus four rows to the corresponding truth table. For a three-input gate, there are eight possibilities (000, 001, 010, 011, 100, 101, 110, and 111), and thus a truth table with eight rows are needed. The mathematically inclined will realize that the number of truth table rows needed for a gate is equal to 2 raised to the power of the number of input terminals.

— kuphaldt-linac DIGI, Vol. IV (Digital), ch. 3 — Digital signals and gates source

One of the easiest multiple-input gates to understand is the AND gate, so-called because the output of this gate will be "high" (1) if and only if all inputs (first input and the second input and . . .) are "high" (1). If any input(s) are "low" (0), the output is guaranteed to be in a "low" state as well.

— kuphaldt-linac DIGI, Vol. IV (Digital), ch. 3 — The AND gate source

Our next gate to investigate is the OR gate, so-called because the output of this gate will be "high" (1) if any of the inputs (first input or the second input or . . .) are "high" (1). The output of an OR gate goes "low" (0) if and only if all inputs are "low" (0).

— kuphaldt-linac DIGI, Vol. IV (Digital), ch. 3 — The OR gate source

The tendency for such a circuit to assume a high input state if left floating is one shared by all gate circuits based on this type of design, known as Transistor-to-Transistor Logic, or TTL.

— kuphaldt-linac DIGI, Vol. IV (Digital), ch. 3 — The NOT gate source

For this reason, it is inadvisable to allow a CMOS logic gate input to float under any circumstances. Please note that this is very different from the behavior of a TTL gate where a floating input was safely interpreted as a "high" (1) logic level.

— kuphaldt-linac DIGI, Vol. IV (Digital), ch. 3 — CMOS gate circuitry source

First and foremost on the list of comparisons between TTL and CMOS is the issue of power consumption. In this measure of performance, CMOS is the unchallenged victor. Because the complementary P- and N-channel MOSFET pairs of a CMOS gate circuit are (ideally) never conducting at the same time, there is little or no current drawn by the circuit from the Vdd power supply except for what current is necessary to source current to a load.

— kuphaldt-linac DIGI, Vol. IV (Digital), ch. 3 — CMOS gate circuitry source

A CMOS gate also draws much less current from a driving gate output than a TTL gate because MOSFETs are voltage-controlled, not current-controlled, devices. This means that one gate can drive many more CMOS inputs than TTL inputs. The measure of how many gate inputs a single gate output can drive is called fanout.

— kuphaldt-linac DIGI, Vol. IV (Digital), ch. 3 — CMOS gate circuitry source

Whereas TTL gates are restricted to power supply (Vcc) voltages between 4.75 and 5.25 volts, CMOS gates are typically able to operate on any voltage between 3 and 15 volts!

— kuphaldt-linac DIGI, Vol. IV (Digital), ch. 3 — CMOS gate circuitry source

"Acceptable" input signal voltages range from 0 volts to 0.8 volts for a "low" logic state, and 2 volts to 5 volts for a "high" logic state.

— kuphaldt-linac DIGI, Vol. IV (Digital), ch. 3 — Logic signal voltage levels source

It should be obvious from these figures that CMOS gate circuits have far greater noise margins than TTL: 1.45 volts for CMOS low-level and high-level margins, versus a maximum of 0.7 volts for TTL. In other words, CMOS circuits can tolerate over twice the amount of superimposed "noise" voltage on their input lines before signal interpretation errors will result.

— kuphaldt-linac DIGI, Vol. IV (Digital), ch. 3 — Logic signal voltage levels source

Remember that inversion of all inputs to a gate results in changing that gate's essential function from AND to OR (or vice versa), plus an inverted output. Thus, with all inputs inverted, a NAND behaves as an OR, a NOR behaves as an AND, an AND behaves as a NOR, and an OR behaves as a NAND.

— kuphaldt-linac DIGI, Vol. IV (Digital), ch. 3 — Constructing the NOR function source

NAND and NOR gates possess a special property: they are universal. That is, given enough gates, either type of gate is able to mimic the operation of any other gate type.

— kuphaldt-linac DIGI, Vol. IV (Digital), ch. 3 — Gate universality source
Show alternative explanations

In this type of logic, inputs are applied to resistors, and the output is produced by a transistor.

— NEETS Module 13, Module 13, ch. 3, p. 3-39 (RTL)

In TTL, transistors with multiple emitters are used for the logic inputs. Additional transistors are used to produce the desired output. TTL is normally packed in DIPs and is quite common in military equipment.

— NEETS Module 13, Module 13, ch. 3, p. 3-39 (TTL)

The CMOS logic circuits use metal oxide semiconductors similar to field-effect transistors (FETs).

— NEETS Module 13, Module 13, ch. 3, p. 3-39 (CMOS)

When the TRUE and FALSE conditions are converted to electrical signals, they are referred to as LOGIC LEVELS called HIGH and LOW. The 1 state might be represented by the presence of an electrical signal (HIGH), while the 0 state might be represented by the absence of an electrical signal (LOW).

— NEETS Module 13, Module 13, ch. 2, p. 2-3 (logic levels)

This device is called an inverter. The inverter simply flips the sense of the input. So if C is a 1 the output is a 0, if C is a 0 the output becomes a 1.

— MIT 6.002 lecture transcripts, Lecture 5, ~00:08:23 (op-amps as inverters, digital sense)

So to summarize here, this discipline that forms the foundations of digital systems is called "a static discipline".

— MIT 6.002 lecture transcripts, Lecture 4, ~00:35:21 (VOL/VIL/VIH/VOH noise bands)

The six two-input gates — every row, no guessing

With two inputs there are 2² = 4 input combinations, so a complete gate truth table has exactly four rows. AND/OR/NAND/NOR/XOR/XNOR share those same four rows; only the output column changes. NOT (single input) is the same idea with 2¹ = 2 rows: 0 → 1, 1 → 0.

To predict the outcome:

  1. List the input pairs in counting order: 00, 01, 10, 11.
  2. Fill the AND column: 1 only on the 11 row.
  3. Fill the OR column: 0 only on the 00 row.
  4. NAND/NOR are the inverted AND/OR columns; XOR outputs 1 where inputs differ, XNOR where they match.
abandornandnorxorxnor
00001101
01011010
10011010
11110001

De Morgan's equivalent gates — NAND ≡ negative-OR, NOR ≡ negative-AND

Invert both inputs of a gate and its function flips between AND-ness and OR-ness with the output inverted too. The verdict columns check the equivalence numerically: NAND(A,B) against OR(A′,B′), and NOR(A,B) against AND(A′,B′), for all four input rows.

To predict the outcome:

  1. Compute the plain gate output (NAND or NOR).
  2. Invert each input, then apply the opposite function (OR after NAND, AND after NOR).
  3. Compare column by column — every row must match, which proves the gates are interchangeable (bubble-pushing).
abnand_a_bor_of_inverted_inputsmatch_1nor_a_band_of_inverted_inputsmatch_2
0011✓11✓
0111✓00✓
1011✓00✓
1100✓00✓

TTL vs CMOS at 5 V — spec sheet verdicts

Same Boolean function, different silicon. TTL (74xx) uses saturated bipolar transistors on a regulated 5 V rail; CMOS (4000/74Cxx) uses complementary MOSFETs whose input thresholds track the supply. The verdict rows come straight from the voltage, noise-margin and power comparisons above.

To predict the outcome:

  1. Read each parameter row as a head-to-head: the two middle columns give the guaranteed ranges.
  2. Note where the ranges leave a forbidden gap — anything inside it is "uncertain" and no manufacturer will promise what a gate does with it.
  3. Use the verdict column to decide which family fits the job (battery, noisy environment, speed, interfacing).
parameterttl_5vcmos_5vverdict
power supply4.75 – 5.25 V only3 – 15 V typicalCMOS runs from unregulated batteries; TTL needs a regulated 5 V rail
input LOW range0 – 0.8 V0 – 1.5 Vboth accept TTL's 0 – 0.5 V output LOW
input HIGH range2 – 5 V3.5 – 5 Va TTL HIGH (2.7 V min) may fall inside CMOS's uncertain zone — pullup needed
output LOW / HIGH0 – 0.5 V / 2.7 – 5 V0 – 0.05 V / 4.95 – 5 VCMOS outputs swing rail-to-rail; TTL loses ~2 V on top
noise margin0.3 V (low) / 0.7 V (high)1.45 V (both)CMOS tolerates over twice the noise
floating inputdrifts HIGH (harmless)undefined — must be tied with pullup/pulldownnever leave CMOS inputs dangling
static powerconstant bias current≈0 static; rises with switching frequencyCMOS wins for battery and low-speed logic
fan-outeach output drives few TTL inputs (inputs draw current)one output drives many CMOS inputs (voltage-controlled)CMOS loads the driving gate far less

Candidate projects — awaiting review

  • Threshold probe race: drive one 7400 and one CD4011 input from a 1 kΩ potentiometer across a 5 V supply, find each chip's actual switching point with a DMM, and compare against the guaranteed 0.8/2 V (TTL) and 1.5/3.5 V (CMOS) bands — then repeat with the CMOS chip on a 9 V battery to watch its threshold move with the supply. (https://www.eevblog.com/forum/beginners/7400-series-logic-chips/, community)
  • The floating-input experiment: leave a TTL input and a CMOS input unconnected, wire an LED to each output, and record what each does (TTL tends high; CMOS drifts or oscillates) — then cure the CMOS input with a 10 kΩ pull-up and a pull-down and re-test. (https://www.ibiblio.org/kuphaldt/electricCircuits/DIGI/DIGI_3.html (CMOS gate circuitry), book)
  • TTL → CMOS interface fix: drive a CD4011 input straight from a 74LS00 output at 5 V (may read the guaranteed 2.7 V HIGH as LOW), confirm the fault, then add the 10 kΩ pull-up to 5 V and show the CMOS gate now switches reliably — exactly the book's prescribed fix. (https://www.ibiblio.org/kuphaldt/electricCircuits/DIGI/DIGI_3.html (Logic signal voltage levels), book)
  • Family survey on a breadboard: wire the same NAND circuit in 74LS00 and 4011 form, measure each chip's supply current (DMM in series), then clock an input at 1 Hz vs 100 kHz and watch CMOS current climb with frequency while TTL stays roughly constant. (https://www.reddit.com/r/AskElectronics/comments/117et60/what_is_exactly_the_main_the_difference_or_the/, community)