Electrical Engineering › Section R · Digital concepts, number systems, and codes › Topic R.3
Programmable and fixed-function logic, instruments, and troubleshooting
Logic functions reach a circuit board either as fixed-function chips or as programmable devices configured by the designer. This topic surveys both, the packages they come in, the instruments used to test digital circuits, and a systematic way to find faults.
Fixed-function logic
A fixed-function IC has its logic set by the manufacturer. The classic range is the 74 series: in a part such as 74HC00, the letters name the technology family (HC, high-speed CMOS) and the digits the function (00, four 2-input NAND gates). Most ICs today use CMOS, built from complementary MOSFETs; the older bipolar family is TTL, and BiCMOS mixes the two. Chips are graded by complexity in equivalent gates, with boundaries that vary between sources: SSI up to about 10, MSI about 10 to 100, LSI about 100 to 10,000, VLSI about 10,000 to 100,000 and ULSI beyond. Fixed-function parts now serve mostly as glue logic between larger chips.
Programmable logic: SPLD, CPLD and FPGA
A programmable logic device (PLD) leaves the factory blank and takes whatever logic the designer loads. A simple PLD (SPLD) has a programmable AND array feeding OR gates, enough for one modest function. A complex PLD (CPLD) places several SPLD-like blocks on one chip, joined by a programmable interconnect. A field-programmable gate array (FPGA) is larger again, with thousands to millions of small logic blocks, often built around look-up tables, in a grid of programmable routing. A microcontroller is different: its hardware is fixed and it is programmed with software instructions. "SPLDs, CPLDs, and FPGAs" covers these devices in depth.
From design to programmed chip
Programmable logic is designed on a computer with the vendor's development software, in a standard sequence. 1. Design entry: describe the logic as text in a hardware description language (HDL) such as VHDL or Verilog, or draw a schematic. 2. Functional simulation: check that the logic gives the right outputs, ignoring delays. 3. Synthesis: translate the description into a netlist of basic logic elements. 4. Implementation: fit the netlist onto the device's actual resources. 5. Timing simulation: recheck with real delays. 6. Download: send the configuration to the device, usually over a cable to a development board.
Packages and pin numbering
Through-hole packages, chiefly the dual in-line package (DIP), have pins pushed through holes in the board. Surface-mount technology (SMT) packages solder onto pads on one side, saving space: small-outline (SOIC, SSOP), quad flat (QFP), J-lead (PLCC), leadless (LCC) and ball-grid (BGA) types. Pin 1 is marked by a dot, notch or bevel. Seen from the top with the notch upward, a DIP's pin 1 is top left; numbers run down the left side and back up the right, anticlockwise, so the highest number sits opposite pin 1. Four-sided packages also count anticlockwise from a marked pin 1.
Worked example: probing a 14-pin DIP
A 74HC00 in a 14-pin DIP has \(V_{CC}\) on pin 14 and ground on pin 7, the usual layout for 14-pin 74-series gates. Seen from the top with the notch up, where are these pins? 1. Pin 1 is top left; pins 1 to 7 run down the left side, so pin 7 is bottom left. 2. Pins 8 to 14 run up the right side, so pin 8 is bottom right and pin 14 is top right. 3. Pin 14 is therefore directly opposite pin 1, across the notch. Check: \(7 + 7 = 14\) pins, and the two supply pins sit at diagonally opposite corners, a quick visual test that the chip is not inserted backwards.
The oscilloscope
An oscilloscope graphs voltage against time. The vertical control sets volts per division, the horizontal control seconds per division, and the trigger fixes where each sweep starts, so a repeating waveform stands still and a single event can be caught. Use dc coupling for digital signals: ac coupling blocks the dc level and makes logic levels unreadable. Most measurements use a ×10 probe, which loads the circuit far less than a ×1 probe and must be compensated by adjusting it on the scope's calibration square wave. Measuring pulse width, rise time and duty cycle follows "Pulse waveforms, repetition rate, duty cycle, and average value".
Digital scope specifications
Bandwidth is the frequency at which a sine wave displays at 70.7% of its true amplitude (−3 dB). Square waves contain harmonics far above their fundamental, so a scope needs several times the clock frequency, and for many scopes the fastest rise time they can show is about \(0.35/\text{BW}\). The sampling rate is how often the internal ADC digitises the input, typically several times the bandwidth. Record length is the number of samples stored, which fixes the capture time:
Resolution in bits sets the number of vertical levels, \(2^n\).
Worked example: reading a scope
A clock on a scope set to 2 µs/div and 2 V/div shows one period across 4.0 divisions and a height of 1.65 divisions. The scope samples at 1 GS/s with a 10-million-point record and 8-bit resolution over 8 divisions. 1. Period: \(T = 4.0 \times 2\,\mu\text{s} = 8.0\,\mu\text{s}\), so \(f = 125\,\text{kHz}\). 2. Amplitude: \(1.65 \times 2\,\text{V} = 3.3\,\text{V}\), a 3.3 V logic signal. 3. Capture time: \(10^7 / 10^9\,\text{s}^{-1} = 10\,\text{ms}\). 4. Vertical step: full scale is 16 V across \(2^8 = 256\) levels, 62.5 mV per level. Check: 10 ms holds 1250 clock periods.
Other bench instruments
A logic analyser records many digital channels at once, from dozens to more than a hundred, showing them as timing waveforms or as tables of states, and it can trigger on a chosen bit pattern. It shows logic values; a scope shows analogue detail such as overshoot. A function generator supplies sine, square and pulse waveforms, and a logic signal source supplies programmed bit patterns. A digital multimeter (DMM) measures dc voltage, current and resistance, and a bench dc supply powers the circuit. A logic probe's lamp shows HIGH, LOW or pulsing at a point, and a logic pulser injects pulses for the probe to follow.
Troubleshooting a digital system
Troubleshooting means recognising, isolating and correcting a fault. 1. Gather information and confirm the symptom. 2. Check the obvious: supply voltage, fuses, connectors, loose wires, switch settings and visible damage. 3. Trace signals from a known good input forward, or back from the faulty output, to the first point where a signal goes wrong. 4. In a long chain, use half-splitting: test the middle, then the middle of the bad half, so 16 stages need at most 4 checks. 5. Substitute a known good signal or board to confirm. Wear an earthed wrist strap with CMOS parts, which static discharge can damage, and fit replacements with power off.
Common mistakes to avoid
First, using ac coupling on a logic signal, which hides its true HIGH and LOW levels. Second, forgetting to set the scope for a ×10 probe, which makes every voltage read ten times too small. Third, counting DIP pins clockwise: from pin 1 they run anticlockwise when viewed from the top. Fourth, assuming a scope's bandwidth only needs to match the clock frequency; edges contain much higher harmonics. Fifth, replacing parts at random before checking power and ground, the commonest faults of all.
Key takeaways
Fixed-function 74-series ICs are set at the factory; letters name the family and digits the function. Most ICs use CMOS. SPLDs, CPLDs and FPGAs are configured by the user through design entry, simulation, synthesis, implementation and download. DIP pins count anticlockwise from pin 1 seen from the top. A scope needs dc coupling, a compensated ×10 probe and enough bandwidth; capture time is record length ÷ sampling rate. Logic analysers, generators, DMMs, supplies, probes and pulsers complete the bench. Troubleshoot systematically: check the obvious, trace signals and half-split.
Flashcards
Flashcard
Logic set by the manufacturer
Test your understanding
Question 1 of 5
A 16-pin DIP is viewed from the top with its notch pointing up. Which pin is directly opposite pin 1, at the top right?
Question 2 of 5
A digital scope samples at 500 MS/s and stores a 1-million-point record. How long a stretch of signal can it capture at once?
Question 3 of 5
Why should a logic signal be viewed on an oscilloscope with dc coupling rather than ac coupling?
Question 4 of 5
In the programmable-logic design flow, which step converts the HDL description into a netlist of basic logic elements?
Question 5 of 5
A fault lies somewhere in a chain of 32 identical stages. Using half-splitting, how many checks are needed at most to find the faulty stage?
