Electrical Engineering › Section S · Logic gates and Boolean algebra › Topic S.2
Programmable and fixed-function gates: logic levels and noise margins
A gate on paper is ideal; a gate on a board has voltage limits, a delay, a power draw and a limit on what it can drive. This topic covers how programmable devices form gates, the 74-series families, the four voltage limits that define logic levels and noise margins, speed and power, fan-out, and how gates fail.
The programmable AND array
Most programmable logic devices are built around an AND array: a grid in which each input variable and its complement run as column lines, each AND gate input is a row line, and a programmable link sits at every crossing. Programming keeps only the links each gate needs. With inputs A and B there are four column lines, \(A\), \(\overline{A}\), \(B\) and \(\overline{B}\); to make a gate produce \(A\overline{B}\), its links to the \(A\) and \(\overline{B}\) lines stay and the other two are removed. Feeding several such product terms into OR gates gives any function in sum-of-products form, the form taught in "Boolean simplification, standard forms, and truth tables".
Link technologies and programming
Fuse links start closed and are blown open; antifuse links start open and are made to conduct; both are one-time programmable (OTP). EPROM, EEPROM and flash links are floating-gate transistors whose stored charge sets them on or off. They keep their state without power, and EEPROM and flash parts can be reprogrammed electrically while on the board, called in-system programming. SRAM links are memory cells that switch pass transistors; they are volatile, so the configuration must be reloaded from a separate memory at each power-up, the usual arrangement in FPGAs. Designs are entered as HDL text, such as VHDL or Verilog, or as schematics, then downloaded.
Fixed-function gates and families
In the 74 series the last digits give the function: 00 is a quad 2-input NAND, 02 a quad 2-input NOR, 04 a hex inverter, 08 a quad 2-input AND, 32 a quad 2-input OR and 86 a quad 2-input XOR. The letters give the family. CMOS families include HC (high-speed CMOS), HCT (HC with TTL-compatible inputs), AC and AHC (faster) and LVC (for 3.3 V and lower supplies); bipolar TTL families include LS (low-power Schottky), ALS and F. A 74HC00 and a 74LS00 do the same logic with the same pins, but differ in supply range, speed, power and voltage levels.
Four voltage limits
Every family's data sheet specifies four voltages. At the inputs, \(V_{IH(\min)}\) is the lowest voltage guaranteed to read HIGH and \(V_{IL(\max)}\) the highest guaranteed to read LOW. At the outputs, \(V_{OH(\min)}\) is the lowest voltage a HIGH output will give and \(V_{OL(\max)}\) the highest a LOW output will give, each at a stated load current. For standard 5 V TTL these are 2.0 V, 0.8 V, 2.4 V and 0.4 V. A working family always has \(V_{OH(\min)} > V_{IH(\min)}\) and \(V_{OL(\max)} < V_{IL(\max)}\), so a valid output lands well inside a valid input range.
Noise margins
The gap between what an output guarantees and what an input needs is the noise margin, the size of interference a signal can pick up between gates and still be read correctly:
For standard 5 V TTL both are 0.4 V: a HIGH of at least 2.4 V can lose 0.4 V and still exceed 2.0 V. Because each gate regenerates clean levels, noise smaller than the margin never builds up along a chain of gates.
Worked example: CMOS noise margins
With light CMOS loads, a 5 V HC gate has \(V_{IH(\min)} = 3.5\,\text{V}\), \(V_{IL(\max)} = 1.5\,\text{V}\), \(V_{OH(\min)} = 4.9\,\text{V}\) and \(V_{OL(\max)} = 0.1\,\text{V}\). Find its noise margins and compare with 5 V TTL. 1. \(NM_H = 4.9 - 3.5 = 1.4\,\text{V}\). 2. \(NM_L = 1.5 - 0.1 = 1.4\,\text{V}\). 3. TTL's margins are 0.4 V, so this CMOS family tolerates about 3.5 times as much noise. Check: the input thresholds sit at 70% and 30% of the supply, and the outputs within 0.1 V of the rails; heavier load currents pull the outputs inward and shrink both margins.
Worked example: a 3.3 V output into 5 V logic
A 3.3 V CMOS output, guaranteed \(V_{OH(\min)} = 2.4\,\text{V}\) and \(V_{OL(\max)} = 0.4\,\text{V}\) at its rated load, drives a 5 V gate. Will an HC input (3.5 V and 1.5 V thresholds) work, or an HCT input (2.0 V and 0.8 V)? 1. HC HIGH margin: \(2.4 - 3.5 = -1.1\,\text{V}\). Negative means a guaranteed HIGH may not be read as HIGH: unreliable. 2. HCT HIGH margin: \(2.4 - 2.0 = 0.4\,\text{V}\), positive. 3. HCT LOW margin: \(0.8 - 0.4 = 0.4\,\text{V}\), positive. So use HCT, whose TTL-compatible inputs exist for this job, or a level translator.
Speed and power
Propagation delay is the time from an input edge to the resulting output edge, measured between 50% points: \(t_{PHL}\) for an output falling HIGH to LOW and \(t_{PLH}\) for rising; shorter delays allow higher clock rates. Bipolar power averages the HIGH and LOW supply currents,
and hardly depends on frequency; CMOS draws almost nothing when static, and its power rises with switching frequency. The speed-power product, \(SPP = t_p P_D\), in joules, compares families. A gate with 8 ns delay, 1.2 mA and 3.4 mA at 5 V uses \(P_D = 11.5\,\text{mW}\), so \(SPP = 92\,\text{pJ}\).
Fan-out and unused inputs
Fan-out is the number of inputs of the same family one output can drive while keeping its levels in specification, counted in unit loads, one unit load being one such input. For standard TTL, a LOW output sinks 16 mA and each input sources 1.6 mA, giving 10; a HIGH output sources 0.4 mA and each input needs 40 µA, also 10. The smaller ratio sets the fan-out. CMOS inputs draw almost no dc current, so CMOS fan-out is limited mainly by input capacitance slowing the edges. Never leave inputs floating: tie unused AND or NAND inputs HIGH (through a resistor for TTL) and unused OR or NOR inputs LOW.
Troubleshooting gates
First check that each IC has its supply voltage and ground. Most internal faults are opens and shorts. An open TTL input acts as a HIGH, while an open CMOS input floats unpredictably. A shorted output sits stuck HIGH or LOW whatever the inputs do. To test a gate, pulse one input with a logic pulser or function generator while holding the others at the enabling level, HIGH for AND and NAND, LOW for OR and NOR, and watch the output with a probe or a dc-coupled scope. XOR gates pass pulses whatever the level of the other input.
Common mistakes to avoid
First, swapping the terms in a noise margin: \(NM_H\) is the output minimum minus the input minimum, \(NM_L\) the input maximum minus the output maximum. Second, quoting thresholds without the family or supply. Third, assuming same pins means interchangeable: a 74HC part may not read a 3.3 V or TTL output reliably. Fourth, computing fan-out from only the LOW state; check both and take the smaller. Fifth, leaving unused CMOS inputs floating, which causes erratic switching and extra current. Sixth, forgetting that an SRAM-based device loses its configuration at power-off.
Key takeaways
Programmable devices form gates from an AND array with programmable links: fuse and antifuse (one-time), EPROM, EEPROM and flash (nonvolatile, often reprogrammable) or SRAM (volatile). The 74 series codes family in letters and function in digits. Logic levels are set by V_IH(min), V_IL(max), V_OH(min) and V_OL(max); NM_H = V_OH(min) − V_IH(min), NM_L = V_IL(max) − V_OL(max), both 0.4 V for standard 5 V TTL. Speed is t_PHL and t_PLH; SPP = t_p × P_D. Fan-out counts unit loads, the smaller of the LOW and HIGH ratios. Tie off unused inputs, and test gates with other inputs at enabling levels.
Flashcards
Flashcard
Grid of variable lines and gate inputs with programmable links
Test your understanding
Question 1 of 5
A family has V_OH(min) = 2.7 V, V_IH(min) = 2.0 V, V_IL(max) = 0.8 V and V_OL(max) = 0.5 V. What are its noise margins?
Question 2 of 5
A 3.3 V output with V_OH(min) = 2.4 V must drive a 5 V CMOS input. Which input type gives a positive HIGH noise margin?
Question 3 of 5
Which programmable-link technology loses its configuration when power is removed?
Question 4 of 5
A standard TTL output can sink 16 mA LOW and source 0.4 mA HIGH. Each input needs 1.6 mA LOW and 40 µA HIGH. What is the fan-out?
Question 5 of 5
You are testing one input of a 2-input NOR gate by pulsing it. What should the other input be held at?
