An error lamp is useful only when you know which errors can leave it dark. Build a checker for three data wires and one parity wire, then deliberately change the received word. A single changed wire produces an error indication. Two changed wires can produce a different word that still passes. This small circuit makes that limitation visible without firmware.
This is a documented low-voltage experiment with host-checked logical calculations. It has not been physically tested here. The plots show ideal static states, not measured propagation delays or switch waveforms. No microcontroller or firmware binary is required.
What the chip checks
Exclusive OR (XOR) is a logic operation whose output is HIGH when its two inputs differ. An integrated circuit (IC) contains electronic functions in one package; the Texas Instruments SN74HC86N contains four separate XOR gates. Cascading three gates gives S = D0 ⊕ D1 ⊕ D2 ⊕ P. Here D0–D2 are data bits, P is the received parity bit, and S is the syndrome: the check result, rather than a corrected data value.
Even parity means the complete word contains an even number of ones. The transmitter would choose P = D0 ⊕ D1 ⊕ D2. The receiving checker combines that parity bit with the three received data bits. A zero syndrome means even parity; a one means odd parity. The important experiment uses a manually held parity switch: generate P from the original word, then leave it unchanged while corrupting data at the receiver. Recomputing P after every data change would hide the very error you want to demonstrate.
This is combinational logic: the settled output depends on the current inputs, with no stored clocked word. It does not identify which wire changed. It cannot decide whether a valid-looking input word is the intended message, nor tell a deliberate message update from an error without an external agreement about when the word is valid.
Use the named package and a controlled supply
Use one genuine TI SN74HC86N, N package, a 14-pin plastic dual in-line package (PDIP); one regulated 4.5 V (volt) supply with a 20 mA current limit; a 100 nF ceramic bypass capacitor; four single-pole double-throw (SPDT) selectors; four 1 kΩ series resistors; four 10 kΩ pulldowns; one 3.3 kΩ resistor; one red light-emitting diode (LED); a breadboard and short jumpers. A voltmeter helps distinguish a dark LED from an actual LOW. The volt (V) measures voltage; the ampere (A) measures current, and one milliampere (mA) is one thousandth of an ampere. Ω is the unit ohm; kΩ means one thousand ohms, and nF means one billionth of a farad.
The supply range in the datasheet is 2–6 V. This experiment chooses 4.5 V so the published 4.5 V logic limits apply directly: a valid LOW is at or below 1.35 V and a valid HIGH is at or above 3.15 V. Voltages between those limits are not a third useful digital state. The 7 V absolute supply maximum is a stress boundary, not a recommended supply. Keep all connected signals within the powered chip’s rails.
| Function | Physical pins | Connection |
|---|---|---|
| Gate 1: D0 ⊕ D1 | 1, 2 → 3 | Inputs D0 and D1; output to pin 4 |
| Gate 2: previous ⊕ D2 | 4, 5 → 6 | Pin 5 is D2; output to pin 9 |
| Gate 3: previous ⊕ P | 9, 10 → 8 | Pin 10 is P; pin 8 is S |
| Unused gate 4 | 12, 13 → 11 | Ground both inputs; leave output 11 open |
| Power | 14, 7 | 14 to +4.5 V; 7 to ground; 100 nF directly between them |
Check the manufacturer’s top-view notch and pin numbering before insertion. Similar-looking HC, HCT and other logic families are not automatic substitutes: their supply and input requirements differ. The circuit has no 5 V microcontroller attached and needs no level converter.
Wire three gates and four independent selectors

tricky-circuit-batch-007/images/sn74hc86-parity.svg) · Open full-size diagram.Each rectangle marked =1 represents one XOR function; its numbers identify physical package pins. With power disconnected, install the IC across the breadboard centre gap and connect its supply and bypass first. Build the pin 3→4 and pin 6→9 links. At each input selector, connect one throw to +4.5 V and the other throw to ground. Its common contact feeds the relevant IC input through 1 kΩ. A separate 10 kΩ resistor connects the IC side of that series resistor to ground. This gives a defined LOW during an open contact. For HIGH, the 1 kΩ and 10 kΩ form a divider: 4.5 × 10/11 ≈ 4.09 V, comfortably above 3.15 V before tolerance and wiring checks.
Connect syndrome pin 8 through 3.3 kΩ to the LED anode; connect the LED cathode to ground. The LED points from the resistor toward ground, and its cathode is the terminal marked by the flat side or shorter lead on many through-hole LEDs. Verify the actual part. With an assumed 1.6 V forward drop, the approximate load is (4.5−1.6)/3300 ≈ 0.88 mA. The resistor limits the load; brightness is not a calibrated output-voltage measurement.
Do not add a capacitor from a raw HC input to ground as an improvised debounce fix. Slowly crossing the input threshold can violate transition-rate requirements and increase supply current. Switch bounce may produce several rapid transitions; this exercise evaluates settled words after the contacts stop moving. A Schmitt-trigger conditioner or a clocked receiver belongs in a separate dynamic design.
Predict the word before moving a wire
Start with D0=1, D1=0, D2=1. There are two ones, so choose P=0. Gate 1 gives 1, gate 2 returns 0, and gate 3 remains 0: the LED should be off. Flip D0 only, leaving P unchanged: received data 001 with P=0 contains one one, so S=1. Restore the original and flip D0 and D1 together in the final settled word: 011 with P=0 contains two ones again, so S=0 although the received data are different.
Every changed wire toggles the overall XOR once. Therefore any odd number of changes among the four wires is detected, while an even number is not. For four wires there are 1, 4, 6, 4 and 1 possible masks with zero through four flips respectively. All four one-flip masks and all four three-flip masks light the ideal error output. The six two-flip masks and the single four-flip mask can silently corrupt a word. These are exact logical counts, not probabilities of a real cable failing.

tricky-circuit-batch-007/images/sn74hc86-parity-faults.svg) · Open full-size plot.Run a controlled fault-injection experiment
- Inspect the unpowered wiring and check that neither an output nor a supply rail is shorted. Set all selectors LOW, apply 4.5 V and record the actual supply at pins 14 and 7.
- Record all eight possible data patterns. For each, choose the correct even-parity P and measure S after the selectors settle. It should be LOW; a dark LED alone is insufficient evidence.
- Choose one original word and keep its P fixed. Change each of its four wires separately, restoring the original between trials. Record the expected syndrome, output voltage and LED state.
- Change two selected data wires. Record the passing parity result and the fact that the word changed. This is the central blind-spot experiment, not a wiring failure.
- Change P alone, then P plus one data wire. Separate errors in the parity channel from errors in the data channels.
- With suitable measuring equipment, observe transitions only as an optional extension. Never label a short pulse as the chip’s propagation delay without accounting for probe, loading, path and input timing.
Use the blank observation sheet (ZIP; file: tricky-circuit-batch-007/code/sn74hc86-parity-observations-blank.csv); do not copy the synthetic plot into the measured column. If an input is unmeasured or disconnected, record it as unknown. This circuit provides no word-valid strobe, and a person’s two switch movements are sequential. A brief error light between two final changes is expected and does not contradict the final even-parity result.
Complete host-side logical oracle
The following Python 3.11 program runs on a computer. It does not drive the chip. It prints every mask for the original 101 data word and checks all eight payloads against all 16 masks. It deliberately propagates an unknown input as None rather than inventing LOW. Run python3 sn74hc86-parity.py. The four received columns are ordered D0,D1,D2,P; mask bit 0 changes D0.
Download the complete program (ZIP; file: tricky-circuit-batch-007/code/sn74hc86-parity.py).
"""Even-parity experiment oracle, CPython 3.11; not a timing/silicon model."""
from itertools import product
def bit(value):
if type(value) is not int or value not in (0, 1):
raise ValueError("a bit must be the integer 0 or 1")
return value
def parity(values):
"""XOR known bits. None is an unmeasured/unknown input, never LOW."""
values = tuple(values)
if not values:
raise ValueError("at least one input is required")
for value in values:
if value is not None:
bit(value)
if any(value is None for value in values):
return None
result = 0
for value in values:
result ^= value
return result
def encode(data):
data = tuple(data)
if len(data) != 3 or any(value is None for value in data):
raise ValueError("three known data bits are required")
return data + (parity(data),)
def syndrome(word):
word = tuple(word)
if len(word) != 4:
raise ValueError("three data bits and their parity bit are required")
return parity(word)
def flip(word, mask):
word = tuple(word)
if len(word) != 4 or any(value is None for value in word):
raise ValueError("a known four-bit word is required")
if type(mask) is not int or not 0 <= mask <= 15:
raise ValueError("mask must be an integer from 0 to 15")
return tuple(bit(value) ^ ((mask >> index) & 1)
for index, value in enumerate(word))
def fault_table(data):
"""Mask bit0 flips D0, bit1 D1, bit2 D2, bit3 the received parity."""
sent = encode(data)
rows = []
for mask in range(16):
received = flip(sent, mask)
rows.append({"mask": mask, "flips": bin(mask).count("1"),
"sent": sent, "received": received,
"syndrome": syndrome(received),
"changed": received != sent})
return rows
if __name__ == "__main__":
print("mask,flips,D0,D1,D2,P,syndrome,word_changed")
for row in fault_table((1, 0, 1)):
print(",".join(map(str, (row["mask"], row["flips"],
*row["received"], row["syndrome"],
int(row["changed"])))))
# Exhaustive logical cross-check for all eight payloads and all 16 masks.
for data in product((0, 1), repeat=3):
assert all(row["syndrome"] == row["flips"] % 2
for row in fault_table(data))
Diagnose mismatches without changing the theory
If S is HIGH for every word, check the two inter-gate connections and ground pin 7 before blaming parity. If the LED never lights, measure pin 8; a reversed LED, broken resistor lead or short to ground can hide a valid logic signal. If a selector’s HIGH measures near 2 V, stop and find the divider or short: the input is in an undefined region. An unused floating input can also create supply noise even when its output is unused.
The supplied host tests execute the actual oracle, cover all mask weights, preserve unknowns and reject invalid bits, lengths and masks. They prove those software behaviors. They do not prove breadboard continuity, LED current, the chip’s silicon delay or an installed component’s authenticity. The datasheet has separate timing conditions and capacitive loads; the event graphic is not a claim that all gates change simultaneously.
Parity is suitable for demonstrating a low-cost consistency check. It offers no error correction, message authentication or general guarantee that a passing word is correct. A checksum over a larger block and a cyclic redundancy check use different constructions and different error guarantees. Choose them from the communication requirements rather than calling this one-bit checker universal protection.
Challenge: can one more XOR remove the blind spot?
Add a fourth XOR that combines S with a fixed LOW. Would it detect the two-bit change that the first checker missed?
Answer
No. XOR with LOW copies S. The fourth gate does not create new independent information about the original message. For the corrupted even-parity word, S is already zero. Detecting more error patterns needs another independent check or a stronger code, with a receiver that knows when to sample a complete word.
Primary references and related reading
- TI SN74HC86 SCLS100F, April 2021: package pins, truth function, operating levels and timing conditions.
- TI current product documentation, checked October 20, 2026; no separate device errata was surfaced in that documentation check.
- TI guidance on slow or floating CMOS inputs; complementary metal-oxide-semiconductor (CMOS) describes the logic technology.
- Python 3.11 itertools for exhaustive combinations.
Continue with the electronics course.



