# NAND Gate Logic Optimization

I'm new to discrete logic (I come from the spoiled Arduino/\$1 ATTiny generation) and I'm trying to design a safety circuit that would assert FAIL on the second attempt to ENABLE the OUTPUT if the SAFETY input hasn't been disengaged(and re-engaged) after the first attempt.

Simply put, I am trying to prevent the device from running 2 times in a row without being reset via the SAFETY switch after every run.

Here is a simplified signal diagram and simulation of the circuit.

I need to create a truth table for this circuit, but I can't wrap my head around even whether this is a synchronous or asynchronous circuit, because the Clock (well Gate, or Enable, however you want to put it) is connected to one of the Inputs, and I have a monostable multivibrator on the Set of the latch, which actually changes state during the clock cycle.

Here is a more detailed signal diagram, including all the inputs and outputs that I think are relevant to analyzing the states of the circuit.

Please help me make heads or tails out of this, and if you have any optimization suggestions, I'm open for all input!

Your wisdom is much appreciated!

PS.: Thanks to everyone who commented & showed me I need to go deeper!

• You can buy flip-flop IC's, you know. Anyway, I am not sure what your circuit is supposed to do. Probably you need to show a truth table or state table or state transition diagram. Commented Jun 13, 2016 at 6:52
• Indeed, a truth table is mandatory here. "circuit that would trigger when the second input DOESN'T change while the first was LOW" isn't clear enough. Trigger by changing state ? Trigger by outputting a short high pulse ? Low pulse ? Also, something that should trigger when an input doesn't change makes no sense, unless you tell us the timing after which we must consider it hasn't changed.
– dim
Commented Jun 13, 2016 at 7:28
• Thanks for the feedback, I hope the new info helps make my question clearer! Commented Jun 14, 2016 at 14:39
• Make sure that you're not relying on the electronics for safety. The power to the hazard must be disabled by hard-wired devices. Commented Jun 16, 2016 at 18:17