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.
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."
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.
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.
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).
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.
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.
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.
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.
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!
"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.
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.
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.
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.
In this type of logic, inputs are applied to resistors, and the output is produced by a transistor.
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.
The CMOS logic circuits use metal oxide semiconductors similar to field-effect transistors (FETs).
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).
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.
So to summarize here, this discipline that forms the foundations of digital systems is called "a static discipline".
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:
| a | b | and | or | nand | nor | xor | xnor |
|---|---|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 1 | 1 | 0 | 1 |
| 0 | 1 | 0 | 1 | 1 | 0 | 1 | 0 |
| 1 | 0 | 0 | 1 | 1 | 0 | 1 | 0 |
| 1 | 1 | 1 | 1 | 0 | 0 | 0 | 1 |
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:
| a | b | nand_a_b | or_of_inverted_inputs | match_1 | nor_a_b | and_of_inverted_inputs | match_2 |
|---|---|---|---|---|---|---|---|
| 0 | 0 | 1 | 1 | ✓ | 1 | 1 | ✓ |
| 0 | 1 | 1 | 1 | ✓ | 0 | 0 | ✓ |
| 1 | 0 | 1 | 1 | ✓ | 0 | 0 | ✓ |
| 1 | 1 | 0 | 0 | ✓ | 0 | 0 | ✓ |
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:
| parameter | ttl_5v | cmos_5v | verdict |
|---|---|---|---|
| power supply | 4.75 – 5.25 V only | 3 – 15 V typical | CMOS runs from unregulated batteries; TTL needs a regulated 5 V rail |
| input LOW range | 0 – 0.8 V | 0 – 1.5 V | both accept TTL's 0 – 0.5 V output LOW |
| input HIGH range | 2 – 5 V | 3.5 – 5 V | a TTL HIGH (2.7 V min) may fall inside CMOS's uncertain zone — pullup needed |
| output LOW / HIGH | 0 – 0.5 V / 2.7 – 5 V | 0 – 0.05 V / 4.95 – 5 V | CMOS outputs swing rail-to-rail; TTL loses ~2 V on top |
| noise margin | 0.3 V (low) / 0.7 V (high) | 1.45 V (both) | CMOS tolerates over twice the noise |
| floating input | drifts HIGH (harmless) | undefined — must be tied with pullup/pulldown | never leave CMOS inputs dangling |
| static power | constant bias current | ≈0 static; rises with switching frequency | CMOS wins for battery and low-speed logic |
| fan-out | each output drives few TTL inputs (inputs draw current) | one output drives many CMOS inputs (voltage-controlled) | CMOS loads the driving gate far less |