Supplier photo of an assembled infinity mirror light cube illuminated on a dark background.
Supplier photo
Temu affiliate offer · Project idea

Build an infinity light cube

Listing specifies 5-volt direct current. Soldering required; battery and glue not included.

View kit on Temu

Tricky Circuit may earn a commission through these links. Product ideas have not been bench-tested by Tricky Circuit and are not verified lesson parts lists.

SN74HC00: Build a Memory Bit and Explore the Forbidden Input

Can two ordinary logic gates remember which button was pressed? This experiment stores one bit without a processor or a program. The interesting part is what happens when both commands arrive together: the outputs stop being complements, and releasing both buttons does not promise which state will survive.

Units used below are volts (V), ohms (Ω), kilohms (kΩ, 1,000 ohms), nanofarads (nF, one billionth of a farad), watts (W) and milliwatts (mW, one thousandth of a watt). In the diagram, VCC labels the positive supply, GND is ground, the shared voltage reference, and NC means not connected.

The selected integrated circuit (IC), a chip containing several electronic functions, is the Texas Instruments SN74HC00N. Its N package is a 14-pin plastic dual-inline package (PDIP). We use a regulated 4.5 V low-voltage bench supply, two push-buttons and one buffered indicator. The complete Python 3.12 model is an optional explanation tool; it is not firmware and does not operate the circuit. No physical assembly, timing measurement or target execution is claimed.

Parts and purpose

A NAND gate performs NOT-AND: its output is low only when both inputs are high. Feeding the output of each of two gates into the other creates a set–reset (SR) latch, a circuit that can retain one of two states while powered. The HC family uses complementary metal-oxide-semiconductor (CMOS) logic. Its inputs need defined voltages and sufficiently quick transitions; a logic drawing does not remove those electrical requirements.

Part Quantity Job
TI SN74HC00N, N PDIP14 1 Two NAND gates form the latch, a third buffers the indicator, and the fourth has defined unused inputs.
1 kΩ resistors 2 Pull each command high when its button is released.
Normally-open push-buttons 2 Apply a low set or reset command by connecting its node to ground.
3.3 kΩ resistor and a red light-emitting diode (LED) 1 each Limit indicator current on a separate gate output.
100 nF ceramic capacitor, at least 10 V rating 1 Local supply bypass close to pins 14 and 7.
Regulated 4.5 V supply, short leads; optional digital multimeter (DMM) 1 set Provide a controlled supply and inspect both latch outputs.

Use ordinary resistor ratings of at least 0.125 W. One pressed button draws about 4.5 V/1 kΩ=4.5 mA; a milliampere (mA) is 0.001 ampere. Its resistor dissipates about 20.25 mW. Both buttons together draw 9 mA through their pull-ups, before adding the chip and indicator. A bench current limit around 30 mA is a conservative troubleshooting setting for this small experiment, not the chip’s allowed operating current.

Cross the feedback, never short the outputs

TI SN74HC00N schematic with four actual NAND symbols: two cross-coupled latch gates, tied-input LED buffer, grounded unused gate, active-low buttons with 1 kΩ pullups, and 100 nF across pins 14 and 7.
Original circuit schematic. Dots join wires; bridges cross without joining. U1 power applies to all four gates; the drawing uses functional gate symbols with physical pin numbers.
Physical pin Connection
14 VCC;7 GND Positive4.5 V supply and ground return;100 nF directly across the pins.
1, first NAND input SET_n node: own 1 kΩ pull-up to4.5 V and SET button to ground.
2, first NAND input Feedback from output 6, called Qbar.
3, first NAND output Q; connect to input 5 and to both indicator-buffer inputs9 and 10.
4, second NAND input RESET_n node: own 1 kΩ pull-up and RESET button to ground.
5;6 Input 5 receives Q; output 6 is Qbar and feeds input 2.
9 and 10;8 Tie both third-gate inputs to Q. Output 8 sinks the optional indicator current.
12 and 13;11 Tie both unused fourth-gate inputs to ground; leave its output 11 open.

Wire with power disconnected. Find the notch, count pins from the top view and check every feedback connection. Q and Qbar are separate outputs; never join them directly. Connect the indicator as4.5 V →3.3 kΩ → LED anode, with LED cathode to pin 8. Its gate inverts Q, so Q high makes pin 8 low and permits light. The indicator load stays off the feedback output itself. A meter with a known10 MΩ input adds only about 0.45 microampere at 4.5 V, but its capacitance and long leads can still affect transitions.

The chip’s recommended supply span is2–6 V, while7 V is an absolute maximum, a stress limit rather than a working setting. We choose4.5 V because its electrical tables give explicit conditions there. The high-input minimum is3.15 V and low-input maximum1.35 V at that supply; values between them are not a third valid logic state. Similar LS, HCT or other manufacturers’ parts require a separate electrical check.

For an illustrative LED forward drop of 2.0 V and an ideal low output, current is (4.5−2.0)/3.3k≈0.76 mA. This is a calculation, not a measured brightness or a guaranteed LED voltage. Even the deliberately conservative zero-drop bound4.5/3.3k≈1.36 mA stays below the datasheet’s4 mA output test condition at 4.5 V. Do not replace that calculation with the 25 mA absolute output-current rating, and do not remove the resistor to obtain a brighter indication.

The four commands and the first power-up

The suffix _n means the command is active low: pressing the button requests the function by pulling its voltage down. SET_n low with RESET_n high forces Q=1 and Qbar=0. RESET_n low with SET_n high forces Q=0 and Qbar=1. Both inputs high request hold. Once a valid state has been established, the cross-coupling keeps that state after the command is released.

Both inputs low force Q=1 and Qbar=1. That is a defined NAND response to an invalid memory command, not output contention and not two stored bits. The LED can be lit in this condition, so one indicator alone cannot prove a valid memory state. Inspect both outputs if that distinction matters.

Illustrative SET_n, RESET_n, Q and Qbar logic waveforms showing startup uncertainty, reset and set, both-low high/high outputs, unknown simultaneous release, and a later reset that restores a known bit.
Original synthetic event sequence. Hatching means an unspecified stored result. Equal event-slot widths do not represent propagation delays or a measured metastability interval.

Release order matters after the forbidden command. If RESET remains low while SET is released, reset wins. If SET remains low while RESET is released, set wins. If both are released together, tiny propagation differences can select either final valid state; there is no specified priority. A real circuit can also pass through an unstable analog condition called metastability, where the voltage has not yet settled into a valid logic level. This article does not calculate its duration or present a host model as a metastability measurement.

At power-up, both released buttons do not initialize the memory to zero. Treat the state as unspecified and apply a deliberate reset after the supply has stabilized. The simple latch has no automatic power-on-reset network. It loses its memory when power is removed, and a lit indicator after a later power-up does not prove that the old bit was retained.

What buttons and input edges add

A contact can bounce, creating several electrical transitions during one press. Repeating the same valid set command while reset remains inactive is idempotent: it keeps the same state rather than toggling it. That property does not make this a general button-debounce or event-counting circuit. Opposing command overlap and wiring noise still matter.

Keep the wires short and do not add a capacitor to either command input. The selected datasheet limits input rise and fall time to500 nanoseconds at 4.5 V. Our1 kΩ pull-ups help charge stray capacitance, but stray capacitance has not been measured and compliance is not guaranteed by the schematic. A first-order resistor-capacitor (RC) estimate would give a 10–90% rise time of roughly2.2RC;227 pF with 1 kΩ is already about 500 ns. This is a planning calculation, not a qualified input waveform. Use an oscilloscope before claiming timing compliance, and investigate slow/noisy inputs with an appropriate input-conditioning design instead of adding arbitrary capacitance.

Complete optional model: preserve uncertainty

Download the complete Python model (ZIP; file: tricky-circuit-batch-006/code/sn74hc00-memory-latch.py) and run it on Python 3.12. It tracks a set of possible stable states. It deliberately refuses to choose a favourite power-up bit or a winner after simultaneous forbidden release. No processor is needed in the hardware circuit.

"""Ideal stable-state model of a NAND SR latch, not firmware or gate timing.
A set of possible states preserves power-up and forbidden-release uncertainty.
Run on Python3.12; no GPIO or electronics simulator is used.
"""
import json
import math


class Latch:
    def __init__(self):
        self.states = {(0, 1), (1, 0)}  # Power-up state is unspecified.
        self.phase = 'POWER_UP_UNKNOWN'

    def step(self, set_n, reset_n):
        if set_n not in (0, 1) or reset_n not in (0, 1):
            raise ValueError('Both active-low inputs must be0 or1')
        if (set_n, reset_n) == (0, 0):
            self.states = {(1, 1)}
            self.phase = 'FORBIDDEN_BOTH_ACTIVE'
        elif set_n == 0:
            self.states = {(1, 0)}
            self.phase = 'SET'
        elif reset_n == 0:
            self.states = {(0, 1)}
            self.phase = 'RESET'
        else:
            # Simultaneous release after the forbidden state has no priority.
            if (1, 1) in self.states:
                self.states = {(0, 1), (1, 0)}
            self.phase = 'HOLD' if len(self.states) == 1 else 'HOLD_UNKNOWN'
        return {'set_n': set_n, 'reset_n': reset_n, 'phase': self.phase,
                'possible_Q_Qbar': [list(s) for s in sorted(self.states)],
                'valid_memory_bit': all(q != qb for q, qb in self.states),
                'Q_known': len({q for q, _ in self.states}) == 1}


def nominal_currents(vdd=4.5, pullup=1000.0, led_r=3300.0, vf=2.0, vol=0.0):
    values = (vdd, pullup, led_r, vf, vol)
    if not all(math.isfinite(v) for v in values):
        raise ValueError('Finite circuit values required')
    if vdd <= 0 or pullup <= 0 or led_r <= 0 or vf < 0 or vol < 0:
        raise ValueError('Positive supply/resistors and nonnegative drops required')
    return {'one_pressed_a': vdd / pullup,
            'both_pressed_a': 2 * vdd / pullup,
            'one_pullup_w': vdd * vdd / pullup,
            'illustrative_led_a': max(0.0, (vdd - vf - vol) / led_r),
            'led_branch_upper_bound_a': vdd / led_r}


def main():
    latch = Latch()
    sequence = [(1, 1), (1, 0), (1, 1), (0, 1), (1, 1),
                (0, 0), (1, 1), (1, 0), (0, 0), (0, 1), (1, 1)]
    print('IDEAL MODEL ONLY: no gate delays, metastability duration or physical test.')
    for set_n, reset_n in sequence:
        print(json.dumps(latch.step(set_n, reset_n)))
    print(json.dumps(nominal_currents()))


if __name__ == '__main__':
    main()

The model validates its input values, prints the invalid1,1 output combination and distinguishes a known bit from two possible valid bits. It is a logical teaching tool. Gate delay, supply ramps, analog thresholds, output loading and the physical uncertainty of a release are outside this model. Invalid numerical inputs raise an error rather than becoming a fabricated button state.

Bench procedure

  1. With power off, check package orientation, input pull-ups, ground and the bypass capacitor. Confirm that unused gate inputs are defined and output 11 is open.
  2. Apply the regulated 4.5 V supply. Record the initial outputs without assuming an expected bit. Then press RESET alone, release it and verify Q low/Qbar high.
  3. Press SET alone and release it. Verify Q high/Qbar low and the buffered indicator. Repeat each same command several times to distinguish storage from a toggle.
  4. Press both buttons. Measure both outputs: the expected static logical result is high/high. Record that the LED cannot distinguish this invalid condition from Q high in a valid state.
  5. Keep RESET pressed and release SET first; observe the reset state. Repeat with SET kept pressed while RESET is released.
  6. Release both as nearly together as practical several times. Record outcomes without declaring a predictable priority from a few trials. A meter cannot capture a brief unstable waveform.
  7. Power-cycle, record the new initial state and deliberately reset again. Remove the LED branch with power off and repeat if loading or supply disturbance is suspected.

The blank observation sheet (ZIP; file: tricky-circuit-batch-006/code/sn74hc00-memory-latch-observations-blank.csv) contains no results. The 32 author host checks run the actual supplied model, including both NAND equations for forced states, repeated commands, both release orders, unknown startup/release, malformed input and nominal current arithmetic. They establish software behavior, not a physical memory circuit or measured transition time.

Challenge: Can Q and Qbar both be one if they are supposed to be complements? Answer: Yes, while both active-low commands are asserted. “Complementary” describes the two valid stored states. The forbidden command suspends that relationship, and releasing it without a controlled valid command does not specify which bit wins.

Sources and related learning

The 20October2026 source review did not identify a separate applicable catalog-device errata document; that is not a guarantee of absence. This is a distinct storage/invalid-command experiment, rather than the site’s existing package-identification overview or microcontroller button lessons. Continue with the electronics lessons and the LED-current experiment when comparing an indicator calculation with a real measurement.

📡Broadcast the signal — amplify the connection.

Leave a Reply

Temu affiliate offers

Find your next electronics project

Explore these do-it-yourself project kits. Check the selected option, included parts and instructions on each offer.

Tricky Circuit may earn a commission if you buy through these Temu affiliate links. These are product ideas; they have not been bench-tested by Tricky Circuit and are not verified lesson parts lists.

Supplier photo of a breadboard, jumper wires and assorted electronic components in a plastic storage case.

Supplier product photo

Try breadboard experiments

Breadboard, wires and assorted parts. Arduino controller board not included.

View kit on Temu

Supplier photo of an assembled blue surface-mount soldering practice board with a circular ring of small lights.

Supplier product photo

Solder a chasing-light board

Surface-mount soldering practice. Battery and battery holder not included.

View kit on Temu

Supplier photo of an assembled two-wheeled line-following car with a blue circuit board, two motors and an empty battery holder.

Supplier product photo

Build a line-following car

Soldering and assembly required. Check battery and track requirements before buying.

View kit on Temu