A flip-flop simulator on real 74HC chips
Mokxi is a free online flip-flop simulator that runs in your browser, with nothing to install and no account needed. Two NAND gates of a 74HC00, each one’s output wired into the other’s input: an SR latch, the smallest circuit that remembers a bit. A slide switch sets and resets it, and two LEDs show Q and Q-bar.
- 455parts on the bench
- 43boards running now
- 1.00xreal time, on every board
What you can do here
In the circuit above, or in the editor it opens.
- Set and reset an SR latch made of two cross-coupled NAND gates
- Clock a 74HC74 D flip-flop from a button and watch it copy D on the edge
- Build a JK flip-flop, or a T flip-flop that toggles on every clock
- Chain flip-flops into a counter or a shift register
- Watch Q and Q-bar on the logic analyzer as the clock runs
- Package your latch as a chip of your own and reuse it
What the running circuit shows
Two gates that hold each other’s answer.
Each NAND gate’s output goes to one input of the other, and the free input of each, set and reset, is held high by a 10k pull-up. Both are active low: the switch grounds one of them, that gate’s output goes high, and the other gate, now seeing a high on both inputs, goes low and feeds that back. In the engine the latch starts set, with the green Q LED lit and the red Q-bar LED dark; slide the switch and they swap.
The gates are a real 74HC00, powered from its own VCC and GND pins, so the outputs are real voltages: Q sits at about 4.74 V with the green LED lit and about 8.7 mA through it, and Q-bar at about 4.60 V with the red one lit and about 13.2 mA. The 74HC74 on the same bench is a D flip-flop: move its D switch and nothing happens; press the clock button and Q takes the new value on the rising edge, then holds it however D moves.
How the flip-flops are modeled
Chips with pins, thresholds and delays.
Each gate answers by the controlling-value rule: a NAND with a 0 on either input knows its output is 1 even if the other input is still unknown. That is what lets the latch climb out of the unknown state it powers up in, the way a real one does. Every change reaches the output after the 74HC00’s typical 9 nanosecond delay, and an unpowered chip’s outputs float rather than read 0.
What it leaves out: the slide switch here is always on one side or the other, so the moment a real switch spends between its contacts, when both inputs are high and the latch is holding, passes too fast to see. Wire set and reset to two pushbuttons with pull-ups instead and the latch holds its bit while neither is pressed. Metastability, a flip-flop caught exactly on an edge, is not modeled.
Questions
Is it free?
Yes. The circuit on this page, every part in it and the editor it opens in are on the free plan, with no card.
Do I need an account?
No. The circuit runs the moment the page does, and the editor opens without one. A free account is only for saving a project to the cloud and sharing it by link.
Can I simulate a JK flip-flop?
Yes. Build one from a 74HC74 and its steering gates, D = J·Q-bar + K-bar·Q, as the flip-flops page does, and tie J and K high for a T flip-flop that toggles on every clock.
What is the difference between a latch and a flip-flop?
A latch, like the one above, follows its inputs whenever they change. A flip-flop changes only on a clock edge: a 74HC74 copies D at the instant its clock rises and ignores D the rest of the time.
Does it work on a Chromebook?
Yes. It runs in Chrome with nothing to install, which is how many school digital electronics classes use it.
More simulators
Each one opens on a circuit that is already running.
Set a latch
Open the circuit, flip the switch and press Run. Nothing to install, and no account needed.